Core: Gui: SoFCSysDragger: changes to SoFCDB to store dragger.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
# include <Inventor/VRMLnodes/SoVRMLGroup.h>
|
||||
# include <Inventor/VRMLnodes/SoVRMLParent.h>
|
||||
# include <Inventor/SbString.h>
|
||||
# include <Inventor/nodes/SoGroup.h>
|
||||
#endif
|
||||
|
||||
#include <Base/FileInfo.h>
|
||||
@@ -53,6 +54,7 @@
|
||||
#include "Inventor/SoDrawingGrid.h"
|
||||
#include "Inventor/SoAutoZoomTranslation.h"
|
||||
#include "Inventor/MarkerBitmaps.h"
|
||||
#include "SoFCCSysDragger.h"
|
||||
|
||||
#include "propertyeditor/PropertyItem.h"
|
||||
#include "NavigationStyle.h"
|
||||
@@ -64,6 +66,7 @@ using namespace Gui::Inventor;
|
||||
using namespace Gui::PropertyEditor;
|
||||
|
||||
static SbBool init_done = false;
|
||||
static SoGroup *storage = nullptr;
|
||||
|
||||
SbBool Gui::SoFCDB::isInitialized(void)
|
||||
{
|
||||
@@ -112,6 +115,7 @@ void Gui::SoFCDB::init()
|
||||
SoDrawingGrid ::initClass();
|
||||
SoAutoZoomTranslation ::initClass();
|
||||
MarkerBitmaps ::initClass();
|
||||
SoFCCSysDragger ::initClass();
|
||||
|
||||
PropertyItem ::init();
|
||||
PropertySeparatorItem ::init();
|
||||
@@ -160,6 +164,10 @@ void Gui::SoFCDB::init()
|
||||
qRegisterMetaType<Base::Quantity>("Base::Quantity");
|
||||
qRegisterMetaType<QList<Base::Quantity> >("Base::QuantityList");
|
||||
init_done = true;
|
||||
|
||||
assert(!storage);
|
||||
storage = new SoGroup();
|
||||
storage->ref();
|
||||
}
|
||||
|
||||
void Gui::SoFCDB::finish()
|
||||
@@ -181,6 +189,9 @@ void Gui::SoFCDB::finish()
|
||||
SoFCEnableHighlightAction ::finish();
|
||||
SoFCSelectionColorAction ::finish();
|
||||
SoFCHighlightColorAction ::finish();
|
||||
|
||||
storage->unref();
|
||||
storage = nullptr;
|
||||
}
|
||||
|
||||
// buffer acrobatics for inventor ****************************************************
|
||||
@@ -287,3 +298,9 @@ bool Gui::SoFCDB::writeToFile(SoNode* node, const char* filename, bool binary)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SoGroup* Gui::SoFCDB::getStorage()
|
||||
{
|
||||
assert(storage); //call init first.
|
||||
return storage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user