Commit 4aa93261 authored by Matthias Möller's avatar Matthias Möller

create correct object on poly/tri mesh copy

closes #2448

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@20589 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0bf0cad5
......@@ -458,12 +458,6 @@
}
template < class MeshT >
BaseObject* MeshObject< MeshT >::copy() {
MeshObject< MeshT >* object = new MeshObject< MeshT >(*this );
return dynamic_cast< BaseObject* >(object);
}
// ===============================================================================
// Visualization
// ===============================================================================
......
......@@ -165,11 +165,6 @@ class DLLEXPORTONLY MeshObject : public BaseObjectData {
/// Update Texture of all data structures
void updateTexture();
/** return a full copy of this object ( All scenegraph nodes will be created )
* but the object will not be a part of the object tree.
*/
BaseObject* copy();
private:
MeshT* mesh_;
......
......@@ -27,6 +27,11 @@ PolyMeshObject::~PolyMeshObject() {
}
BaseObject* PolyMeshObject::copy() {
PolyMeshObject* object = new PolyMeshObject(*this );
return object;
}
/// Refine picking on triangle meshes
ACG::Vec3d PolyMeshObject::refinePick(ACG::SceneGraph::PickTarget _pickTarget, const ACG::Vec3d _hitPoint, const ACG::Vec3d _start , const ACG::Vec3d _dir, const unsigned int _targetIdx ) {
if ( _pickTarget == ACG::SceneGraph::PICK_FACE) {
......
......@@ -81,6 +81,11 @@ public:
/// destructor
virtual ~PolyMeshObject();
/** return a full copy of this object ( All scenegraph nodes will be created )
* but the object will not be a part of the object tree.
*/
BaseObject* copy();
public:
/// Refine picking on triangle meshes
ACG::Vec3d refinePick(ACG::SceneGraph::PickTarget _pickTarget, const ACG::Vec3d _hitPoint, const ACG::Vec3d _start , const ACG::Vec3d _dir, const unsigned int _targetIdx );
......
......@@ -70,6 +70,11 @@ TriMeshObject::~TriMeshObject() {
}
BaseObject* TriMeshObject::copy() {
TriMeshObject* object = new TriMeshObject(*this );
return object;
}
/// Refine picking on triangle meshes
ACG::Vec3d TriMeshObject::refinePick(ACG::SceneGraph::PickTarget _pickTarget, const ACG::Vec3d _hitPoint, const ACG::Vec3d _start , const ACG::Vec3d _dir, const unsigned int _targetIdx ) {
if ( _pickTarget == ACG::SceneGraph::PICK_FACE) {
......
......@@ -84,6 +84,11 @@ public:
/// destructor
virtual ~TriMeshObject();
/** return a full copy of this object ( All scenegraph nodes will be created )
* but the object will not be a part of the object tree.
*/
BaseObject* copy();
public:
/// Refine picking on triangle meshes
ACG::Vec3d refinePick(ACG::SceneGraph::PickTarget _pickTarget, const ACG::Vec3d _hitPoint, const ACG::Vec3d _start , const ACG::Vec3d _dir, const unsigned int _targetIdx );
......
Markdown is supported
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