-// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
// VISU OBJECT : interactive object for VISU entities implementation
//
#include "VISU_Table_i.hh"
+#include "VISU_Tools.h"
#include "VISU_CutLinesBase_i.hh"
#include "VISU_CutSegment_i.hh"
#include "VISU_Result_i.hh"
myLineWidth = 0;
myMarker = VISU::Curve::CIRCLE;
myColor.R = 0.0; myColor.G = 0.0; myColor.B = 0.0;
+ myScale = 1.0;
}
/*!
Destructor
return myLineWidth;
}
+//----------------------------------------------------------------------------
+void
+VISU::Curve_i
+::SetScale( CORBA::Double theCoef )
+{
+ myScale = theCoef;
+ UpdatePlot2d( this, eUpdateData );
+}
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::Curve_i
+::GetScale()
+{
+ return myScale;
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::Curve_i
+::RemoveScale()
+{
+ SetScale( 1.0 );
+}
+
//----------------------------------------------------------------------------
/*!
Creates curve object
crv->setIO(new SALOME_InteractiveObject(aString.in(), "VISU", GetName().c_str()));
if ( myTable )
crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry().c_str(), "VISU", myTable->GetName().c_str()));
+
+ if(!myContainers.isEmpty())
+ crv->addOwners(myContainers);
return crv;
}
/*!
QString v2_str = VISU::Storable::FindValue(theMap,"myIsV2", &ok);
myIsV2 = ok ? v2_str.toInt() : false;
+ QString scale_str = VISU::Storable::FindValue(theMap,"myScale", &ok);
+ myScale = ok ? scale_str.toDouble() : 1.0;
myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
Storable::DataToStream( theStr, "myVRow", myVRow );
Storable::DataToStream( theStr, "myZRow", myZRow );
Storable::DataToStream( theStr, "myIsV2", myIsV2 );
+ Storable::DataToStream( theStr, "myScale", myScale );
Storable::DataToStream( theStr, "myColor.R", myColor.R );
Storable::DataToStream( theStr, "myColor.G", myColor.G );
Storable::DataToStream( theStr, "myColor.B", myColor.B );
void VISU::Curve_i::RemoveFromStudy()
{
+
+ //remove curve from containers
+ PortableServer::POA_ptr aPOA = GetPOA();
+ ContainerSet::ConstIterator it = myContainers.begin();
+ for ( ; it != myContainers.end(); it++ ) {
+ SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectID( (*it).toLatin1().data() );
+ if ( aSObject->_is_nil() ) continue;
+
+ CORBA::Object_var anObj = VISU::SObjectToObject( aSObject );
+ if ( CORBA::is_nil( anObj ) ) continue;
+ VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>( VISU::GetServant( anObj.in() ).in() );
+ if ( !aContainer ) continue;
+ aContainer->RemoveCurve(VISU::Curve::_narrow(aPOA->servant_to_reference(this)));
+ }
+
struct TRemoveFromStudy: public SALOME_Event
{
VISU::Curve_i* myRemovable;
return mySObj;
}
+
+/*!
+ Add container.
+ id - owner of the curve
+*/
+void VISU::Curve_i::addContainer(const QString& id) {
+ myContainers.insert(id);
+}
+
+/*!
+ Remove Container
+ id - entry of the container
+*/
+void VISU::Curve_i::removeContainer(const QString& id) {
+ myContainers.insert(id);
+}
+
+/*!
+ Get all owners of the curve.
+ \return owners of the curve.
+*/
+VISU::ContainerSet VISU::Curve_i::getContainers() const {
+ return myContainers;
+}
+
+
//----------------------------------------------------------------
// Container Object
//----------------------------------------------------------------
SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::SObject_var newSO = Builder->NewObject( mySO );
Builder->Addreference( newSO, SO );
+ pCurve->addContainer(GetEntry().c_str());
}
}
}
Builder->RemoveObject( childSO );
}
}
+ pCurve->removeContainer(GetEntry().c_str());
}
}
}
*/
CORBA::Long VISU::Container_i::GetNbCurves()
{
- Update();
+ // Update();
return myCurves.count();
}
/*!