Commit 03d55fd7 authored by Isaak Lim's avatar Isaak Lim

always set a newly created object (via addEmpty) to be target for most types

parent efd6e2ac
Pipeline #2290 passed with stage
in 88 minutes and 55 seconds
......@@ -274,11 +274,7 @@ addEmpty()
// new object data struct
BSplineCurveObject * object = new BSplineCurveObject();
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
if (PluginFunctions::targetCount() == 0 )
object->target(true);
object->target(true);
QString name = "BSplineCurve_" + QString::number( object->id() ) + ".bsc";
......
......@@ -272,11 +272,7 @@ addEmpty()
// new object data struct
BSplineSurfaceObject * object = new BSplineSurfaceObject();
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
if (PluginFunctions::targetCount() == 0 )
object->target(true);
object->target(true);
QString name = "BSplineSurface_" + QString::number( object->id() ) + ".bss";
......
......@@ -116,10 +116,7 @@ int TypeCameraPlugin::addEmpty() {
// new object data struct
CameraObject* object = new CameraObject ();
if ( PluginFunctions::objectCount() == 1 ||
PluginFunctions::targetCount() == 0) {
object->target ( true );
}
object->target ( true );
QString name = QString(tr("New Camera %1.cam").arg( object->id() ));
......
......@@ -65,11 +65,7 @@ int TypeCoordsysPlugin::addEmpty(){
// new object data struct
CoordsysObject * object = new CoordsysObject();
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
if (PluginFunctions::targetCount() == 0 )
object->target(true);
object->target(true);
QString name = QString(tr("New Coordinate System %1.cos").arg( object->id() ));
......
......@@ -103,11 +103,7 @@ int TypeHexahedralMeshPlugin::addEmpty() {
// New object data struct
HexahedralMeshObject* object = new HexahedralMeshObject(DATA_HEXAHEDRAL_MESH);
if (PluginFunctions::objectCount() == 1)
object->target(true);
if (PluginFunctions::targetCount() == 0)
object->target(true);
object->target(true);
QString name = QString(tr("New Hexahedral Mesh %1.ovm").arg( object->id() ));
......
......@@ -69,11 +69,7 @@ int TypePlanePlugin::addEmpty(){
// new object data struct
PlaneObject * object = new PlaneObject();
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
if (PluginFunctions::targetCount() == 0 )
object->target(true);
object->target(true);
QString name = QString(tr("New Plane %1.pla").arg( object->id() ));
......
......@@ -67,12 +67,8 @@ int TypePolyLinePlugin::addEmpty(){
// new object data struct
PolyLineObject * object = new PolyLineObject();
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
object->target(true);
if (PluginFunctions::targetCount() == 0 )
object->target(true);
QString name = tr("New PolyLine %1.pol").arg( object->id() );
// call the local function to update names
......
......@@ -75,11 +75,7 @@ int TypePolyMeshPlugin::addEmpty(){
// new object data struct
PolyMeshObject * object = new PolyMeshObject( typeId("PolyMesh") );
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
if (PluginFunctions::targetCount() == 0 )
object->target(true);
object->target(true);
QString name = QString(tr("New PolyMesh %1.off").arg( object->id() ));
......
......@@ -111,11 +111,7 @@ int TypePolyhedralMeshPlugin::addEmpty() {
// new object data struct
PolyhedralMeshObject* object = new PolyhedralMeshObject(DATA_POLYHEDRAL_MESH);
if (PluginFunctions::objectCount() == 1)
object->target(true);
if (PluginFunctions::targetCount() == 0)
object->target(true);
object->target(true);
QString name = QString(tr("New PolyHedral Mesh %1.ovm").arg( object->id() ));
......
......@@ -193,11 +193,7 @@ int TypeSkeletonPlugin::addEmpty(){
// new object data struct
SkeletonObject * object = new SkeletonObject();
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
if (PluginFunctions::targetCount() == 0 )
object->target(true);
object->target(true);
QString name = QString(tr("New Skeleton %1.skl").arg( object->id() ));
......
......@@ -70,11 +70,7 @@ int TypeSpherePlugin::addEmpty(){
// new object data struct
SphereObject * object = new SphereObject();
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
if (PluginFunctions::targetCount() == 0 )
object->target(true);
object->target(true);
QString name = QString(tr("New Sphere %1.sph").arg( object->id() ));
......
......@@ -296,11 +296,7 @@ int TypeSplatCloudPlugin::addEmpty()
if( object == 0 )
return -1;
if( PluginFunctions::objectCount() == 1 )
object->target( true );
if( PluginFunctions::targetCount() == 0 )
object->target( true );
object->target( true );
QString name = QString(tr("New Splat Cloud %1.spl").arg( object->id() ));
......
......@@ -74,11 +74,7 @@ int TypeTriangleMeshPlugin::addEmpty(){
// new object data struct
TriMeshObject * object = new TriMeshObject( typeId("TriangleMesh") );
if ( PluginFunctions::objectCount() == 1 )
object->target(true);
if (PluginFunctions::targetCount() == 0 )
object->target(true);
object->target(true);
QString name = QString(tr("TriangleMesh new %1.off").arg( object->id() ));
......
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