Commit 26d21674 authored by Jan Möbius's avatar Jan Möbius
Browse files

Get rid of separator node when creating objects. The objects have to do it themselves

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8347 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e5075ca9
......@@ -93,8 +93,8 @@
* objectDataType has to match the one of MeshT ( see Types.hh::DataType )
*/
template < class MeshT >
MeshObject< MeshT >::MeshObject( SeparatorNode* _rootNode, DataType _typeId ) :
BaseObjectData(_rootNode ),
MeshObject< MeshT >::MeshObject( DataType _typeId ) :
BaseObjectData(),
mesh_(0),
statusNode_(0),
areaNode_(0),
......
......@@ -115,10 +115,9 @@ class DLLEXPORTONLY MeshObject : public BaseObjectData {
* This is the standard constructor for MeshObjects. As triangle and Poly Meshes are handled by this class, the
* typeId is passed to the MeshObject to specify it.
*
* @param _rootNode This is the root Node, where the MeshObject will be added.
* @param _typeId This is the type Id the Object will use. Should be typeId("TriangleMesh") or typeId("PolyMesh")
*/
MeshObject(SeparatorNode* _rootNode, DataType _typeId);
MeshObject(DataType _typeId);
/// destructor
virtual ~MeshObject();
......
......@@ -23,8 +23,8 @@
* You dont need to create an object of this type manually. Use
* PluginFunctions::addPlane instead. ( see Types.hh::DataType )
*/
PlaneObject::PlaneObject( SeparatorNode* _rootNode ) :
BaseObjectData(_rootNode ),
PlaneObject::PlaneObject( ) :
BaseObjectData( ),
planeNode_(NULL)
{
setDataType(DATA_PLANE);
......
......@@ -31,7 +31,7 @@ class DLLEXPORT PlaneObject : public BaseObjectData {
public:
/// constructor
PlaneObject(SeparatorNode* _rootNode);
PlaneObject();
/** \brief copy constructor
*
......
......@@ -52,9 +52,12 @@
//== INCLUDES =================================================================
#include "Types.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
#include <ACG/Scenegraph/SceneGraph.hh>
#include <OpenFlipper/common/BaseObjectCore.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <QDir>
//== TYPEDEFS =================================================================
......@@ -75,11 +78,11 @@ BaseObjectData::BaseObjectData(const BaseObjectData& _object)
init();
}
BaseObjectData::BaseObjectData( SeparatorNode* _rootNode ) :
BaseObjectData::BaseObjectData() :
BaseObject(),
path_("."),
manipPlaced_(false),
rootNode_(_rootNode),
rootNode_( dynamic_cast< ACG::SceneGraph::SeparatorNode* > (PluginFunctions::getRootNode()) ),
separatorNode_(0),
manipulatorNode_(0),
materialNode_(0),
......@@ -153,8 +156,8 @@ void BaseObjectData::init() {
void BaseObjectData::setFromFileName(QString _filename ) {
QString str = _filename;
path_ = str.section(OpenFlipper::Options::dirSeparator(),0,-2);
setName(str.section(OpenFlipper::Options::dirSeparator(),-1));
path_ = str.section(QDir::separator() ,0,-2);
setName(str.section(QDir::separator(),-1));
}
void BaseObjectData::setName( QString _name ) {
......
......@@ -108,7 +108,7 @@ class DLLEXPORT BaseObjectData : public BaseObject
BaseObjectData(const BaseObjectData& _object);
/// constructor
BaseObjectData(SeparatorNode* _rootNode);
BaseObjectData();
///destructor
virtual ~BaseObjectData();
......
......@@ -58,7 +58,7 @@ bool TypePlanePlugin::registerType() {
int TypePlanePlugin::addEmpty(){
// new object data struct
PlaneObject * object = new PlaneObject(dynamic_cast < ACG::SceneGraph::SeparatorNode* >( PluginFunctions::getRootNode() ));
PlaneObject * object = new PlaneObject();
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
......
......@@ -59,7 +59,7 @@ bool TypePolyMeshPlugin::registerType() {
int TypePolyMeshPlugin::addEmpty(){
// new object data struct
PolyMeshObject * object = new PolyMeshObject(dynamic_cast < ACG::SceneGraph::SeparatorNode* >( PluginFunctions::getRootNode()) , typeId("PolyMesh") );
PolyMeshObject * object = new PolyMeshObject( typeId("PolyMesh") );
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
......
......@@ -58,7 +58,7 @@ bool TypeTriangleMeshPlugin::registerType() {
int TypeTriangleMeshPlugin::addEmpty(){
// new object data struct
TriMeshObject * object = new TriMeshObject(dynamic_cast < ACG::SceneGraph::SeparatorNode* >( PluginFunctions::getRootNode() ),typeId("TriangleMesh"));
TriMeshObject * object = new TriMeshObject( typeId("TriangleMesh") );
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment