Core: Gui: SoFCSysDragger: changes to SoFCDB to store dragger.
This commit is contained in:
parent
56e5837fd3
commit
381a59bb36
|
@ -27,6 +27,7 @@
|
||||||
# include <Inventor/VRMLnodes/SoVRMLGroup.h>
|
# include <Inventor/VRMLnodes/SoVRMLGroup.h>
|
||||||
# include <Inventor/VRMLnodes/SoVRMLParent.h>
|
# include <Inventor/VRMLnodes/SoVRMLParent.h>
|
||||||
# include <Inventor/SbString.h>
|
# include <Inventor/SbString.h>
|
||||||
|
# include <Inventor/nodes/SoGroup.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <Base/FileInfo.h>
|
#include <Base/FileInfo.h>
|
||||||
|
@ -53,6 +54,7 @@
|
||||||
#include "Inventor/SoDrawingGrid.h"
|
#include "Inventor/SoDrawingGrid.h"
|
||||||
#include "Inventor/SoAutoZoomTranslation.h"
|
#include "Inventor/SoAutoZoomTranslation.h"
|
||||||
#include "Inventor/MarkerBitmaps.h"
|
#include "Inventor/MarkerBitmaps.h"
|
||||||
|
#include "SoFCCSysDragger.h"
|
||||||
|
|
||||||
#include "propertyeditor/PropertyItem.h"
|
#include "propertyeditor/PropertyItem.h"
|
||||||
#include "NavigationStyle.h"
|
#include "NavigationStyle.h"
|
||||||
|
@ -64,6 +66,7 @@ using namespace Gui::Inventor;
|
||||||
using namespace Gui::PropertyEditor;
|
using namespace Gui::PropertyEditor;
|
||||||
|
|
||||||
static SbBool init_done = false;
|
static SbBool init_done = false;
|
||||||
|
static SoGroup *storage = nullptr;
|
||||||
|
|
||||||
SbBool Gui::SoFCDB::isInitialized(void)
|
SbBool Gui::SoFCDB::isInitialized(void)
|
||||||
{
|
{
|
||||||
|
@ -112,6 +115,7 @@ void Gui::SoFCDB::init()
|
||||||
SoDrawingGrid ::initClass();
|
SoDrawingGrid ::initClass();
|
||||||
SoAutoZoomTranslation ::initClass();
|
SoAutoZoomTranslation ::initClass();
|
||||||
MarkerBitmaps ::initClass();
|
MarkerBitmaps ::initClass();
|
||||||
|
SoFCCSysDragger ::initClass();
|
||||||
|
|
||||||
PropertyItem ::init();
|
PropertyItem ::init();
|
||||||
PropertySeparatorItem ::init();
|
PropertySeparatorItem ::init();
|
||||||
|
@ -160,6 +164,10 @@ void Gui::SoFCDB::init()
|
||||||
qRegisterMetaType<Base::Quantity>("Base::Quantity");
|
qRegisterMetaType<Base::Quantity>("Base::Quantity");
|
||||||
qRegisterMetaType<QList<Base::Quantity> >("Base::QuantityList");
|
qRegisterMetaType<QList<Base::Quantity> >("Base::QuantityList");
|
||||||
init_done = true;
|
init_done = true;
|
||||||
|
|
||||||
|
assert(!storage);
|
||||||
|
storage = new SoGroup();
|
||||||
|
storage->ref();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gui::SoFCDB::finish()
|
void Gui::SoFCDB::finish()
|
||||||
|
@ -181,6 +189,9 @@ void Gui::SoFCDB::finish()
|
||||||
SoFCEnableHighlightAction ::finish();
|
SoFCEnableHighlightAction ::finish();
|
||||||
SoFCSelectionColorAction ::finish();
|
SoFCSelectionColorAction ::finish();
|
||||||
SoFCHighlightColorAction ::finish();
|
SoFCHighlightColorAction ::finish();
|
||||||
|
|
||||||
|
storage->unref();
|
||||||
|
storage = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// buffer acrobatics for inventor ****************************************************
|
// buffer acrobatics for inventor ****************************************************
|
||||||
|
@ -287,3 +298,9 @@ bool Gui::SoFCDB::writeToFile(SoNode* node, const char* filename, bool binary)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SoGroup* Gui::SoFCDB::getStorage()
|
||||||
|
{
|
||||||
|
assert(storage); //call init first.
|
||||||
|
return storage;
|
||||||
|
}
|
||||||
|
|
|
@ -28,9 +28,10 @@
|
||||||
#include <Inventor/SbBasic.h>
|
#include <Inventor/SbBasic.h>
|
||||||
|
|
||||||
class SoNode;
|
class SoNode;
|
||||||
|
class SoGroup;
|
||||||
namespace Gui {
|
namespace Gui {
|
||||||
/**
|
/**
|
||||||
* The FreeCAD database class to initialioze all onw Inventor nodes.
|
* The FreeCAD database class to initialize all our own Inventor nodes.
|
||||||
* @author Werner Mayer
|
* @author Werner Mayer
|
||||||
*/
|
*/
|
||||||
class GuiExport SoFCDB
|
class GuiExport SoFCDB
|
||||||
|
@ -44,6 +45,10 @@ public:
|
||||||
static bool writeToVRML(SoNode* node, const char* filename, bool binary);
|
static bool writeToVRML(SoNode* node, const char* filename, bool binary);
|
||||||
// Write to VRML or Inventor file
|
// Write to VRML or Inventor file
|
||||||
static bool writeToFile(SoNode* node, const char* filename, bool binary);
|
static bool writeToFile(SoNode* node, const char* filename, bool binary);
|
||||||
|
/*! container for app lifetime storage. See SoFCCSysDragger for details
|
||||||
|
* on why this is needed.
|
||||||
|
*/
|
||||||
|
static SoGroup* getStorage();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Gui
|
} // namespace Gui
|
||||||
|
|
Loading…
Reference in New Issue
Block a user