Permalink
Browse files

Merge branch 'kchen' of https://github.com/mdfeist/BlinkAnalysis into…

… Mike
  • Loading branch information...
2 parents 00cd62d + 79d91c0 commit 70884f0f5bc2d3c99fbb4540933aaa124e76fd3e @mdfeist committed Jun 17, 2013
Showing with 16 additions and 6 deletions.
  1. +2 −1 BlinkAnalysis/CaptureWorld.cpp
  2. +8 −3 BlinkAnalysis/MainForm.h
  3. +5 −1 BlinkAnalysis/WorldManager.cpp
  4. +1 −1 BlinkAnalysis/WorldManager.h
@@ -256,7 +256,8 @@ osg::MatrixTransform* CaptureWorld::getAsGroup(bool renderMatrix)
for (objects_iterator itr = _objects.begin(); itr != _objects.end(); itr++)
{
// TODO
- node->addChild(itr->second->getAsGeode());
+ if (itr->second->renderObject())
+ node->addChild(itr->second->getAsGeode());
}
return node;
View
@@ -2003,10 +2003,13 @@ private: System::Windows::Forms::DataGridViewTextBoxColumn^ objectValueColumn;
}
private: System::Void MainForm_Closed( Object^ /*sender*/, System::EventArgs ^ e )
{
+ AppViewer::stopAppViewer();
+
ClientHandler* client = AppData::getInstance()->getClient();
if (client) {
NatNetClientSetup::deleteClient(&client);
+ client->clearLabeledMarkers();
std::map<int, RigidBody*>* bodyMap = client->getRigidBodyMap();
for (std::map<int, RigidBody*>::iterator it=bodyMap->begin(); it!=bodyMap->end(); ++it)
@@ -2023,7 +2026,7 @@ private: System::Windows::Forms::DataGridViewTextBoxColumn^ objectValueColumn;
delete client;
}
- AppViewer::stopAppViewer();
+ WorldManager::getInstance()->clearWorlds();
#if _DEBUG
_WATCH_MEMORY
@@ -2653,7 +2656,8 @@ private: System::Void worldGridView_displayWorld() {
this->worldGridView->Rows->Add(row);
// set certain rows to read only
- for (int i = 0; i <= (int) worldProperty::RENDER; i++)
+ int numRows = this->worldGridView->Rows->Count;
+ for (int i = 0; i < numRows; i++)
{
this->worldGridView->Rows[i]->ReadOnly = true;
}
@@ -2783,7 +2787,8 @@ private: System::Void objectGridView_displayObject() {
this->objectGridView->Rows->Add(row);
// set certain rows to read only
- for (int i = 0; i <= (int) objectProperty::RENDER; i++)
+ int numRows = this->objectGridView->Rows->Count;
+ for (int i = 0; i < numRows; i++)
{
this->objectGridView->Rows[i]->ReadOnly = true;
}
@@ -58,15 +58,19 @@ bool WorldManager::removeWorld(int id)
if (itr == worlds.end())
return false;
+ itr->second->setRender(false);
+
delete itr->second;
worlds.erase(id);
return true;
}
-void WorldManager::clearWorlds()
+void WorldManager::clearWorlds(bool stopRender)
{
for (worlds_iterator itr = worlds.begin(); itr != worlds.end(); itr++)
{
+ if (stopRender)
+ itr->second->setRender(false);
delete itr->second;
}
worlds.clear();
@@ -20,7 +20,7 @@ public class WorldManager
int getNumberWorlds();
std::map<int, CaptureWorld*> getWorlds();
bool removeWorld(int id);
- void clearWorlds();
+ void clearWorlds(bool stopRender = false);
protected:
WorldManager(void);

0 comments on commit 70884f0

Please sign in to comment.