From e0ba49a03cd64f69e9b039f0058bc711f621a652 Mon Sep 17 00:00:00 2001 From: andreja6 Date: Sun, 21 Oct 2018 15:36:17 -0700 Subject: [PATCH] Attempted to make duplicate --- G3DTest.vcproj | 1 - Instance.cpp | 7 +++++ Instance.h | 2 ++ PhysicalInstance.cpp | 70 +++++++++++++++++++++----------------------- PhysicalInstance.h | 7 ++++- Surface.h | 2 +- main.cpp | 10 +++++-- 7 files changed, 58 insertions(+), 41 deletions(-) diff --git a/G3DTest.vcproj b/G3DTest.vcproj index 932a338..6804e0b 100644 --- a/G3DTest.vcproj +++ b/G3DTest.vcproj @@ -169,7 +169,6 @@ /> name == "Duplicate") { - + std::vector newinst; + for(size_t i = 0; i < selectedInstances.size(); i++) + { + Instance* inst = selectedInstances.at(i)->clone(); + newinst.push_back(inst); + inst->setParent(selectedInstances.at(i)->getParent()); + } + selectedInstances = newinst; } } - } class RotateButtonListener : public ButtonListener {