};
//-------------------------------------------------------
+ interface Result;
/*! \brief 3D presentation interface
*
* This is a root class for all 3D presentations, which can be displayed in %VISU module.
*/
interface Prs3d : PrsObject, SALOME::GenericObj {
- //interface Prs3d : PrsObject{
+ /*!
+ * Applies a set basic input parameters to the 3D presentation
+ * \return True of the set of input parameters is correct and was succesfully applied,
+ * False otherwise
+ */
+ boolean Apply();
+
+ void SetResultObject(in Result theResult);
+ Result GetResultObject();
+
+ void SetMeshName(in string theMeshName);
+ string GetMeshName();
+
+ /*!
+ * Move the 3D presentation according to the given offset parameters
+ */
void SetOffset(in float theDx, in float theDy, in float theDz);
+
+
+ /*!
+ * Gets offset parameters for the 3D presentation
+ */
void GetOffset(out float theDx, out float theDy, out float theDz);
};
* bar is displayed along with each colored field presentation and serves for
* consulting the correspondance between colors and data values.
*/
- interface ColoredPrs3d : Prs3d {
+ interface ColoredPrs3d : Prs3d
+ {
+ void SetEntity(in Entity theEntity);
+ Entity GetEntity();
+
+ void SetFieldName(in string theName);
+ string GetFieldName();
+
+ void SetTimeStampNumber(in long theTimeStampNumber);
+ long GetTimeStampNumber();
+
/*! Sets the method of coloring of the elements composing a 3D presentation.
*/
void SetScalarMode(in long theScalarMode);
in string theSubMeshName,
in string theNewName);
+ /*!
+ * Creates a VISU 3D presentation according to the given type
+ * \param theType Type that defines what kind of 3D presentation should be created
+ */
+ Prs3d CreatePrs3d(in VISUType theType, in SALOMEDS::Study theStudy);
+
/*!
* Creates a mesh on the basis of the data generated in other sources (MED object or file).
* \param theResult Data generated in other sources. (MED object or file)
return myVisuGen->MeshOnEntity(theResult,theMeshName,theEntity);
}
+ Prs3d_ptr VISU_Gen_i::CreatePrs3d(VISUType theType,
+ SALOMEDS::Study_ptr theStudy)
+ {
+ return myVisuGen->CreatePrs3d(theType,theStudy);
+ }
+
Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult,
const char* theMeshName,
VISU::Entity theEntity,
#include "SALOME_Component_i.hxx"
-namespace VISU{
+namespace VISU
+{
class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
public virtual ::Engines_Component_i
{
virtual Result_ptr ImportMed(SALOMEDS::SObject_ptr theMedSObject);
virtual Result_ptr ImportMedField(SALOME_MED::FIELD_ptr theField);
+ Prs3d_ptr
+ CreatePrs3d(VISUType theType,
+ SALOMEDS::Study_ptr theStudy);
+
//Create Presentation Of Submeshes
virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity);
virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName,
case VISU::TPLOT3D:
{
VISU::Plot3D_i* aPlot3DPrs = dynamic_cast<VISU::Plot3D_i*>(aPrsObject);
- VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult());
+ VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult(),true);
aSamePlot3D->SameAs(aPlot3DPrs);
}
break;
int i, axId = ButtonGroupIJKAxis->id (ButtonGroupIJKAxis->selected());
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axId;
gp_Dir dir;
+ CORBA::String_var aMeshName = myPrs3d->GetMeshName();
const vector<vtkFloatingPointType> * values =
- result->GetAxisInfo(myPrs3d->GetMeshName(), axis, dir);
+ result->GetAxisInfo(aMeshName.in(), axis, dir);
if (!values)
return;
VISU::Result_i* result = myPrs3d->GetResult();
for (i = 0; i < 3; ++i) {
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) i;
- curValues = result->GetAxisInfo(myPrs3d->GetMeshName(), axis, dir);
+ CORBA::String_var aMeshName = myPrs3d->GetMeshName();
+ curValues = result->GetAxisInfo(aMeshName.in(), axis, dir);
if (curValues) {
double dot = normal * dir;
if (Abs(dot) > Abs(maxDot)) {
VISU::Result_i* result = myPrs3d ? myPrs3d->GetResult() : 0;
if (result) {
gp_Dir dir;
- return result->GetAxisInfo(myPrs3d->GetMeshName(),
+ CORBA::String_var aMeshName = myPrs3d->GetMeshName();
+ return result->GetAxisInfo(aMeshName.in(),
VISU::Result_i::AXIS_X,
dir);
}
if (result) {
VISU::Result_i::TAxis axis = (VISU::Result_i::TAxis) axisId;
gp_Dir dir;
- const vector<vtkFloatingPointType> * indices = result->GetAxisInfo(myPrs3d->GetMeshName(),
+ CORBA::String_var aMeshName = myPrs3d->GetMeshName();
+ const vector<vtkFloatingPointType> * indices = result->GetAxisInfo(aMeshName.in(),
axis, dir);
if (indices)
maxIndex = indices->size() - 1;
storeToPrsObject(myCutLines);
myCutLines->GetPL()->Update();
- vtkAppendPolyData* aPolyData = myCutLines->GetCutLinesPL()->GetAppendPolyData();
+ vtkAppendPolyData* aPolyData = myCutLines->GetSpecificPL()->GetAppendPolyData();
vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
aPlaneMapper->SetInput(aPolyData->GetOutput());
aPlaneMapper->ScalarVisibilityOff();
void VisuGUI_CutLinesDlg::updateGlyphs(bool update){
if (myPreviewActorGlyphs == 0 ) return;
- const vtkFloatingPointType *aDirLn = myCutLines->GetCutLinesPL()->GetRealDirLn();
- const vtkFloatingPointType *aBasePnt = myCutLines->GetCutLinesPL()->GetBasePnt();
+ const vtkFloatingPointType *aDirLn = myCutLines->GetSpecificPL()->GetRealDirLn();
+ const vtkFloatingPointType *aBasePnt = myCutLines->GetSpecificPL()->GetBasePnt();
vtkFloatingPointType aSecondPnt[3];
vtkFloatingPointType aBoundCenter[3];
- vtkAppendPolyData* aPolyData = myCutLines->GetCutLinesPL()->GetAppendPolyData();
+ vtkAppendPolyData* aPolyData = myCutLines->GetSpecificPL()->GetAppendPolyData();
vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
aPlaneMapper->SetInput(aPolyData->GetOutput());
vtkFloatingPointType bounds[6];
if (myCutPlanes == NULL) return;
if (myPreviewActor != 0) return;
- vtkAppendPolyData* aPolyData = myCutPlanes->GetCutPlanesPL()->GetAppendPolyData();
+ vtkAppendPolyData* aPolyData = myCutPlanes->GetSpecificPL()->GetAppendPolyData();
if (!aPolyData->GetOutput()->GetNumberOfCells()) {
onPreviewCheck(false);
return;
if (myPrs && !RelativeChkB->isChecked()) {
vtkFloatingPointType minPos, maxPos;
storePrsParams();
- myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos);
+ myPrs->GetSpecificPL()->GetMinMaxPosition(minPos, maxPos);
restorePrsParams();
if (minPos > PositionSpn->value())
minPos = PositionSpn->value();
vtkFloatingPointType minPos = 0., maxPos = 1., pos = PositionSpn->value();
if (myPrs) {
storePrsParams();
- myPrs->GetPlot3DPL()->GetMinMaxPosition(minPos, maxPos);
+ myPrs->GetSpecificPL()->GetMinMaxPosition(minPos, maxPos);
restorePrsParams();
if (-1e-7 < (maxPos - minPos) && (maxPos - minPos) < 1e-7) {
pos = 0;
// set plane parameters corresponding to control values
storePrsParams();
vtkFloatingPointType normal[3], origin[3];
- myPrs->GetPlot3DPL()->GetBasePlane(origin, normal, true);
+ myPrs->GetSpecificPL()->GetBasePlane(origin, normal, true);
planePreview->Set(origin, normal);
restorePrsParams();
}
{
if(!myPreviewActor) return true;
- SVTK_ViewWindow* aView;
vtkRenderer* aRend = myPreviewActor->GetRenderer();
vtkRenderWindow* aWnd = aRend->GetRenderWindow();
if(aRend && aWnd){
myTimeStampsCombo->setDisabled(isAnim);
QString aFieldName(myPrs->GetScalarFieldName().c_str());
- float aIterFloat = GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+ CORBA::String_var aMeshName = myPrs->GetMeshName();
+ float aIterFloat = GetFloatValueOfTimeStamp(aMeshName.in(),
myPrs->GetScalarFieldName().c_str(),
myPrs->GetScalarIteration(),
myPrs->GetScalarEntity());
VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
if (isExist) {
if ((aType == VISU::TTIMESTAMP)) {
- _PTR(GenericAttribute) aNameAttr;
- if (aChildSObj->FindAttribute(aNameAttr, "AttributeName")) {
- _PTR(AttributeName) aName (aNameAttr);
+ _PTR(GenericAttribute) anAttr;
+ if (aChildSObj->FindAttribute(anAttr, "AttributeName")) {
+ _PTR(AttributeName) aNameAttr(anAttr);
VISU::Prs3d_var aPrsObj = VISU::Prs3d::_narrow(aChildObject);
- QString aMeshName = VISU::getValue(aChildSObj, "myMeshName");
- if (QString(myPrs->GetMeshName().c_str()) != aMeshName) continue;
+ QString aName = VISU::getValue(aChildSObj, "myMeshName");
+ CORBA::String_var aMeshName = aPrsObj->GetMeshName();
+ if (QString(aMeshName.in()) != aName) continue;
myCurrMeshName = aMeshName;
QString aFieldName = VISU::getValue(aChildSObj, "myFieldName");
QString aTimeIter = VISU::getValue(aChildSObj, "myTimeStampId");
case 2: anEntity = VISU::FACE_ENTITY; break;
case 3: anEntity = VISU::CELL_ENTITY; break;
}
- TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.latin1()];
+ TFT &aFieldsMap = myMeshFieldsTimes[aMeshName.in()];
TFE aKey (aFieldName.latin1(), anEntity);
aFieldsMap[aKey][aTimeIter.toInt()] =
- GetFloatValueOfTimeStamp(myPrs->GetMeshName().c_str(),
+ GetFloatValueOfTimeStamp(aMeshName.in(),
aFieldName.latin1(),
aTimeIter.toInt(),
anEntity);
myPrs = thePrs;
static int aNbOfSteps = 30;
- VISU_StreamLinesPL* aStreamLinesPL = thePrs->GetStreamLinesPL();
+ VISU_StreamLinesPL* aStreamLinesPL = thePrs->GetSpecificPL();
float aMin, aMax;
aMin = aStreamLinesPL->GetMinPropagationTime();
aMax = aStreamLinesPL->GetMaxPropagationTime();
#include <vtkMapper.h>
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
//#define _DEXCEPT_
VISU::ColoredPrs3d_i::
ColoredPrs3d_i(Result_i* theResult,
bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
myScalarMapPL(NULL),
myIsFixedRange(false)
{}
+
+//---------------------------------------------------------------
VISU::ColoredPrs3d_i::
ColoredPrs3d_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
myScalarMapPL(NULL),
myIsFixedRange(false)
{}
+
+//---------------------------------------------------------------
VISU::ColoredPrs3d_i
::~ColoredPrs3d_i()
{}
ProcessVoidEvent(new TRemoveFromStudy(this));
}
+//---------------------------------------------------------------
+bool
+VISU::ColoredPrs3d_i
+::SetInput()
+{
+ if(TSuperClass::SetInput()){
+ if(CheckIsPossible()){
+ if(ApplyInput()){
+ if(Create(GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber()))
+ return true;
+ }else
+ return true;
+ }
+ }
+ return false;
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::ColoredPrs3d_i
+::ApplyInput()
+{
+ bool anIsNotCreated = GetPL() == NULL;
+ if(anIsNotCreated)
+ CreatePipeLine(); // to create proper pipeline
+
+ DoSetInput();
+
+ return anIsNotCreated;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetEntity(VISU::Entity theEntity)
+{
+ myEntity = theEntity;
+}
+
+
+//---------------------------------------------------------------
+VISU::Entity
+VISU::ColoredPrs3d_i
+::GetEntity()
+{
+ return myEntity;
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetFieldName(const char* theFieldName)
+{
+ myFieldName = theFieldName;
+}
+
+char*
+VISU::ColoredPrs3d_i
+::GetFieldName()
+{
+ return CORBA::string_dup(myFieldName.c_str());
+}
+
+void
+VISU::ColoredPrs3d_i
+::SetTimeStampNumber(CORBA::Long theTimeStampNumber)
+{
+ myTimeStampNumber = theTimeStampNumber;
+}
+
+CORBA::Long
+VISU::ColoredPrs3d_i
+::GetTimeStampNumber()
+{
+ return myTimeStampNumber;
+}
+
+
//---------------------------------------------------------------
void
VISU::ColoredPrs3d_i
::SameAs(const Prs3d_i* theOrigin)
{
if(const ColoredPrs3d_i* aPrs3d = dynamic_cast<const ColoredPrs3d_i*>(theOrigin)){
- DoHook();
-
ColoredPrs3d_i* anOrigin = const_cast<ColoredPrs3d_i*>(aPrs3d);
- myField = anOrigin->GetField();
- myMeshName = myField->myMeshName;
- myEntity = VISU::TEntity(anOrigin->GetEntity());//myField->myEntity;
- myIteration = anOrigin->GetIteration();
- myFieldName = anOrigin->GetFieldName();
-
- Build(-1);
+ SetMeshName(anOrigin->GetMeshName());
+ SetEntity(anOrigin->GetEntity());
+ SetFieldName(anOrigin->GetFieldName());
+ SetTimeStampNumber(anOrigin->GetTimeStampNumber());
+ ApplyInput();
+
+ Build(ESameAs);
TSuperClass::SameAs(theOrigin);
VISU::ColoredPrs3d_i
::SameAsParams(const ColoredPrs3d_i* theOrigin)
{
- int anIteration = GetIteration();
+ int aTimeStampNumber = GetTimeStampNumber();
SameAs(theOrigin);
- myIteration = anIteration;
+ SetTimeStampNumber(aTimeStampNumber);
+ ApplyInput();
- Build(-1);
+ Build(ESameAs);
Update();
}
::Create(const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- int theIteration)
+ int theTimeStampNumber)
{
- DoHook(); // to create proper pipeline
-
- myMeshName = theMeshName;
- myEntity = (VISU::TEntity)theEntity;
- myFieldName =theFieldName;
- myIteration = theIteration;
+ SetMeshName(theMeshName);
+ SetEntity(theEntity);
+ SetFieldName(theFieldName);
+ SetTimeStampNumber(theTimeStampNumber);
+ ApplyInput();
- Build(false); // to get corresponding input from result and initilize the pipeline
+ Build(ECreateNew); // to get corresponding input from result and initilize the pipeline
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
VISU::ColoredPrs3d_i
::Restore(const Storable::TRestoringMap& theMap)
{
- DoHook();
-
- myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
- myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
- myFieldName = VISU::Storable::FindValue(theMap,"myFieldName").latin1();
- myIteration = VISU::Storable::FindValue(theMap,"myIteration").toInt();
+ SetMeshName(VISU::Storable::FindValue(theMap,"myMeshName").latin1());
+ SetEntity((VISU::Entity)VISU::Storable::FindValue(theMap,"myEntity").toInt());
+ SetFieldName(VISU::Storable::FindValue(theMap,"myFieldName").latin1());
+ SetTimeStampNumber(VISU::Storable::FindValue(theMap,"myIteration").toInt());
+ ApplyInput();
myAddToStudy = false; //SRN Added 21/06/2003 SAL2983: to avoid addition of the new ScalarMap to study.
- Build(true);
+ Build(ERestore);
TSuperClass::Restore(theMap);
Storable::DataToStream( theStr, "myMeshName", myMeshName.c_str() );
Storable::DataToStream( theStr, "myEntity", myEntity );
Storable::DataToStream( theStr, "myFieldName", myFieldName.c_str() );
- Storable::DataToStream( theStr, "myIteration", myIteration );
+ Storable::DataToStream( theStr, "myIteration", int(myTimeStampNumber) );
Storable::DataToStream( theStr, "myTitle", myTitle.c_str() );
Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels );
//----------------------------------------------------------------------------
void
VISU::ColoredPrs3d_i
-::DoHook()
+::CreatePipeLine()
{
- if(MYDEBUG) MESSAGE("ColoredPrs3d_i::DoHook() - "<<myPipeLine);
+ if(MYDEBUG) MESSAGE("ColoredPrs3d_i::CreatePipeLine() - "<<myPipeLine);
if(!myPipeLine){
myPipeLine = VISU_ScalarMapPL::New();
myPipeLine->GetMapper()->SetScalarVisibility(1);
//----------------------------------------------------------------------------
VISU::Storable*
VISU::ColoredPrs3d_i
-::Build(int theRestoring)
+::Build(EBuildMode theBuildMode)
{
if(MYDEBUG)
- MESSAGE("ColoredPrs3d_i::Build - "<<myFieldName<<"; theRestoring = "<<theRestoring);
- SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+ MESSAGE("ColoredPrs3d_i::Build - "<<myFieldName<<"; theBuildMode = "<<theBuildMode);
+ SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
if(myAddToStudy)
aStudyBuilder->NewCommand(); // There is a transaction
#ifndef _DEXCEPT_
try{
#endif
- DoSetInput(myResult);
QString aComment;
myName = "NoName";
- if(theRestoring <= 0){
- if(theRestoring == 0) myScalarMapPL->Init();
- if(!myIsFixedRange) myScalarMapPL->SetSourceRange();
+ if(theBuildMode == ECreateNew || theBuildMode == ESameAs){
+ if(!myIsFixedRange)
+ myScalarMapPL->SetSourceRange();
const VISU::TValField& aValField = myField->myValField;
- const VISU::PValForTime aValForTime = aValField.find(myIteration)->second;
+ const VISU::PValForTime aValForTime = aValField.find(myTimeStampNumber)->second;
aComment.sprintf("%s %s",myFieldName.c_str(),VISU_Convertor::GenerateName(aValForTime->myTime).c_str());
- if (theRestoring == 0) myTitle = aComment.simplifyWhiteSpace().latin1();
+ if(theBuildMode == ECreateNew)
+ myTitle = aComment.simplifyWhiteSpace().latin1();
}
if(myAddToStudy){
myName = GenerateName().latin1();
aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
- VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
- string aResultEntry = myResult->GetEntry();
- string aRefFatherEntry = myResult->GetRefFatherEntry();
- string anEntry = myResult->GetEntry(aComment.latin1());
- if(anEntry == "") throw std::runtime_error("There is no Entry for binding the presentation !!!");
+ VISU::TTIMESTAMP,myMeshName.c_str(),myEntity,myFieldName.c_str(),myTimeStampNumber,myField->myNbComp);
+ std::string aResultEntry = myResult->GetEntry();
+ std::string aRefFatherEntry = myResult->GetRefFatherEntry();
+ std::string anEntry = myResult->GetEntry(aComment.latin1());
+ if(anEntry == "")
+ throw std::runtime_error("There is no Entry for binding the presentation !!!");
aComment.sprintf("myComment=%s;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
- GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myIteration,myField->myNbComp);
+ GetComment(),myMeshName.c_str(),myEntity,myFieldName.c_str(),myTimeStampNumber,myField->myNbComp);
CORBA::String_var anIOR = GetID();
- CreateAttributes(myStudy,anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
- mySObject = myStudy->FindObjectIOR(anIOR);
+ CreateAttributes(GetStudyDocument(),anEntry.c_str(),aRefFatherEntry.c_str(),anIOR,myName.c_str(),"",aComment.latin1(),true);
+ mySObject = GetStudyDocument()->FindObjectIOR(anIOR);
}
#ifndef _DEXCEPT_
}catch(std::exception& exc){
return myField;
}
-const std::string&
-VISU::ColoredPrs3d_i
-::GetMeshName() const
-{
- return myMeshName;
-}
-
-VISU::Entity
-VISU::ColoredPrs3d_i
-::GetEntity() const
-{
- return VISU::Entity(myEntity);
-}
-
-const std::string&
-VISU::ColoredPrs3d_i
-::GetFieldName() const
-{
- return myFieldName;
-}
-
-int
+VISU::TEntity
VISU::ColoredPrs3d_i
-::GetIteration() const
+::GetTEntity() const
{
- return myIteration;
+ return VISU::TEntity(int(myEntity));
}
VISU_ScalarMapPL*
void
RemoveFromStudy();
+ //----------------------------------------------------------------------------
+ virtual
+ void
+ SetEntity(Entity theEntity);
+
+ virtual
+ Entity
+ GetEntity();
+
+ virtual
+ void
+ SetFieldName(const char* theFieldName);
+
+ virtual
+ char*
+ GetFieldName();
+
+ virtual
+ void
+ SetTimeStampNumber(CORBA::Long theTimeStampNumber);
+
+ virtual
+ CORBA::Long
+ GetTimeStampNumber();
+
//----------------------------------------------------------------------------
virtual
CORBA::Long
vtkFloatingPointType myPosition[2], myWidth, myHeight;
public:
- //----------------------------------------------------------------------------
+ /*!
+ Initlizes the in first time presentation
+ */
virtual
Storable*
Create(const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- int theIteration);
+ int theTimeStampNumber);
+ /*!
+ Retores state of the presentation
+ */
virtual
Storable*
Restore(const Storable::TRestoringMap& theMap);
+ /*!
+ Writes persistent params of the presentation into the given stream
+ */
virtual
void
ToStream(std::ostringstream& theStr);
+ /*!
+ Update state of the presentation according to the input.
+ */
virtual
void
SameAs(const Prs3d_i* theOrigin);
/*!
- * \brief Works like SameAs() method, but keep myIteration value unchanged.
+ * \brief Works like SameAs() method, but keep myTimeStampNumber value unchanged.
*
* Is used in VISU_TimeAnimation class implementation.
*/
void
SameAsParams(const ColoredPrs3d_i* theOrigin);
+ TEntity
+ GetTEntity() const;
+
virtual const VISU::PField&
GetField() const;
- const std::string&
- GetMeshName() const;
-
- VISU::Entity
- GetEntity() const;
-
- const std::string&
- GetFieldName() const;
-
- int
- GetIteration() const;
-
VISU_ScalarMapPL*
GetScalarMapPL();
vtkFloatingPointType theG,
vtkFloatingPointType theB);
+ VISU_ScalarMapPL*
+ GetSpecificPL() const
+ {
+ return myScalarMapPL;
+ }
+
//----------------------------------------------------------------------------
protected:
- PField myField;
- TEntity myEntity;
+ /*!
+ Applyes basic input parameters to the presentation.
+ Returns true if all are right.
+ */
+ virtual
+ bool
+ SetInput();
+
+ /*!
+ Checks whether it is possible to create presentation
+ with the given basic parameters or not.
+ */
+ virtual
+ bool
+ CheckIsPossible() = 0;
+
+ /*!
+ Creates proper instance of VTK pipeline.
+ */
+ virtual
+ void
+ CreatePipeLine();
+
+ /*!
+ First checks whether corresponding VTK pipeline exists and create it if not.
+ Then calls VISU_ColoredPrs3d_i::DoSetInput.
+ Returns true if during the call corresponding VTK pipeline was created,
+ false otherwise.
+ */
+ virtual
+ bool
+ ApplyInput();
+
+ /*!
+ Sets input data set according to basic input parameters -
+ Result, MeshName, Entity, FieldName and TimeStampNumber.
+ */
+ virtual
+ void
+ DoSetInput() = 0;
+
+ /*!
+ The enumeration allow to define what mode should be used for the presentation building.
+ */
+ enum EBuildMode {ECreateNew, ESameAs, ERestore};
+
+ /*!
+ The enumeration allow to define what mode should be used for the presentation building.
+ */
+ Storable*
+ Build(EBuildMode theBuildMode);
+
+ protected:
+ // Decalare basic input parameters
+ Entity myEntity;
std::string myFieldName;
- int myIteration;
+ CORBA::Long myTimeStampNumber;
+ PField myField;
+
//Font management
bool myIsBoldTitle;
bool myIsItalicTitle;
VISU_ScalarMapPL* myScalarMapPL;
bool myIsFixedRange;
-
- virtual
- void
- DoSetInput(Result_i* theResult) = 0;
-
- Storable*
- Build(int theRestoring);
-
- virtual
- void
- DoHook();
};
}
#include <vtkAppendPolyData.h>
-using namespace VISU;
-using namespace std;
-
static vtkFloatingPointType EPS_machine = 1.0E-7;
#ifdef _DEBUG_
static int MYDEBUG = 0;
#endif
-int VISU::CutLines_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int
+VISU::CutLines_i
+::IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck)
{
- return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+ return TSuperClass::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ isMemoryCheck);
}
+//---------------------------------------------------------------
int VISU::CutLines_i::myNbPresent = 0;
-QString VISU::CutLines_i::GenerateName() { return VISU::GenerateName("CutLines",myNbPresent++);}
+//---------------------------------------------------------------
+QString
+VISU::CutLines_i::GenerateName()
+{
+ return VISU::GenerateName("CutLines",myNbPresent++);
+}
+
+//---------------------------------------------------------------
const string VISU::CutLines_i::myComment = "CUTLINES";
-const char* VISU::CutLines_i::GetComment() const { return myComment.c_str();}
+
+//---------------------------------------------------------------
+const char*
+VISU::CutLines_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
+//---------------------------------------------------------------
VISU::CutLines_i::
CutLines_i(Result_i* theResult,
bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
{}
+//---------------------------------------------------------------
VISU::CutLines_i::
CutLines_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myCutLinesPL(NULL)
-{
-}
+{}
/*! Copy map to /a myMapCurvesInverted.
* \param theCurves - map
*/
-void VISU::CutLines_i::CopyCurvesInverted(const TCurvesInv& theCurves){
+void
+VISU::CutLines_i
+::CopyCurvesInverted(const TCurvesInv& theCurves)
+{
myMapCurvesInverted = theCurves;
}
-VISU::Storable* VISU::CutLines_i::Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration)
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::CutLines_i
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber)
{
- return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
-VISU::Storable* VISU::CutLines_i::Restore(const Storable::TRestoringMap& theMap)
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::CutLines_i
+::Restore(const Storable::TRestoringMap& theMap)
{
TSuperClass::Restore(theMap);
}
-void VISU::CutLines_i::ToStream(std::ostringstream& theStr){
- ScalarMap_i::ToStream(theStr);
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
int aNbLines = GetNbLines();
Storable::DataToStream( theStr, "myMapCurvesInverted", aStrCurvesInverted.latin1());
}
-VISU::CutLines_i::~CutLines_i(){
+
+//---------------------------------------------------------------
+VISU::CutLines_i
+::~CutLines_i()
+{
if(MYDEBUG) MESSAGE("CutLines_i::~CutLines_i()");
}
-void VISU::CutLines_i::SetOrientation(VISU::CutPlanes::Orientation theOrient,
- CORBA::Double theXAngle, CORBA::Double theYAngle)
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetOrientation(VISU::CutPlanes::Orientation theOrient,
+ CORBA::Double theXAngle,
+ CORBA::Double theYAngle)
{
myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
- theXAngle,theYAngle);
+ theXAngle,
+ theYAngle);
}
-void VISU::CutLines_i::SetOrientation2(VISU::CutPlanes::Orientation theOrient,
- CORBA::Double theXAngle, CORBA::Double theYAngle)
+
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetOrientation2(VISU::CutPlanes::Orientation theOrient,
+ CORBA::Double theXAngle,
+ CORBA::Double theYAngle)
{
myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
- theXAngle,theYAngle,1);
+ theXAngle,
+ theYAngle,
+ 1);
}
-VISU::CutPlanes::Orientation VISU::CutLines_i::GetOrientationType() {
+//---------------------------------------------------------------
+VISU::CutPlanes::Orientation
+VISU::CutLines_i
+::GetOrientationType()
+{
return VISU::CutPlanes::Orientation(myCutLinesPL->GetPlaneOrientation());
}
-VISU::CutPlanes::Orientation VISU::CutLines_i::GetOrientationType2() {
+
+//---------------------------------------------------------------
+VISU::CutPlanes::Orientation
+VISU::CutLines_i
+::GetOrientationType2()
+{
return VISU::CutPlanes::Orientation(myCutLinesPL->GetPlaneOrientation(1));
}
-CORBA::Double VISU::CutLines_i::GetRotateX(){
+//---------------------------------------------------------------
+CORBA::Double
+VISU::CutLines_i
+::GetRotateX()
+{
return myCutLinesPL->GetRotateX();
}
-CORBA::Double VISU::CutLines_i::GetRotateY(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::CutLines_i
+::GetRotateY()
+{
return myCutLinesPL->GetRotateY();
}
-CORBA::Double VISU::CutLines_i::GetRotateX2(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::CutLines_i
+::GetRotateX2()
+{
return myCutLinesPL->GetRotateX(1);
}
-CORBA::Double VISU::CutLines_i::GetRotateY2(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::CutLines_i
+::GetRotateY2()
+{
return myCutLinesPL->GetRotateY(1);
}
-void VISU::CutLines_i::SetDisplacement(CORBA::Double theDisp) {
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetDisplacement(CORBA::Double theDisp)
+{
myCutLinesPL->SetDisplacement(theDisp);
}
-void VISU::CutLines_i::SetDisplacement2(CORBA::Double theDisp) {
+
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetDisplacement2(CORBA::Double theDisp)
+{
myCutLinesPL->SetDisplacement(theDisp,1);
}
-CORBA::Double VISU::CutLines_i::GetDisplacement() {
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::CutLines_i
+::GetDisplacement()
+{
return myCutLinesPL->GetDisplacement();
}
-CORBA::Double VISU::CutLines_i::GetDisplacement2() {
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::CutLines_i
+::GetDisplacement2()
+{
return myCutLinesPL->GetDisplacement(1);
}
-void VISU::CutLines_i::SetBasePlanePosition(CORBA::Double thePlanePosition){
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetBasePlanePosition(CORBA::Double thePlanePosition)
+{
myCutLinesPL->SetPosition(thePlanePosition);
}
-CORBA::Double VISU::CutLines_i::GetBasePlanePosition(){
+//---------------------------------------------------------------
+CORBA::Double
+VISU::CutLines_i
+::GetBasePlanePosition()
+{
return myCutLinesPL->GetPosition();
}
-void VISU::CutLines_i::SetLinePosition(CORBA::Long thePlaneNumber, CORBA::Double thePlanePosition){
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetLinePosition(CORBA::Long thePlaneNumber,
+ CORBA::Double thePlanePosition)
+{
myCutLinesPL->SetPartPosition(thePlaneNumber,thePlanePosition);
}
-CORBA::Double VISU::CutLines_i::GetLinePosition(CORBA::Long thePlaneNumber){
+//---------------------------------------------------------------
+CORBA::Double
+VISU::CutLines_i
+::GetLinePosition(CORBA::Long thePlaneNumber)
+{
return myCutLinesPL->GetPartPosition(thePlaneNumber,1);
}
-void VISU::CutLines_i::SetDefault(){
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetDefault()
+{
myCutLinesPL->SetDefault();
}
-CORBA::Boolean VISU::CutLines_i::IsDefault(){
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::CutLines_i
+::IsDefault()
+{
return myCutLinesPL->IsDefault();
}
-void VISU::CutLines_i::SetDefaultPosition(CORBA::Long thePlaneNumber){
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetDefaultPosition(CORBA::Long thePlaneNumber)
+{
myCutLinesPL->SetPartDefault(thePlaneNumber);
}
-CORBA::Boolean VISU::CutLines_i::IsDefaultPosition(CORBA::Long thePlaneNumber){
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::CutLines_i
+::IsDefaultPosition(CORBA::Long thePlaneNumber)
+{
return myCutLinesPL->IsPartDefault(thePlaneNumber);
}
* see void VISU::CutLines_i::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert)
* \param theInvert - Invert all curves, if value is TRUE, else not.
*/
-void VISU::CutLines_i::SetAllCurvesInverted(CORBA::Boolean theInvert){
+void
+VISU::CutLines_i
+::SetAllCurvesInverted(CORBA::Boolean theInvert)
+{
for (int i=0; i<GetNbLines(); i++) SetCurveInverted(i,theInvert);
}
/*! Checks the orientation of all curves
* \retval TRUE - if all curves are inverted, else FALSE
*/
-CORBA::Boolean VISU::CutLines_i::IsAllCurvesInverted(){
+CORBA::Boolean
+VISU::CutLines_i
+::IsAllCurvesInverted()
+{
for (int i=0; i<GetNbLines(); i++)
if (!IsCurveInverted(i)) return false;
return true;
* \param theCurveNumber - integer value, number of cut line.
* \param theInvert - boolean value, TRUE or false.
*/
-void VISU::CutLines_i::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert){
+void
+VISU::CutLines_i
+::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert)
+{
myMapCurvesInverted[theCurveNumber] = theInvert;
}
* \param theCurveNumber - integer value, number of cut line.
* \retval TRUE - if line in the table is inverted, else FALSE.
*/
-CORBA::Boolean VISU::CutLines_i::IsCurveInverted(CORBA::Long theCurveNumber){
+CORBA::Boolean
+VISU::CutLines_i
+::IsCurveInverted(CORBA::Long theCurveNumber)
+{
return myMapCurvesInverted[theCurveNumber];
}
-void VISU::CutLines_i::SetNbLines(CORBA::Long theNb) {
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::SetNbLines(CORBA::Long theNb)
+{
myCutLinesPL->SetNbParts(theNb);
}
-CORBA::Long VISU::CutLines_i::GetNbLines() {
+
+//---------------------------------------------------------------
+CORBA::Long
+VISU::CutLines_i
+::GetNbLines()
+{
return myCutLinesPL->GetNbParts();
}
-void VISU::CutLines_i::DoHook(){
- if(!myPipeLine) myPipeLine = VISU_CutLinesPL::New();
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::CreatePipeLine()
+{
+ if(!myPipeLine)
+ myPipeLine = VISU_CutLinesPL::New();
myCutLinesPL = dynamic_cast<VISU_CutLinesPL*>(myPipeLine);
- ScalarMap_i::DoHook();
+ TSuperClass::CreatePipeLine();
}
+
+//----------------------------------------------------------------------------
+bool
+VISU::CutLines_i
+::CheckIsPossible()
+{
+ return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+}
+
+
+//---------------------------------------------------------------
VISU_Actor*
VISU::CutLines_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU" , "cut_lines_represent", 2);
return NULL;
}
-void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
+//---------------------------------------------------------------
+void
+VISU::CutLines_i
+::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject)
+{
try{
if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal");
Update();
SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
anAttr = aStudyBuilder->FindOrCreateAttribute(theSObject, "AttributeTableOfReal");
SALOMEDS::AttributeTableOfReal_var aTableOfReal = SALOMEDS::AttributeTableOfReal::_narrow(anAttr);
class VISU_CutLinesPL;
-namespace VISU{
+namespace VISU
+{
class CutLines_i : public virtual POA_VISU::CutLines,
public virtual ScalarMap_i
{
explicit
CutLines_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual ~CutLines_i();
+ virtual
+ ~CutLines_i();
+
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TCUTLINES;
+ }
+
+ virtual
+ void
+ SetOrientation(VISU::CutPlanes::Orientation theOrient,
+ CORBA::Double theXAngle,
+ CORBA::Double theYAngle);
+
+ virtual
+ void
+ SetOrientation2(VISU::CutPlanes::Orientation theOrient,
+ CORBA::Double theXAngle,
+ CORBA::Double theYAngle);
+
+ virtual
+ VISU::CutPlanes::Orientation
+ GetOrientationType();
+
+ virtual
+ VISU::CutPlanes::Orientation
+ GetOrientationType2();
- virtual VISU::VISUType GetType() { return VISU::TCUTLINES;};
+ virtual
+ CORBA::Double
+ GetRotateX();
- virtual void SetOrientation(VISU::CutPlanes::Orientation theOrient,
- CORBA::Double theXAngle, CORBA::Double theYAngle);
- virtual void SetOrientation2(VISU::CutPlanes::Orientation theOrient,
- CORBA::Double theXAngle, CORBA::Double theYAngle);
+ virtual
+ CORBA::Double
+ GetRotateY();
- virtual VISU::CutPlanes::Orientation GetOrientationType();
- virtual VISU::CutPlanes::Orientation GetOrientationType2();
+ virtual
+ CORBA::Double
+ GetRotateX2();
- virtual CORBA::Double GetRotateX();
- virtual CORBA::Double GetRotateY();
+ virtual
+ CORBA::Double
+ GetRotateY2();
- virtual CORBA::Double GetRotateX2();
- virtual CORBA::Double GetRotateY2();
+ virtual
+ void
+ SetDisplacement(CORBA::Double theDisp);
- virtual void SetDisplacement(CORBA::Double theDisp);
- virtual CORBA::Double GetDisplacement();
+ virtual
+ CORBA::Double
+ GetDisplacement();
- virtual void SetDisplacement2(CORBA::Double theDisp);
- virtual CORBA::Double GetDisplacement2();
+ virtual
+ void
+ SetDisplacement2(CORBA::Double theDisp);
- virtual void SetBasePlanePosition(CORBA::Double thePlanePosition);
- virtual CORBA::Double GetBasePlanePosition();
+ virtual
+ CORBA::Double
+ GetDisplacement2();
- virtual void SetLinePosition(CORBA::Long thePlaneNumber, CORBA::Double thePlanePosition);
- virtual CORBA::Double GetLinePosition(CORBA::Long thePlaneNumber);
+ virtual
+ void
+ SetBasePlanePosition(CORBA::Double thePlanePosition);
- virtual void SetDefault();
- virtual CORBA::Boolean IsDefault();
+ virtual
+ CORBA::Double
+ GetBasePlanePosition();
- virtual void SetDefaultPosition(CORBA::Long thePlaneNumber);
- virtual CORBA::Boolean IsDefaultPosition(CORBA::Long thePlaneNumber);
+ virtual
+ void
+ SetLinePosition(CORBA::Long thePlaneNumber,
+ CORBA::Double thePlanePosition);
- virtual void SetAllCurvesInverted(CORBA::Boolean theInvert);
- virtual CORBA::Boolean IsAllCurvesInverted();
- virtual void SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert);
- virtual CORBA::Boolean IsCurveInverted(CORBA::Long theCurveNumber);
+ virtual
+ CORBA::Double
+ GetLinePosition(CORBA::Long thePlaneNumber);
+
+ virtual
+ void
+ SetDefault();
+
+ virtual
+ CORBA::Boolean
+ IsDefault();
+
+ virtual
+ void
+ SetDefaultPosition(CORBA::Long thePlaneNumber);
+
+ virtual
+ CORBA::Boolean
+ IsDefaultPosition(CORBA::Long thePlaneNumber);
+
+ virtual
+ void
+ SetAllCurvesInverted(CORBA::Boolean theInvert);
+
+ virtual
+ CORBA::Boolean
+ IsAllCurvesInverted();
+
+ virtual
+ void
+ SetCurveInverted(CORBA::Long theCurveNumber,
+ CORBA::Boolean theInvert);
+
+ virtual
+ CORBA::Boolean
+ IsCurveInverted(CORBA::Long theCurveNumber);
+
+ virtual
+ void
+ SetNbLines(CORBA::Long theNb);
+
+ virtual
+ CORBA::Long
+ GetNbLines();
- virtual void SetNbLines(CORBA::Long theNb);
- virtual CORBA::Long GetNbLines();
- typedef VISU::CutLines TInterface;
- VISU_CutLinesPL* GetCutLinesPL(){ return myCutLinesPL;}
-
typedef std::map<int,bool> TCurvesInv;
- TCurvesInv GetCurvesInverted() {return myMapCurvesInverted;}
- void CopyCurvesInverted(const TCurvesInv& theCurves);
+ TCurvesInv
+ GetCurvesInverted()
+ {
+ return myMapCurvesInverted;
+ }
+ void
+ CopyCurvesInverted(const TCurvesInv& theCurves);
+
+ typedef VISU::CutLines TInterface;
+
+ VISU_CutLinesPL*
+ GetSpecificPL() const
+ {
+ return myCutLinesPL;
+ }
+
protected:
- virtual void DoHook();
+ //! Extends VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine();
+
+ //! Extends VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
VISU_CutLinesPL *myCutLinesPL;
TCurvesInv myMapCurvesInverted;
public:
- static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck = true);
- virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration);
+ //! Extends VISU_ColoredPrs3d_i::IsPossible
+ static
+ int
+ IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck = true);
+
+ //! Extends VISU_ColoredPrs3d_i::Create
+ virtual
+ Storable*
+ Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber);
- virtual void ToStream(std::ostringstream& theStr);
+ //! Extends VISU_ColoredPrs3d_i::ToStream
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
- virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ //! Extends VISU_ColoredPrs3d_i::Restore
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
+ //! Extends VISU_ColoredPrs3d_i::CreateActor
virtual
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
void BuildTableOfReal(SALOMEDS::SObject_ptr theSObject);
static const std::string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
+
+ virtual
+ const char*
+ GetComment() const;
+
+ virtual
+ QString
+ GenerateName();
};
}
#include "SUIT_ResourceMgr.h"
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
-int VISU::CutPlanes_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//----------------------------------------------------------------------------
+int
+VISU::CutPlanes_i
+::IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck)
{
- return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+ return TSuperClass::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,isMemoryCheck);
}
+//----------------------------------------------------------------------------
int VISU::CutPlanes_i::myNbPresent = 0;
-QString VISU::CutPlanes_i::GenerateName() { return VISU::GenerateName("CutPlanes",myNbPresent++);}
+//----------------------------------------------------------------------------
+QString
+VISU::CutPlanes_i
+::GenerateName()
+{
+ return VISU::GenerateName("CutPlanes",myNbPresent++);
+}
+//----------------------------------------------------------------------------
const string VISU::CutPlanes_i::myComment = "CUTPLANES";
-const char* VISU::CutPlanes_i::GetComment() const { return myComment.c_str();}
+
+//----------------------------------------------------------------------------
+const char*
+VISU::CutPlanes_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
-VISU::CutPlanes_i::
-CutPlanes_i(Result_i* theResult,
- bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+//----------------------------------------------------------------------------
+VISU::CutPlanes_i
+::CutPlanes_i(Result_i* theResult,
+ bool theAddToStudy):
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
{}
-VISU::CutPlanes_i::
-CutPlanes_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+//----------------------------------------------------------------------------
+VISU::CutPlanes_i
+::CutPlanes_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject):
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myCutPlanesPL(NULL)
-{
-}
+{}
-VISU::Storable* VISU::CutPlanes_i::Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration)
+//----------------------------------------------------------------------------
+VISU::Storable*
+VISU::CutPlanes_i
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber)
{
- return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
-VISU::Storable* VISU::CutPlanes_i::Restore(const Storable::TRestoringMap& theMap)
+//----------------------------------------------------------------------------
+VISU::Storable*
+VISU::CutPlanes_i
+::Restore(const Storable::TRestoringMap& theMap)
{
TSuperClass::Restore(theMap);
}
+//----------------------------------------------------------------------------
void VISU::CutPlanes_i::ToStream(std::ostringstream& theStr){
ScalarMap_i::ToStream(theStr);
}
-VISU::CutPlanes_i::~CutPlanes_i(){
+//----------------------------------------------------------------------------
+VISU::CutPlanes_i
+::~CutPlanes_i()
+{
if(MYDEBUG) MESSAGE("CutPlanes_i::~CutPlanes_i()");
}
-void VISU::CutPlanes_i::SetOrientation(VISU::CutPlanes::Orientation theOrient,
- CORBA::Double theXAngle, CORBA::Double theYAngle)
+//----------------------------------------------------------------------------
+void
+VISU::CutPlanes_i
+::SetOrientation(VISU::CutPlanes::Orientation theOrient,
+ CORBA::Double theXAngle,
+ CORBA::Double theYAngle)
{
myCutPlanesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
- theXAngle,theYAngle);
+ theXAngle,
+ theYAngle);
}
-VISU::CutPlanes::Orientation VISU::CutPlanes_i::GetOrientationType() {
+//----------------------------------------------------------------------------
+VISU::CutPlanes::Orientation
+VISU::CutPlanes_i
+::GetOrientationType()
+{
return VISU::CutPlanes::Orientation(myCutPlanesPL->GetPlaneOrientation());
}
-CORBA::Double VISU::CutPlanes_i::GetRotateX(){
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::CutPlanes_i
+::GetRotateX()
+{
return myCutPlanesPL->GetRotateX();
}
-CORBA::Double VISU::CutPlanes_i::GetRotateY(){
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::CutPlanes_i
+::GetRotateY()
+{
return myCutPlanesPL->GetRotateY();
}
-void VISU::CutPlanes_i::SetDisplacement(CORBA::Double theDisp) {
+//----------------------------------------------------------------------------
+void
+VISU::CutPlanes_i
+::SetDisplacement(CORBA::Double theDisp)
+{
myCutPlanesPL->SetDisplacement(theDisp);
}
-CORBA::Double VISU::CutPlanes_i::GetDisplacement() {
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::CutPlanes_i
+::GetDisplacement()
+{
return myCutPlanesPL->GetDisplacement();
}
-void VISU::CutPlanes_i::SetPlanePosition(CORBA::Long thePlaneNumber, CORBA::Double thePlanePosition){
+//----------------------------------------------------------------------------
+void
+VISU::CutPlanes_i
+::SetPlanePosition(CORBA::Long thePlaneNumber,
+ CORBA::Double thePlanePosition)
+{
myCutPlanesPL->SetPartPosition(thePlaneNumber,thePlanePosition);
}
-CORBA::Double VISU::CutPlanes_i::GetPlanePosition(CORBA::Long thePlaneNumber){
+
+//----------------------------------------------------------------------------
+CORBA::Double
+VISU::CutPlanes_i
+::GetPlanePosition(CORBA::Long thePlaneNumber)
+{
return myCutPlanesPL->GetPartPosition(thePlaneNumber);
}
-void VISU::CutPlanes_i::SetDefault(CORBA::Long thePlaneNumber){
+//----------------------------------------------------------------------------
+void
+VISU::CutPlanes_i
+::SetDefault(CORBA::Long thePlaneNumber)
+{
myCutPlanesPL->SetPartDefault(thePlaneNumber);
}
-CORBA::Boolean VISU::CutPlanes_i::IsDefault(CORBA::Long thePlaneNumber){
+
+//----------------------------------------------------------------------------
+CORBA::Boolean
+VISU::CutPlanes_i
+::IsDefault(CORBA::Long thePlaneNumber)
+{
return myCutPlanesPL->IsPartDefault(thePlaneNumber);
}
-void VISU::CutPlanes_i::SetNbPlanes(CORBA::Long theNb) {
+//----------------------------------------------------------------------------
+void
+VISU::CutPlanes_i
+::SetNbPlanes(CORBA::Long theNb)
+{
myCutPlanesPL->SetNbParts(theNb);
}
-CORBA::Long VISU::CutPlanes_i::GetNbPlanes() {
+
+//----------------------------------------------------------------------------
+CORBA::Long
+VISU::CutPlanes_i
+::GetNbPlanes()
+{
return myCutPlanesPL->GetNbParts();
}
-void VISU::CutPlanes_i::DoHook(){
- if(!myPipeLine) myPipeLine = VISU_CutPlanesPL::New();
+//----------------------------------------------------------------------------
+void
+VISU::CutPlanes_i
+::CreatePipeLine()
+{
+ if(!myPipeLine)
+ myPipeLine = VISU_CutPlanesPL::New();
myCutPlanesPL = dynamic_cast<VISU_CutPlanesPL*>(myPipeLine);
- ScalarMap_i::DoHook();
+ TSuperClass::CreatePipeLine();
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::CutPlanes_i
+::CheckIsPossible()
+{
+ return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
}
+//----------------------------------------------------------------------------
VISU_Actor*
VISU::CutPlanes_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU" , "cut_planes_represent", 1);
class VISU_CutPlanesPL;
-namespace VISU{
+namespace VISU
+{
class CutPlanes_i : public virtual POA_VISU::CutPlanes,
public virtual ScalarMap_i
{
explicit
CutPlanes_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual ~CutPlanes_i();
+ virtual
+ ~CutPlanes_i();
+
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TCUTPLANES;
+ }
+
+ virtual
+ void
+ SetOrientation(VISU::CutPlanes::Orientation theOrient,
+ CORBA::Double theXAngle,
+ CORBA::Double theYAngle);
- virtual VISU::VISUType GetType() { return VISU::TCUTPLANES;};
+ virtual
+ VISU::CutPlanes::Orientation
+ GetOrientationType();
+
+ virtual
+ CORBA::Double
+ GetRotateX();
- virtual void SetOrientation(VISU::CutPlanes::Orientation theOrient,
- CORBA::Double theXAngle, CORBA::Double theYAngle);
+ virtual
+ CORBA::Double
+ GetRotateY();
- virtual VISU::CutPlanes::Orientation GetOrientationType();
- virtual CORBA::Double GetRotateX();
- virtual CORBA::Double GetRotateY();
+ virtual
+ void
+ SetDisplacement(CORBA::Double theDisp);
- virtual void SetDisplacement(CORBA::Double theDisp);
- virtual CORBA::Double GetDisplacement();
+ virtual
+ CORBA::Double
+ GetDisplacement();
+
+ virtual
+ void
+ SetPlanePosition(CORBA::Long thePlaneNumber,
+ CORBA::Double thePlanePosition);
+ virtual
+ CORBA::Double
+ GetPlanePosition(CORBA::Long thePlaneNumber);
- virtual void SetPlanePosition(CORBA::Long thePlaneNumber, CORBA::Double thePlanePosition);
- virtual CORBA::Double GetPlanePosition(CORBA::Long thePlaneNumber);
+ virtual
+ void
+ SetDefault(CORBA::Long thePlaneNumber);
- virtual void SetDefault(CORBA::Long thePlaneNumber);
- virtual CORBA::Boolean IsDefault(CORBA::Long thePlaneNumber);
+ virtual
+ CORBA::Boolean
+ IsDefault(CORBA::Long thePlaneNumber);
- virtual void SetNbPlanes(CORBA::Long theNb);
- virtual CORBA::Long GetNbPlanes();
+ virtual
+ void
+ SetNbPlanes(CORBA::Long theNb);
+
+ virtual
+ CORBA::Long
+ GetNbPlanes();
typedef VISU::CutPlanes TInterface;
- VISU_CutPlanesPL* GetCutPlanesPL(){ return myCutPlanesPL;}
+ VISU_CutPlanesPL*
+ GetSpecificPL() const
+ {
+ return myCutPlanesPL;
+ }
+
protected:
- virtual void DoHook();
+ //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine();
+
+ //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
VISU_CutPlanesPL *myCutPlanesPL;
public:
- static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck = true);
- virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration);
-
- virtual void ToStream(std::ostringstream& theStr);
-
- virtual Storable* Restore(const Storable::TRestoringMap& theMap);
-
+ //! Redefines VISU_ColoredPrs3d_i::IsPossible
+ static
+ int
+ IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck = true);
+
+ //! Redefines VISU_ColoredPrs3d_i::Create
+ virtual
+ Storable*
+ Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber);
+
+ //! Redefines VISU_ColoredPrs3d_i::ToStream
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
+
+ //! Redefines VISU_ColoredPrs3d_i::Restore
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
+
+ //! Redefines VISU_ColoredPrs3d_i::CreateActor
virtual
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
static const std::string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
+
+ //! Redefines VISU_ColoredPrs3d_i::GetComment
+ virtual
+ const char*
+ GetComment() const;
+
+ //! Redefines VISU_ColoredPrs3d_i::GenerateName
+ virtual
+ QString
+ GenerateName();
};
}
#include <vtkDataSetMapper.h>
#include <vtkProperty.h>
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
-int VISU::DeformedShape_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int
+VISU::DeformedShape_i
+::IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck)
{
try{
- if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck)) return 0;
- const VISU::PField aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName);
- return aField->myNbComp > 1;
+ bool aResult = TSuperClass::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ isMemoryCheck);
+ if(aResult){
+ VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::PField aField = anInput->GetField(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName);
+ return aField->myNbComp > 1;
+ }
}catch(std::exception& exc){
INFOS("Follow exception was occured :\n"<<exc.what());
}catch(...){
return 0;
}
+
+//---------------------------------------------------------------
int VISU::DeformedShape_i::myNbPresent = 0;
-QString VISU::DeformedShape_i::GenerateName() { return VISU::GenerateName("Def.Shape",myNbPresent++);}
+//---------------------------------------------------------------
+QString
+VISU::DeformedShape_i
+::GenerateName()
+{
+ return VISU::GenerateName("Def.Shape",myNbPresent++);
+}
+
+//---------------------------------------------------------------
const string VISU::DeformedShape_i::myComment = "DEFORMEDSHAPE";
-const char* VISU::DeformedShape_i::GetComment() const { return myComment.c_str();}
+//---------------------------------------------------------------
+const char*
+VISU::DeformedShape_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
-VISU::DeformedShape_i::
-DeformedShape_i(Result_i* theResult,
- bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+
+//---------------------------------------------------------------
+VISU::DeformedShape_i
+::DeformedShape_i(Result_i* theResult,
+ bool theAddToStudy):
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
}
-VISU::DeformedShape_i::
-DeformedShape_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+//---------------------------------------------------------------
+VISU::DeformedShape_i
+::DeformedShape_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject):
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
}
-void VISU::DeformedShape_i::SameAs(const Prs3d_i* theOrigin)
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::SameAs(const Prs3d_i* theOrigin)
{
TSuperClass::SameAs(theOrigin);
}
-VISU::Storable* VISU::DeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration)
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::DeformedShape_i
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber)
{
myIsColored = false;
myColor.R = myColor.G = myColor.B = 0.5;
- return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
-VISU::Storable* VISU::DeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::DeformedShape_i
+::Restore(const Storable::TRestoringMap& theMap)
{
TSuperClass::Restore(theMap);
}
-void VISU::DeformedShape_i::ToStream(std::ostringstream& theStr){
- ScalarMap_i::ToStream(theStr);
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myFactor", GetScale() );
}
-VISU::DeformedShape_i::~DeformedShape_i(){
+//---------------------------------------------------------------
+VISU::DeformedShape_i
+::~DeformedShape_i()
+{
if(MYDEBUG) MESSAGE("DeformedShape_i::~DeformedShape_i()");
}
-void VISU::DeformedShape_i::SetScale(CORBA::Double theScale) {
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::SetScale(CORBA::Double theScale)
+{
myDeformedShapePL->SetScale(theScale);
}
-CORBA::Double VISU::DeformedShape_i::GetScale(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::DeformedShape_i
+::GetScale()
+{
return myDeformedShapePL->GetScale();
}
-void VISU::DeformedShape_i::DoHook(){
- if(!myPipeLine) myPipeLine = VISU_DeformedShapePL::New();
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::CreatePipeLine()
+{
+ if(!myPipeLine)
+ myPipeLine = VISU_DeformedShapePL::New();
myDeformedShapePL = dynamic_cast<VISU_DeformedShapePL*>(myPipeLine);
myPipeLine->GetMapper()->SetScalarVisibility(IsColored());
- ScalarMap_i::DoHook();
+ TSuperClass::CreatePipeLine();
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::DeformedShape_i
+::CheckIsPossible()
+{
+ return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
}
-void VISU::DeformedShape_i::SetMapScale(double theMapScale){
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::SetMapScale(double theMapScale)
+{
myDeformedShapePL->SetMapScale(theMapScale);
}
+//---------------------------------------------------------------
VISU_Actor*
VISU::DeformedShape_i
-::CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking)
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO,
+ bool toSupressShrinking)
{
- VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO, true);
+ VISU_Actor* anActor = TSuperClass::CreateActor(theIO, true);
anActor->SetVTKMapping(false);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "deformed_shape_represent", 1);
return anActor;
}
+
+//---------------------------------------------------------------
VISU_Actor*
VISU::DeformedShape_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
return CreateActor(theIO, false);
}
-void VISU::DeformedShape_i::UpdateActor(VISU_Actor* theActor) {
+
+//---------------------------------------------------------------
+void
+VISU::DeformedShape_i
+::UpdateActor(VISU_Actor* theActor)
+{
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
if(IsColored()){
anActor->SetBarVisibility(true);
myPipeLine->GetMapper()->SetScalarVisibility(0);
anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
}
- VISU::ScalarMap_i::UpdateActor(theActor);
+ TSuperClass::UpdateActor(theActor);
}
}
class VISU_DeformedShapePL;
-namespace VISU{
+namespace VISU
+{
class DeformedShape_i : public virtual POA_VISU::DeformedShape,
public virtual ScalarMap_i
{
explicit
DeformedShape_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const Prs3d_i* theOrigin);
- virtual ~DeformedShape_i();
+ virtual
+ void
+ SameAs(const Prs3d_i* theOrigin);
- virtual VISU::VISUType GetType() { return VISU::TDEFORMEDSHAPE;};
+ virtual
+ ~DeformedShape_i();
- virtual void SetScale(CORBA::Double theScale);
- virtual CORBA::Double GetScale();
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TDEFORMEDSHAPE;
+ }
- virtual CORBA::Boolean IsColored() { return myIsColored; }
- virtual void ShowColored(CORBA::Boolean theColored) { myIsColored = theColored; }
+ virtual
+ void
+ SetScale(CORBA::Double theScale);
- virtual SALOMEDS::Color GetColor() { return myColor;}
- virtual void SetColor(const SALOMEDS::Color& theColor) { myColor = theColor;}
+ virtual
+ CORBA::Double
+ GetScale();
+
+ virtual
+ CORBA::Boolean
+ IsColored()
+ {
+ return myIsColored;
+ }
+
+ virtual
+ void
+ ShowColored(CORBA::Boolean theColored)
+ {
+ myIsColored = theColored;
+ }
+
+ virtual
+ SALOMEDS::Color GetColor()
+ {
+ return myColor;
+ }
+
+ virtual
+ void
+ SetColor(const SALOMEDS::Color& theColor)
+ {
+ myColor = theColor;
+ }
typedef VISU::DeformedShape TInterface;
- VISU_DeformedShapePL* GetDeformedShapePL(){ return myDeformedShapePL;}
+ VISU_DeformedShapePL*
+ GetSpecificPL() const
+ {
+ return myDeformedShapePL;
+ }
+
protected:
- virtual void DoHook();
+ //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine();
+
+ //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
VISU_DeformedShapePL *myDeformedShapePL;
SALOMEDS::Color myColor;
bool myIsColored;
public:
- static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck = true);
- virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration);
+ static
+ int
+ IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck = true);
+
+ virtual
+ Storable*
+ Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber);
static const std::string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
- virtual void ToStream(std::ostringstream& theStr);
+ virtual
+ const char*
+ GetComment() const;
+
+ virtual
+ QString
+ GenerateName();
- virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
- virtual void SetMapScale(double theMapScale = 1.0);
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
+
+ virtual
+ void
+ SetMapScale(double theMapScale = 1.0);
virtual
VISU_Actor*
virtual
VISU_Actor*
- CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking);
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO,
+ bool toSupressShrinking);
- virtual void UpdateActor(VISU_Actor* theActor) ;
+ virtual
+ void
+ UpdateActor(VISU_Actor* theActor) ;
};
}
break;
}
+ CORBA::String_var aMeshName = theServant->GetMeshName();
+ CORBA::String_var aFieldName = theServant->GetFieldName();
theStr<<thePrefix<<theName<<" = aVisu."<<theConstructorName<<"("<<theArgumentName<<
- ",'"<<theServant->GetMeshName()<<"'"<<
+ ",'"<<aMeshName.in()<<"'"<<
","<<aParam<<
- ",'"<<theServant->GetFieldName()<<"'"<<
- ","<<theServant->GetIteration()<<
+ ",'"<<aFieldName.in()<<"'"<<
+ ","<<theServant->GetTimeStampNumber()<<
")"<<endl;
theStr<<thePrefix<<"if "<<theName<<":"<<endl;
if(Mesh_i* aServant = dynamic_cast<Mesh_i*>(GetServant(anObj).in())){
VISU::Entity anEntity = aServant->GetEntity();
const std::string& aSubMeshName = aServant->GetSubMeshName();
+ CORBA::String_var aMeshName = aServant->GetMeshName();
if(anEntity >= 0){
std::string aParam;
switch(anEntity){
if(aSubMeshName == "")
theStr<<thePrefix<<aName<<" = aVisu.MeshOnEntity("<<theArgumentName<<
- ",'"<<aServant->GetMeshName()<<"'"<<
+ ",'"<<aMeshName.in()<<"'"<<
","<<aParam<<
")"<<endl;
else
theStr<<thePrefix<<aName<<" = aVisu.FamilyMeshOnEntity("<<theArgumentName<<
- ",'"<<aServant->GetMeshName()<<"'"<<
+ ",'"<<aMeshName.in()<<"'"<<
","<<aParam<<
",'"<<aSubMeshName<<"'"<<
")"<<endl;
}else
theStr<<thePrefix<<aName<<" = aVisu.GroupMesh("<<theArgumentName<<
- ",'"<<aServant->GetMeshName()<<"'"<<
+ ",'"<<aMeshName.in()<<"'"<<
",'"<<aSubMeshName<<"'"<<
")"<<endl;
#include <vtkTextProperty.h>
#include <vtkProperty.h>
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::DoSetInput(Result_i* theResult)
+::DoSetInput()
{
- VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::Result_i::TInput* anInput = myResult->GetInput();
if(!anInput)
- throw std::runtime_error("Mesh_i::Build - theResult->GetInput() == NULL !!!");
+ throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
- myField = anInput->GetField(myMeshName,myEntity,myFieldName);
+ myField = anInput->GetField(GetMeshName(),GetTEntity(),GetFieldName());
if(!myField)
throw std::runtime_error("There is no Field with the parameters !!!");
VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
- anInput->GetTimeStampOnGaussPts(myMeshName,myEntity,myFieldName,myIteration);
+ anInput->GetTimeStampOnGaussPts(GetMeshName(),GetTEntity(),GetFieldName(),GetTimeStampNumber());
if(!aGaussPtsIDMapper)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
myGaussPointsPL->Init();
myGaussPointsPL->Build();
- theResult->MinMaxConnect(this);
+ myResult->MinMaxConnect(this);
+}
+
+
+//----------------------------------------------------------------------------
+bool
+VISU::GaussPoints_i
+::CheckIsPossible()
+{
+ return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
}
//----------------------------------------------------------------------------
void
VISU::GaussPoints_i
-::DoHook()
+::CreatePipeLine()
{
if(!myPipeLine)
myPipeLine = VISU_GaussPointsPL::New();
myGaussPointsPL = dynamic_cast<VISU_GaussPointsPL*>(myPipeLine);
- TSuperClass::DoHook();
+ TSuperClass::CreatePipeLine();
}
void
UpdateMinMax();
+ VISU_GaussPointsPL*
+ GetSpecificPL() const
+ {
+ return myGaussPointsPL;
+ }
+
protected:
+ //! Redefines VISU_ColoredPrs3d_i::DoSetInput
virtual
void
- DoSetInput(Result_i* theResult);
+ DoSetInput();
+ //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
virtual
void
- DoHook();
+ CreatePipeLine();
+
+ //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
virtual
VISU_PipeLine*
UpdateScalarBar(vtkScalarBarActor *theScalarBar,
vtkLookupTable* theLookupTable);
-
+ protected:
VISU_GaussPointsPL *myGaussPointsPL;
-
+
bool myIsColored;
bool myIsDispGlobalScalarBar;
bool myIsActiveLocalScalarBar;
//===========================================================================
- VISU_Gen_i::VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA,
- SALOME_NamingService* theNamingService, QMutex* theMutex) :
+ VISU_Gen_i::
+ VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA,
+ SALOME_NamingService* theNamingService, QMutex* theMutex) :
Engines_Component_i()
{
if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : "<<theMutex);
if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : there is no opened study in StudyManager !!!");
}
+
+ template<typename TPrs3d_i>
+ Prs3d_ptr
+ CreatePrs3d(SALOMEDS::Study_ptr theStudy)
+ {
+ if(!theStudy->GetProperties()->IsLocked()){
+ typedef typename TPrs3d_i::TInterface TPrs3d;
+ typename TPrs3d::_var_type aPrs3d;
+ if(TPrs3d_i* aPresent = new TPrs3d_i(NULL,true)){
+ return aPresent->_this();
+ }
+ }
+ return Prs3d::_nil();
+ }
+
+
+ Prs3d_ptr
+ VISU_Gen_i::
+ CreatePrs3d(VISUType theType,
+ SALOMEDS::Study_ptr theStudy)
+ {
+ switch(theType){
+ case TSCALARMAP:
+ return VISU::CreatePrs3d<ScalarMap_i>(theStudy);
+ case TGAUSSPOINTS:
+ return VISU::CreatePrs3d<GaussPoints_i>(theStudy);
+ case TDEFORMEDSHAPE:
+ return VISU::CreatePrs3d<DeformedShape_i>(theStudy);
+ case TSCALARMAPONDEFORMEDSHAPE:
+ return VISU::CreatePrs3d<ScalarMapOnDeformedShape_i>(theStudy);
+ case TISOSURFACE:
+ return VISU::CreatePrs3d<IsoSurfaces_i>(theStudy);
+ case TSTREAMLINES:
+ return VISU::CreatePrs3d<StreamLines_i>(theStudy);
+ case TPLOT3D:
+ return VISU::CreatePrs3d<Plot3D_i>(theStudy);
+ case TCUTPLANES:
+ return VISU::CreatePrs3d<CutPlanes_i>(theStudy);
+ case TCUTLINES:
+ return VISU::CreatePrs3d<CutLines_i>(theStudy);
+ }
+ return Prs3d::_nil();
+ }
+
+
bool
CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
const char* theMeshName,
const char* theMeshName,
const char* theGroupName);
+ Prs3d_ptr
+ CreatePrs3d(VISUType theType,
+ SALOMEDS::Study_ptr theStudy);
+
//Create 3D collored Presentation Of Different Types
template<typename TPrs3d_i> TPrs3d_i*
CreatePrs3d(Result_ptr theResult,
#include "SUIT_ResourceMgr.h"
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
-int VISU::IsoSurfaces_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+//---------------------------------------------------------------
+int
+VISU::IsoSurfaces_i
+::IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck)
{
- return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+ return TSuperClass::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ isMemoryCheck);
}
+//---------------------------------------------------------------
int VISU::IsoSurfaces_i::myNbPresent = 0;
-QString VISU::IsoSurfaces_i::GenerateName() { return VISU::GenerateName("IsoSurfaces",myNbPresent++);}
+//---------------------------------------------------------------
+QString VISU::IsoSurfaces_i::GenerateName()
+{
+ return VISU::GenerateName("IsoSurfaces",myNbPresent++);
+}
+
+//---------------------------------------------------------------
const string VISU::IsoSurfaces_i::myComment = "ISOSURFACES";
-const char* VISU::IsoSurfaces_i::GetComment() const { return myComment.c_str();}
+
+//---------------------------------------------------------------
+const char*
+VISU::IsoSurfaces_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
-VISU::IsoSurfaces_i::
-IsoSurfaces_i(Result_i* theResult,
- bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+//---------------------------------------------------------------
+VISU::IsoSurfaces_i
+::IsoSurfaces_i(Result_i* theResult,
+ bool theAddToStudy) :
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
{}
-VISU::IsoSurfaces_i::
-IsoSurfaces_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+//---------------------------------------------------------------
+VISU::IsoSurfaces_i
+::IsoSurfaces_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject) :
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myIsoSurfacesPL(NULL)
-{
-}
+{}
-VISU::Storable* VISU::IsoSurfaces_i::Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration)
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::IsoSurfaces_i
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber)
{
- return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
-VISU::Storable* VISU::IsoSurfaces_i::Restore(const Storable::TRestoringMap& theMap)
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::IsoSurfaces_i
+::Restore(const Storable::TRestoringMap& theMap)
{
TSuperClass::Restore(theMap);
return this;
}
-void VISU::IsoSurfaces_i::ToStream(std::ostringstream& theStr){
- ScalarMap_i::ToStream(theStr);
+
+//---------------------------------------------------------------
+void
+VISU::IsoSurfaces_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myNbSurface", int(GetNbSurfaces()) );
Storable::DataToStream( theStr, "myRange[0]", GetSubMin() );
}
-VISU::IsoSurfaces_i::~IsoSurfaces_i(){
+//---------------------------------------------------------------
+VISU::IsoSurfaces_i
+::~IsoSurfaces_i()
+{
if(MYDEBUG) MESSAGE("IsoSurfaces_i::~IsoSurfaces_i()");
}
-void VISU::IsoSurfaces_i::SetNbSurfaces(CORBA::Long theNb){
+//---------------------------------------------------------------
+void
+VISU::IsoSurfaces_i
+::SetNbSurfaces(CORBA::Long theNb)
+{
myIsoSurfacesPL->SetNbParts(theNb);
}
-CORBA::Long VISU::IsoSurfaces_i::GetNbSurfaces(){
+
+//---------------------------------------------------------------
+CORBA::Long
+VISU::IsoSurfaces_i
+::GetNbSurfaces()
+{
return myIsoSurfacesPL->GetNbParts();
}
-void VISU::IsoSurfaces_i::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
+//---------------------------------------------------------------
+void
+VISU::IsoSurfaces_i
+::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
{
vtkFloatingPointType aRange[2] = {theMin, theMax};
myIsoSurfacesPL->SetRange(aRange);
}
-CORBA::Double VISU::IsoSurfaces_i::GetSubMin(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::IsoSurfaces_i
+::GetSubMin()
+{
return myIsoSurfacesPL->GetMin();
}
-CORBA::Double VISU::IsoSurfaces_i::GetSubMax(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::IsoSurfaces_i
+::GetSubMax()
+{
return myIsoSurfacesPL->GetMax();
}
-void VISU::IsoSurfaces_i::DoHook(){
+//---------------------------------------------------------------
+void
+VISU::IsoSurfaces_i
+::CreatePipeLine()
+{
if(MYDEBUG) MESSAGE("IsoSurfaces_i::DoHook()- "<<myPipeLine);
if(!myPipeLine) myPipeLine = VISU_IsoSurfacesPL::New();
myIsoSurfacesPL = dynamic_cast<VISU_IsoSurfacesPL*>(myPipeLine);
- ScalarMap_i::DoHook();
+ TSuperClass::CreatePipeLine();
}
+//---------------------------------------------------------------
+bool
+VISU::IsoSurfaces_i
+::CheckIsPossible()
+{
+ return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+}
+
+//---------------------------------------------------------------
VISU_Actor*
VISU::IsoSurfaces_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU" , "iso_surfaces_represent", 2);
return NULL;
}
-void VISU::IsoSurfaces_i::SetMapScale(double theMapScale){
+
+//---------------------------------------------------------------
+void
+VISU::IsoSurfaces_i
+::SetMapScale(double theMapScale)
+{
myIsoSurfacesPL->SetMapScale(theMapScale);
}
class VISU_IsoSurfacesPL;
-namespace VISU{
+namespace VISU
+{
class IsoSurfaces_i : public virtual POA_VISU::IsoSurfaces,
public virtual ScalarMap_i
{
explicit
IsoSurfaces_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual ~IsoSurfaces_i();
+ virtual
+ ~IsoSurfaces_i();
+
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TISOSURFACE;
+ }
- virtual VISU::VISUType GetType() { return VISU::TISOSURFACE;};
+ virtual
+ void
+ SetNbSurfaces(CORBA::Long theNb);
- virtual void SetNbSurfaces(CORBA::Long theNb);
- virtual CORBA::Long GetNbSurfaces();
+ virtual
+ CORBA::Long
+ GetNbSurfaces();
+
+ virtual
+ void
+ SetSubRange(CORBA::Double theMin, CORBA::Double theMax);
- virtual void SetSubRange(CORBA::Double theMin, CORBA::Double theMax);
- virtual CORBA::Double GetSubMin();
- virtual CORBA::Double GetSubMax();
+ virtual
+ CORBA::Double
+ GetSubMin();
+
+ virtual
+ CORBA::Double
+ GetSubMax();
typedef VISU::IsoSurfaces TInterface;
- VISU_IsoSurfacesPL* GetIsoSurfacesPL(){ return myIsoSurfacesPL;}
+ VISU_IsoSurfacesPL*
+ GetSpecificPL() const
+ {
+ return myIsoSurfacesPL;
+ }
+
protected:
- virtual void DoHook();
+ //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine();
+
+ //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
+
VISU_IsoSurfacesPL* myIsoSurfacesPL;
public:
- static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck = true);
- virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration);
+ static
+ int
+ IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck = true);
+
+ virtual
+ Storable*
+ Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber);
static const std::string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
- virtual void ToStream(std::ostringstream& theStr);
+ virtual
+ const char*
+ GetComment() const;
+
+ virtual
+ QString
+ GenerateName();
- virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
+
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
virtual
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
-
- virtual void SetMapScale(double theMapScale = 1.0);
+
+ virtual
+ void
+ SetMapScale(double theMapScale = 1.0);
};
}
VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
{
- SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
aStudyBuilder->NewCommand(); // There is a transaction
try {
if (myResult->GetInput() == NULL)
string anEntry = myResult->GetEntry(aComment.latin1());
if(anEntry == "")
throw std::runtime_error("Mesh_i::Build - anEntry was not found !!!");
- mySObject = myStudy->FindObjectID(anEntry.c_str());
- SALOMEDS::StudyBuilder_var aStudyBuilder = myStudy->NewBuilder();
+ mySObject = GetStudyDocument()->FindObjectID(anEntry.c_str());
+ SALOMEDS::StudyBuilder_var aStudyBuilder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(mySObject,"AttributeIOR");
SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
CORBA::String_var aString = GetID();
VISU_MeshPL* myMeshPL;
- // std::string myMeshName; move it to Prs3d_i
int myEntity;//jfa IPAL9284: TEntity myEntity;
std::string mySubMeshName;
VISU::VISUType myType;
static int IsPossible(Result_i* theResult, const char* theMeshName, const char* theGroupName);
virtual Storable* Create(const char* theMeshName, const char* theGroupName);
- const std::string& GetMeshName() const { return myMeshName;}
VISU::Entity GetEntity() const { return VISU::Entity(myEntity);}
const string& GetSubMeshName() const { return mySubMeshName;}
//
#include "VISU_Plot3D_i.hh"
-
#include "VISU_Result_i.hh"
-
#include "VISU_Plot3DPL.hxx"
-
#include "VISU_Actor.h"
-
#include "SUIT_ResourceMgr.h"
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
-int VISU::Plot3D_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int
+VISU::Plot3D_i
+::IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck)
{
- return VISU::ScalarMap_i::IsPossible
- (theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
+ return TSuperClass::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ isMemoryCheck);
}
+//---------------------------------------------------------------
int VISU::Plot3D_i::myNbPresent = 0;
-QString VISU::Plot3D_i::GenerateName() { return VISU::GenerateName("Plot3D",myNbPresent++); }
+//---------------------------------------------------------------
+QString
+VISU::Plot3D_i
+::GenerateName()
+{
+ return VISU::GenerateName("Plot3D",myNbPresent++);
+}
+
+//---------------------------------------------------------------
const string VISU::Plot3D_i::myComment = "PLOT3D";
-const char* VISU::Plot3D_i::GetComment() const { return myComment.c_str(); }
+//---------------------------------------------------------------
+const char*
+VISU::Plot3D_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
+
+
+//---------------------------------------------------------------
VISU::Plot3D_i
::Plot3D_i(Result_i* theResult,
bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
myPlot3DPL(NULL)
{}
+
+//---------------------------------------------------------------
VISU::Plot3D_i
::Plot3D_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myPlot3DPL(NULL)
{}
-VISU::Storable* VISU::Plot3D_i::Create (const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration)
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::Plot3D_i
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber)
{
- return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
-VISU::Storable* VISU::Plot3D_i::Restore (const Storable::TRestoringMap& theMap)
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::Plot3D_i
+::Restore(const Storable::TRestoringMap& theMap)
{
TSuperClass::Restore(theMap);
return this;
}
-void VISU::Plot3D_i::ToStream (std::ostringstream& theStr)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::ToStream(std::ostringstream& theStr)
{
- ScalarMap_i::ToStream(theStr);
+ TSuperClass::ToStream(theStr);
Storable::DataToStream(theStr, "myBasePlane", int(GetOrientationType()));
Storable::DataToStream(theStr, "aRot[0]", GetRotateX());
Storable::DataToStream(theStr, "myNbOfContours", int(GetNbOfContours()));
}
-VISU::Plot3D_i::~Plot3D_i(){
+
+//---------------------------------------------------------------
+VISU::Plot3D_i
+::~Plot3D_i()
+{
if(MYDEBUG) MESSAGE("Plot3D_i::~Plot3D_i()");
}
-void VISU::Plot3D_i::SetOrientation (VISU::Plot3D::Orientation theOrient,
- CORBA::Double theXAngle, CORBA::Double theYAngle)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetOrientation(VISU::Plot3D::Orientation theOrient,
+ CORBA::Double theXAngle,
+ CORBA::Double theYAngle)
{
myPlot3DPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
- theXAngle,theYAngle);
+ theXAngle,
+ theYAngle);
}
-VISU::Plot3D::Orientation VISU::Plot3D_i::GetOrientationType()
+
+//---------------------------------------------------------------
+VISU::Plot3D::Orientation
+VISU::Plot3D_i
+::GetOrientationType()
{
return VISU::Plot3D::Orientation(myPlot3DPL->GetPlaneOrientation());
}
-CORBA::Double VISU::Plot3D_i::GetRotateX()
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::Plot3D_i
+::GetRotateX()
{
return myPlot3DPL->GetRotateX();
}
-CORBA::Double VISU::Plot3D_i::GetRotateY()
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::Plot3D_i
+::GetRotateY()
{
return myPlot3DPL->GetRotateY();
}
-void VISU::Plot3D_i::SetPlanePosition (CORBA::Double thePlanePosition,
- CORBA::Boolean theIsRelative)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetPlanePosition(CORBA::Double thePlanePosition,
+ CORBA::Boolean theIsRelative)
{
myPlot3DPL->SetPlanePosition(thePlanePosition, theIsRelative);
}
-CORBA::Double VISU::Plot3D_i::GetPlanePosition()
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::Plot3D_i
+::GetPlanePosition()
{
return myPlot3DPL->GetPlanePosition();
}
-CORBA::Boolean VISU::Plot3D_i::IsPositionRelative()
+
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::Plot3D_i
+::IsPositionRelative()
{
return myPlot3DPL->IsPositionRelative();
}
-void VISU::Plot3D_i::SetScaleFactor (CORBA::Double theScaleFactor)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetScaleFactor(CORBA::Double theScaleFactor)
{
myPlot3DPL->SetScaleFactor(theScaleFactor);
}
-CORBA::Double VISU::Plot3D_i::GetScaleFactor()
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::Plot3D_i
+::GetScaleFactor()
{
return myPlot3DPL->GetScaleFactor();
}
-void VISU::Plot3D_i::SetNbOfContours (CORBA::Long theNb)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetNbOfContours(CORBA::Long theNb)
{
myPlot3DPL->SetNumberOfContours(theNb);
}
-CORBA::Long VISU::Plot3D_i::GetNbOfContours()
+
+//---------------------------------------------------------------
+CORBA::Long
+VISU::Plot3D_i
+::GetNbOfContours()
{
return myPlot3DPL->GetNumberOfContours();
}
-void VISU::Plot3D_i::SetContourPrs (CORBA::Boolean theIsContourPrs )
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetContourPrs(CORBA::Boolean theIsContourPrs)
{
myPlot3DPL->SetContourPrs( theIsContourPrs );
}
-CORBA::Boolean VISU::Plot3D_i::GetIsContourPrs()
+
+//---------------------------------------------------------------
+CORBA::Boolean
+VISU::Plot3D_i
+::GetIsContourPrs()
{
return myPlot3DPL->GetIsContourPrs();
}
-void VISU::Plot3D_i::DoHook()
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::CreatePipeLine()
{
- if (!myPipeLine) myPipeLine = VISU_Plot3DPL::New();
+ if (!myPipeLine)
+ myPipeLine = VISU_Plot3DPL::New();
myPlot3DPL = dynamic_cast<VISU_Plot3DPL*>(myPipeLine);
- ScalarMap_i::DoHook();
+ TSuperClass::CreatePipeLine();
}
+
+//---------------------------------------------------------------
+bool
+VISU::Plot3D_i
+::CheckIsPossible()
+{
+ return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+}
+
+//---------------------------------------------------------------
VISU_Actor*
VISU::Plot3D_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+ if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO)){
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "plot3d_represent", 2);
return NULL;
}
-void VISU::Plot3D_i::SetMapScale(double theMapScale)
+
+//---------------------------------------------------------------
+void
+VISU::Plot3D_i
+::SetMapScale(double theMapScale)
{
myPlot3DPL->SetMapScale(theMapScale);
}
class VISU_Plot3DPL;
-namespace VISU {
+namespace VISU
+{
class Plot3D_i : public virtual POA_VISU::Plot3D,
public virtual ScalarMap_i
{
typedef ScalarMap_i TSuperClass;
explicit
- Plot3D_i (Result_i* theResult, bool theAddToStudy = true);
+ Plot3D_i(Result_i* theResult,
+ bool theAddToStudy);
explicit
- Plot3D_i (Result_i* theResult, SALOMEDS::SObject_ptr theSObject);
+ Plot3D_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject);
- virtual ~Plot3D_i();
+ virtual
+ ~Plot3D_i();
+
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TPLOT3D;
+ }
+
+ virtual
+ void
+ SetOrientation (VISU::Plot3D::Orientation theOrient,
+ CORBA::Double theXAngle,
+ CORBA::Double theYAngle);
+
+ virtual
+ VISU::Plot3D::Orientation
+ GetOrientationType();
+
+ virtual
+ CORBA::Double
+ GetRotateX();
- virtual VISU::VISUType GetType() { return VISU::TPLOT3D; };
+ virtual
+ CORBA::Double
+ GetRotateY();
- virtual void SetOrientation (VISU::Plot3D::Orientation theOrient,
- CORBA::Double theXAngle, CORBA::Double theYAngle);
+ virtual
+ void
+ SetPlanePosition(CORBA::Double thePlanePosition,
+ CORBA::Boolean theIsRelative);
- virtual VISU::Plot3D::Orientation GetOrientationType();
+ virtual
+ CORBA::Double
+ GetPlanePosition();
- virtual CORBA::Double GetRotateX();
- virtual CORBA::Double GetRotateY();
+ virtual
+ CORBA::Boolean
+ IsPositionRelative();
- virtual void SetPlanePosition (CORBA::Double thePlanePosition,
- CORBA::Boolean theIsRelative);
- virtual CORBA::Double GetPlanePosition();
- virtual CORBA::Boolean IsPositionRelative();
+ virtual
+ void
+ SetScaleFactor(CORBA::Double theScaleFactor);
- virtual void SetScaleFactor (CORBA::Double theScaleFactor);
- virtual CORBA::Double GetScaleFactor();
+ virtual
+ CORBA::Double
+ GetScaleFactor();
- virtual void SetContourPrs (CORBA::Boolean theIsContourPrs );
- CORBA::Boolean GetIsContourPrs();
+ virtual
+ void
+ SetContourPrs(CORBA::Boolean theIsContourPrs);
- virtual void SetNbOfContours (CORBA::Long theNb);
- virtual CORBA::Long GetNbOfContours();
+ CORBA::Boolean
+ GetIsContourPrs();
- typedef VISU::Plot3D TInterface;
- VISU_Plot3DPL* GetPlot3DPL() { return myPlot3DPL; }
+ virtual
+ void
+ SetNbOfContours(CORBA::Long theNb);
- void SetMapScale(double theMapScale);
+ virtual
+ CORBA::Long
+ GetNbOfContours();
+ typedef VISU::Plot3D TInterface;
+
+ VISU_Plot3DPL*
+ GetSpecificPL() const
+ {
+ return myPlot3DPL;
+ }
+
protected:
- virtual void DoHook();
+ //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine();
+
+ //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
VISU_Plot3DPL *myPlot3DPL;
public:
- static int IsPossible (Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck = true);
+ static
+ int
+ IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck = true);
- virtual Storable* Create (const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration);
+ virtual
+ Storable*
+ Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber);
- virtual void ToStream (std::ostringstream& theStr);
+ virtual
+ void
+ ToStream (std::ostringstream& theStr);
- virtual Storable* Restore (const Storable::TRestoringMap& theMap);
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
virtual
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
static const std::string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
+
+ virtual
+ const char*
+ GetComment() const;
+
+ virtual
+ QString
+ GenerateName();
+
+ void
+ SetMapScale(double theMapScale);
};
}
VISU::Prs3d_i
::Prs3d_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(theSObject->GetStudy()),
mySObject(SALOMEDS::SObject::_duplicate(theSObject)),
myActorCollection(vtkActorCollection::New()),
- myResult(theResult),
myAddToStudy(true),
+ myResult(theResult),
myPipeLine(NULL)
{
if(MYDEBUG) MESSAGE("Prs3d_i::Prs3d_i - this = "<<this);
myOffset[0] = myOffset[1] = myOffset[2] = 0;
myActorCollection->Delete();
- myResult->Register();
+ if(theResult){
+ SetStudyDocument(theResult->GetStudyDocument());
+ theResult->Register();
+ }
}
VISU::Prs3d_i
::Prs3d_i(Result_i* theResult,
bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(SALOMEDS::Study::_nil()),
myActorCollection(vtkActorCollection::New()),
mySObject(SALOMEDS::SObject::_nil()),
myAddToStudy(theAddToStudy),
if(MYDEBUG) MESSAGE("Prs3d_i::Prs3d_i - this = "<<this);
myOffset[0] = myOffset[1] = myOffset[2] = 0;
myActorCollection->Delete();
- myResult->Register();
+ if(theResult){
+ SetStudyDocument(theResult->GetStudyDocument());
+ theResult->Register();
+ }
}
void
VISU::Prs3d_i
::SameAs(const Prs3d_i* theOrigin)
{
- if (Prs3d_i* aOrigin = const_cast<Prs3d_i*>(theOrigin)) {
- myPipeLine->SameAs(aOrigin->GetPL());
- aOrigin->GetOffset(myOffset);
+ if(Prs3d_i* anOrigin = const_cast<Prs3d_i*>(theOrigin)){
+ myPipeLine->SameAs(anOrigin->GetPL());
+ anOrigin->GetOffset(myOffset);
}
}
if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<<this);
myRemoveActorsFromRendererSignal();
myPipeLine->Delete();
- myResult->Destroy();
+ if(myResult)
+ myResult->Destroy();
+}
+
+
+//----------------------------------------------------------------------------
+bool
+VISU::Prs3d_i
+::SetInput()
+{
+ return true;
+}
+
+CORBA::Boolean
+VISU::Prs3d_i
+::Apply()
+{
+ if(SetInput()){
+ UpdateActors();
+ return true;
+ }
+ return false;
+}
+
+void
+VISU::Prs3d_i
+::SetResultObject(VISU::Result_ptr theResult)
+{
+ Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
+ if(myResult != aResult){
+ if(myResult)
+ myResult->Destroy();
+ if(aResult)
+ aResult->Register();
+ myResult = aResult;
+ }
+}
+
+VISU::Result_ptr
+VISU::Prs3d_i
+::GetResultObject()
+{
+ return myResult->_this();
+}
+
+void
+VISU::Prs3d_i
+::SetMeshName(const char* theMeshName)
+{
+ myMeshName = theMeshName;
+}
+
+char*
+VISU::Prs3d_i
+::GetMeshName()
+{
+ return CORBA::string_dup(myMeshName.c_str());
}
return myResult;
}
-const std::string&
-VISU::Prs3d_i
-::GetMeshName() const
-{
- return myMeshName;
-}
-
-
//----------------------------------------------------------------------------
void
VISU::Prs3d_i
{
if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<<this);
try{
- myPipeLine->Update();
+ if(myPipeLine)
+ myPipeLine->Update();
}catch(...){
throw std::runtime_error("Prs3d_i::Update >> unexpected exception was caught!!!");
}
throw std::runtime_error("Diagonal of the actor is too large !!!");
}
+
+struct TRemoveFromStudy: public SALOME_Event
+{
+ VISU::Prs3d_i* myRemovable;
+ typedef boost::signal0<void> TRemoveFromStudySignal;
+ const TRemoveFromStudySignal& myRemoveFromStudySignal;
+
+ TRemoveFromStudy(VISU::Prs3d_i* theRemovable,
+ const TRemoveFromStudySignal& theRemoveFromStudySignal):
+ myRemovable(theRemovable),
+ myRemoveFromStudySignal(theRemoveFromStudySignal)
+ {}
+
+ virtual
+ void
+ Execute()
+ {
+ myRemoveFromStudySignal();
+ myRemovable->Destroy();
+ }
+};
+
void
VISU::Prs3d_i
::RemoveFromStudy()
{
- struct TRemoveFromStudy: public SALOME_Event
- {
- VISU::Prs3d_i* myRemovable;
- typedef boost::signal0<void> TRemoveFromStudySignal;
- const TRemoveFromStudySignal& myRemoveFromStudySignal;
-
- TRemoveFromStudy(VISU::Prs3d_i* theRemovable,
- const TRemoveFromStudySignal& theRemoveFromStudySignal):
- myRemovable(theRemovable),
- myRemoveFromStudySignal(theRemoveFromStudySignal)
- {}
-
- virtual
- void
- Execute()
- {
- myRemoveFromStudySignal();
- myRemovable->Destroy();
- }
- };
-
ProcessVoidEvent(new TRemoveFromStudy(this,myRemoveActorsFromRendererSignal));
}
virtual
~Prs3d_i();
+ //----------------------------------------------------------------------------
+ virtual
+ CORBA::Boolean
+ Apply();
+
+ virtual
+ void
+ SetResultObject(VISU::Result_ptr theResult);
+
+ virtual
+ VISU::Result_ptr
+ GetResultObject();
+
+ virtual
+ void
+ SetMeshName(const char* theMeshName);
+
+ virtual
+ char*
+ GetMeshName();
+
//----------------------------------------------------------------------------
//! To generate an unique type name for the class (used into persistent functionality)
virtual
SALOMEDS::SObject_var
GetSObject();
- const std::string&
- GetMeshName() const;
-
//----------------------------------------------------------------------------
//! To update is internal state
virtual
//----------------------------------------------------------------------------
protected:
+ virtual
+ bool
+ SetInput();
+
void
CreateActor(VISU_Actor* theActor,
const Handle(SALOME_InteractiveObject)& theIO = NULL);
void
CheckDataSet();
+ protected:
+ Result_i *myResult;
+ std::string myMeshName;
+
bool myAddToStudy;
CORBA::Float myOffset[3];
- Result_i *myResult;
VISU_PipeLine *myPipeLine;
SALOMEDS::SObject_var mySObject;
- std::string myMeshName;
boost::signal0<void> myUpdateActorsSignal;
boost::signal0<void> myRemoveActorsFromRendererSignal;
vtkSmartPointer<vtkActorCollection> myActorCollection;
-
};
//----------------------------------------------------------------------------
// Module : VISU
#include "VISU_PrsObject_i.hh"
-using namespace VISU;
-using namespace std;
#ifdef _DEBUG_
-static int MYDEBUG = 1;
-static int MYDEBUGWITHFILES = 0;
+static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
-static int MYDEBUGWITHFILES = 0;
#endif
-void VISU::PrsObject_i::SetName( const char* theName )
+//---------------------------------------------------------------
+VISU::PrsObject_i
+::PrsObject_i(SALOMEDS::Study_ptr theStudy):
+ myStudy(SALOMEDS::Study::_duplicate(theStudy))
+{
+ if(MYDEBUG) MESSAGE("PrsObject_i::PrsObject_i - this = "<<this);
+}
+
+
+//---------------------------------------------------------------
+VISU::PrsObject_i
+::~PrsObject_i()
+{
+ if(MYDEBUG) MESSAGE("PrsObject_i::~PrsObject_i - this = "<<this);
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::PrsObject_i
+::SetName(const char* theName)
{
myName = theName;
- SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() );
- if(!mySO->_is_nil()){
+ SALOMEDS::SObject_var aSObject = myStudy->FindObjectID( GetEntry() );
+ if(!aSObject->_is_nil()){
SALOMEDS::StudyBuilder_var aBuilder = myStudy->NewBuilder();
- SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( mySO, "AttributeName" );
+ SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( aSObject, "AttributeName" );
SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow( anAttr );
aNameAttr->SetValue( theName );
}
}
-QString VISU::PrsObject_i::GetEntry() {
+
+
+//---------------------------------------------------------------
+const char*
+VISU::PrsObject_i
+::GetName() const
+{
+ return myName.c_str();
+}
+
+
+//---------------------------------------------------------------
+const SALOMEDS::Study_var&
+VISU::PrsObject_i
+::GetStudyDocument() const
+{
+ return myStudy;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::PrsObject_i
+::SetStudyDocument(SALOMEDS::Study_ptr theStudy)
+{
+ myStudy = SALOMEDS::Study::_duplicate(theStudy);
+}
+
+
+//---------------------------------------------------------------
+QString
+VISU::PrsObject_i
+::GetEntry()
+{
CORBA::String_var anIOR = GetID();
SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(anIOR.in());
CORBA::String_var anEntry;
#include "VISUConfig.hh"
-namespace VISU{
+namespace VISU
+{
class PrsObject_i : public virtual POA_VISU::PrsObject,
public virtual RemovableObject_i
{
PrsObject_i(const PrsObject_i&);
+ SALOMEDS::Study_var myStudy;
public:
- PrsObject_i(SALOMEDS::Study_ptr theStudy) : myStudy(SALOMEDS::Study::_duplicate(theStudy)) {};
- virtual ~PrsObject_i() {}
+ PrsObject_i(SALOMEDS::Study_ptr theStudy = SALOMEDS::Study::_nil());
+
+ virtual
+ ~PrsObject_i();
protected:
+ void
+ SetStudyDocument(SALOMEDS::Study_ptr theStudy);
+
std::string myName;
- SALOMEDS::Study_var myStudy;
public:
- virtual const char* GetName() const { return myName.c_str();}
- virtual void SetName( const char* theName );
- const SALOMEDS::Study_var& GetStudyDocument() const { return myStudy;}
+ virtual
+ const char*
+ GetName() const;
+
+ virtual
+ void
+ SetName(const char* theName);
+
+ const SALOMEDS::Study_var&
+ GetStudyDocument() const;
+
QString GetEntry();
};
}
static int INCMEMORY = 4+12;
-int VISU::ScalarMapOnDeformedShape_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int
+VISU::ScalarMapOnDeformedShape_i
+::IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck)
{
bool aResult = false;
try{
- aResult = VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false);
+ aResult = VISU::ScalarMap_i::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ false);
if(isMemoryCheck && aResult){
- const VISU::PField aField = theResult->GetInput()->GetField(theMeshName,(VISU::TEntity)theEntity,theFieldName);
+ VISU::Result_i::TInput* anInput = theResult->GetInput();
+ const VISU::PField aField = anInput->GetField(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName);
if(aField->myNbComp <= 1)
return false;
- float aSize = INCMEMORY*
- theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
+ float aSize = anInput->GetTimeStampSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
}
return aResult;
}
+//---------------------------------------------------------------
int VISU::ScalarMapOnDeformedShape_i::myNbPresent = 0;
-QString VISU::ScalarMapOnDeformedShape_i::GenerateName() { return VISU::GenerateName("ScalarDef.Shape",myNbPresent++);}
+//---------------------------------------------------------------
+QString
+VISU::ScalarMapOnDeformedShape_i
+::GenerateName()
+{
+ return VISU::GenerateName("ScalarDef.Shape",myNbPresent++);
+}
+
+//---------------------------------------------------------------
const string VISU::ScalarMapOnDeformedShape_i::myComment = "SCALARMAPONDEFORMEDSHAPE";
-const char* VISU::ScalarMapOnDeformedShape_i::GetComment() const { return myComment.c_str();}
-VISU::ScalarMapOnDeformedShape_i::
-ScalarMapOnDeformedShape_i(Result_i* theResult,
- bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+//---------------------------------------------------------------
+const char*
+VISU::ScalarMapOnDeformedShape_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
+
+//---------------------------------------------------------------
+VISU::ScalarMapOnDeformedShape_i
+::ScalarMapOnDeformedShape_i(Result_i* theResult,
+ bool theAddToStudy) :
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
myScalarMapOnDeformedShapePL(NULL),
myScalarIteration(1)
-{
-}
+{}
-VISU::ScalarMapOnDeformedShape_i::
-ScalarMapOnDeformedShape_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+//---------------------------------------------------------------
+VISU::ScalarMapOnDeformedShape_i
+::ScalarMapOnDeformedShape_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject):
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
myScalarMapOnDeformedShapePL(NULL),
myScalarIteration(1)
-{
-}
+{}
-VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration)
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::ScalarMapOnDeformedShape_i
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber)
{
- if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Create:"<<__LINE__<<endl;
myIsColored = true;
myColor.R = myColor.G = myColor.B = 0.5;
- VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theIteration);
+ VISU::Storable* aRes = TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
SetScalarFieldName(theFieldName);
- SetScalarIteration(theIteration);
+ SetScalarIteration(theTimeStampNumber);
SetScalarMeshName(theMeshName);
int anEntity = theEntity;
SetScalarEntity(VISU::TEntity(anEntity));
return aRes;
}
-VISU::Storable* VISU::ScalarMapOnDeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::ScalarMapOnDeformedShape_i
+::Restore(const Storable::TRestoringMap& theMap)
{
- if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::Restore:"<<__LINE__<<endl;
TSuperClass::Restore(theMap);
SetScalarFieldName(VISU::Storable::FindValue(theMap,"myScalarFieldName"));
return this;
}
-void VISU::ScalarMapOnDeformedShape_i::ToStream(std::ostringstream& theStr)
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::ToStream(std::ostringstream& theStr)
{
- if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::ToStream:"<<__LINE__<<endl;
TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myScalarFieldName", myScalarFieldName.c_str());
Storable::DataToStream( theStr, "myColor.R", myColor.R );
Storable::DataToStream( theStr, "myColor.G", myColor.G );
Storable::DataToStream( theStr, "myColor.B", myColor.B );
-
}
-VISU::ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i(){
+
+//---------------------------------------------------------------
+VISU::ScalarMapOnDeformedShape_i
+::~ScalarMapOnDeformedShape_i()
+{
if(MYDEBUG) MESSAGE("ScalarMapOnDeformedShape_i::~ScalarMapOnDeformedShape_i()");
}
+
+//---------------------------------------------------------------
void
VISU::ScalarMapOnDeformedShape_i
::SameAs(const Prs3d_i* theOrigin)
{
- if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SameAs:"<<__LINE__<<endl;
int theScalarIter = this->GetScalarIteration();
string theScalarMeshName = this->GetScalarMeshName();
string theScalarFieldName = this->GetScalarFieldName();
- if(MYDEBUG) cout << "SameAs:"<<endl
- << "\t"<<theScalarIter<<":"<<theScalarMeshName.c_str()<<":"<<theScalarFieldName.c_str()<<endl;
TSuperClass::SameAs(theOrigin);
-
+
if(const ScalarMapOnDeformedShape_i* aPrs3d = dynamic_cast<const ScalarMapOnDeformedShape_i*>(theOrigin)){
ScalarMapOnDeformedShape_i* anOrigin = const_cast<ScalarMapOnDeformedShape_i*>(aPrs3d);
-
+
this->SetScalarField(anOrigin->GetScalarMeshName().c_str(),
anOrigin->GetScalarFieldName().c_str(),
theScalarIter,
}
}
-void VISU::ScalarMapOnDeformedShape_i::SetScale(CORBA::Double theScale) {
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScale(CORBA::Double theScale)
+{
myScalarMapOnDeformedShapePL->SetScale(theScale);
}
-CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetScale(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::ScalarMapOnDeformedShape_i
+::GetScale()
+{
return myScalarMapOnDeformedShapePL->GetScale();
}
-void VISU::ScalarMapOnDeformedShape_i::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange){
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange)
+{
vtkFloatingPointType aRange[2];
aRange[0] = vtkFloatingPointType(theMinRange);
aRange[1] = vtkFloatingPointType(theMaxRange);
myScalarMapOnDeformedShapePL->SetScalarRange(aRange);
}
-CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMin(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::ScalarMapOnDeformedShape_i
+::GetSourceRangeMin()
+{
vtkFloatingPointType aRange[2];
myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
return aRange[0];
}
-CORBA::Double VISU::ScalarMapOnDeformedShape_i::GetSourceRangeMax(){
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::ScalarMapOnDeformedShape_i
+::GetSourceRangeMax()
+{
vtkFloatingPointType aRange[2];
myScalarMapOnDeformedShapePL->GetSourceRange(aRange);
return aRange[1];
}
-void VISU::ScalarMapOnDeformedShape_i::DoHook()
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::CreatePipeLine()
{
if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::DoHook:"<<__LINE__<<endl;
if(!myPipeLine)
myScalarMapOnDeformedShapePL = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(myPipeLine);
myPipeLine->GetMapper()->SetScalarVisibility(IsColored());
- TSuperClass::DoHook();
+ TSuperClass::CreatePipeLine();
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::ScalarMapOnDeformedShape_i
+::CheckIsPossible()
+{
+ return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
}
-VISU_Actor* VISU::ScalarMapOnDeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+
+//---------------------------------------------------------------
+VISU_Actor*
+VISU::ScalarMapOnDeformedShape_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::CreateActor:"<<__LINE__<<endl;
VISU_Actor* anActor = TSuperClass::CreateActor(theIO, true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
}
-void VISU::ScalarMapOnDeformedShape_i::UpdateActor(VISU_Actor* theActor) {
- if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::UpdateActor:"<<__LINE__<<endl;
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::UpdateActor(VISU_Actor* theActor)
+{
if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
if(IsColored()){
anActor->SetBarVisibility(true);
}
}
-void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
- const char* theFieldName,
- int theIteration,
- VISU::TEntity theEntity)
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ int theIteration,
+ VISU::TEntity theEntity)
{
- if(MYDEBUG) cout << "VISU::ScalarMapOnDeformedShape_i::SetScalarField:"<<__LINE__<<endl;
- if(MYDEBUG) cout << "\ttheFieldName="<<theFieldName<<endl;
- if(MYDEBUG) cout << "\ttheIteration="<<theIteration<<endl;
myScalarField = myResult->GetInput()->GetField(theMeshName,theEntity,theFieldName);
TVTKOutput* aOut = myResult->GetInput()->GetTimeStampOnMesh(theMeshName,
theEntity,
this->SetScalarEntity(theEntity);
}
-void VISU::ScalarMapOnDeformedShape_i::SetScalarField(const char* theMeshName,
- const char* theFieldName,
- CORBA::Long theIteration,
- VISU::Entity theEntity)
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ CORBA::Long theIteration,
+ VISU::Entity theEntity)
{
this->SetScalarField(theMeshName,theFieldName,(int)theIteration,VISU::TEntity(theEntity));
}
-void VISU::ScalarMapOnDeformedShape_i::SetScalarMeshName(const char* theName){
+
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarMeshName(const char* theName)
+{
myScalarMeshName = theName;
}
-std::string VISU::ScalarMapOnDeformedShape_i::GetScalarMeshName(){
+
+//---------------------------------------------------------------
+std::string
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarMeshName()
+{
return myScalarMeshName;
}
-void VISU::ScalarMapOnDeformedShape_i::SetScalarFieldName(const char* theName){
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarFieldName(const char* theName)
+{
myScalarFieldName = theName;
}
-std::string VISU::ScalarMapOnDeformedShape_i::GetScalarFieldName(){
+//---------------------------------------------------------------
+std::string
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarFieldName()
+{
return myScalarFieldName;
}
-void VISU::ScalarMapOnDeformedShape_i::SetScalarIteration(const int theValue){
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarIteration(const int theValue)
+{
myScalarIteration = theValue;
}
-int VISU::ScalarMapOnDeformedShape_i::GetScalarIteration(){
+//---------------------------------------------------------------
+int
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarIteration()
+{
return myScalarIteration;
}
-void VISU::ScalarMapOnDeformedShape_i::SetScalarEntity(const VISU::TEntity theValue){
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarEntity(const VISU::TEntity theValue)
+{
myScalarEntity = theValue;
}
-VISU::TEntity VISU::ScalarMapOnDeformedShape_i::GetScalarEntity(){
+//---------------------------------------------------------------
+VISU::TEntity
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarEntity()
+{
return myScalarEntity;
}
-void VISU::ScalarMapOnDeformedShape_i::SetScalarEEntity(const VISU::Entity theValue){
+//---------------------------------------------------------------
+void
+VISU::ScalarMapOnDeformedShape_i
+::SetScalarEEntity(const VISU::Entity theValue)
+{
myScalarEntity = VISU::TEntity(theValue);
}
-VISU::Entity VISU::ScalarMapOnDeformedShape_i::GetScalarEEntity(){
+//---------------------------------------------------------------
+VISU::Entity
+VISU::ScalarMapOnDeformedShape_i
+::GetScalarEEntity()
+{
return VISU::Entity(myScalarEntity);
}
+//---------------------------------------------------------------
const VISU::PField&
VISU::ScalarMapOnDeformedShape_i
::GetField() const
class VISU_ScalarMapOnDeformedShapePL;
-namespace VISU{
+namespace VISU
+{
//! Class of Scalar Map on Deformed Shape presentation.
class ScalarMapOnDeformedShape_i : public virtual POA_VISU::ScalarMapOnDeformedShape,
virtual VISU::VISUType GetType()
{
return VISU::TSCALARMAPONDEFORMEDSHAPE;
- };
+ }
- typedef VISU::ScalarMapOnDeformedShape TInterface;
-
- virtual void SetScale(CORBA::Double theScale);
- virtual CORBA::Double GetScale();
+ virtual
+ void
+ SetScale(CORBA::Double theScale);
- virtual CORBA::Boolean IsColored() { return myIsColored; }
- virtual void ShowColored(CORBA::Boolean theColored) { myIsColored = theColored; }
+ virtual
+ CORBA::Double
+ GetScale();
- virtual SALOMEDS::Color GetColor() { return myColor;}
- virtual void SetColor(const SALOMEDS::Color& theColor) { myColor = theColor;}
+ virtual
+ CORBA::Boolean
+ IsColored()
+ {
+ return myIsColored;
+ }
- virtual void SetSourceRange(CORBA::Double theMinRange,CORBA::Double theMaxRange);
- virtual CORBA::Double GetSourceRangeMin();
- virtual CORBA::Double GetSourceRangeMax();
+ virtual
+ void
+ ShowColored(CORBA::Boolean theColored)
+ {
+ myIsColored = theColored;
+ }
+
+ virtual
+ SALOMEDS::Color
+ GetColor()
+ {
+ return myColor;
+ }
+
+ virtual
+ void
+ SetColor(const SALOMEDS::Color& theColor)
+ {
+ myColor = theColor;
+ }
+
+ virtual
+ void
+ SetSourceRange(CORBA::Double theMinRange,
+ CORBA::Double theMaxRange);
+
+ virtual
+ CORBA::Double
+ GetSourceRangeMin();
+
+ virtual
+ CORBA::Double
+ GetSourceRangeMax();
virtual
void
virtual const VISU::PField&
GetField() const;
- VISU_ScalarMapOnDeformedShapePL* GetScalarMapOnDeformedShapePL(){ return myScalarMapOnDeformedShapePL;}
+ typedef VISU::ScalarMapOnDeformedShape TInterface;
+
+ VISU_ScalarMapOnDeformedShapePL*
+ GetScalarMapOnDeformedShapePL()
+ {
+ return myScalarMapOnDeformedShapePL;
+ }
protected:
-
+ //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
virtual
void
- DoHook();
+ CreatePipeLine();
+
+ //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
SALOMEDS::Color myColor;
PField myScalarField;
public:
- static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck = true);
- virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration);
+ //! Redefines VISU_ColoredPrs3d_i::IsPossible
+ static
+ int
+ IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck = true);
+
+ //! Redefines VISU_ColoredPrs3d_i::IsPossible
+ virtual
+ Storable*
+ Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber);
- virtual void ToStream(std::ostringstream& theStr);
+ //! Redefines VISU_ColoredPrs3d_i::ToStream
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
- virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ //! Redefines VISU_ColoredPrs3d_i::Restore
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
- static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
- const std::string& thePrefix, const Storable::TRestoringMap& theMap);
+ static
+ Storable*
+ Restore(SALOMEDS::SObject_ptr theSObject,
+ const std::string& thePrefix,
+ const Storable::TRestoringMap& theMap);
static const std::string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
- virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+ virtual
+ const char*
+ GetComment() const;
- virtual void UpdateActor(VISU_Actor* theActor) ;
+ virtual
+ QString
+ GenerateName();
- virtual void SetScalarField(const char* theMeshName,
- const char* theFieldName,
- int theIteration,
- VISU::TEntity theEntity);
+ virtual
+ VISU_Actor*
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+ virtual
+ void
+ UpdateActor(VISU_Actor* theActor) ;
+
+ virtual
+ void
+ SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ int theIteration,
+ VISU::TEntity theEntity);
- virtual void SetScalarField(const char* theMeshName,
- const char* theFieldName,
- CORBA::Long theIteration,
- VISU::Entity theEntity);
-
- virtual void SetScalarFieldName(const char* theName);
- virtual std::string GetScalarFieldName();
- virtual void SetScalarIteration(const int theValue);
- virtual int GetScalarIteration();
- virtual void SetScalarMeshName(const char* theName);
- virtual std::string GetScalarMeshName();
- virtual void SetScalarEntity(const VISU::TEntity theValue);
- virtual VISU::TEntity GetScalarEntity();
- virtual void SetScalarEEntity(const VISU::Entity theValue);
- virtual VISU::Entity GetScalarEEntity();
+ virtual
+ void
+ SetScalarField(const char* theMeshName,
+ const char* theFieldName,
+ CORBA::Long theIteration,
+ VISU::Entity theEntity);
+
+ virtual
+ void
+ SetScalarFieldName(const char* theName);
+
+ virtual
+ std::string
+ GetScalarFieldName();
+
+ virtual
+ void
+ SetScalarIteration(const int theValue);
+
+ virtual
+ int
+ GetScalarIteration();
+
+ virtual
+ void
+ SetScalarMeshName(const char* theName);
+
+ virtual
+ std::string
+ GetScalarMeshName();
+
+ virtual
+ void
+ SetScalarEntity(const VISU::TEntity theValue);
+
+ virtual
+ VISU::TEntity
+ GetScalarEntity();
+
+ virtual
+ void
+ SetScalarEEntity(const VISU::Entity theValue);
+
+ virtual
+ VISU::Entity
+ GetScalarEEntity();
};
}
#endif
#include <vtkDataSetMapper.h>
#include <vtkTextProperty.h>
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static int INCMEMORY = 4;
-//============================================================================
+//----------------------------------------------------------------------------
int
VISU::ScalarMap_i
::IsPossible(Result_i* theResult,
const char* theMeshName,
- VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck)
{
try{
- float aSize = INCMEMORY*
- theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
bool aResult = true;
- if(isMemoryCheck){
- aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
- MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ if(theResult){
+ VISU::Result_i::TInput* anInput = theResult->GetInput();
+ float aSize = anInput->GetTimeStampSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ aSize *= INCMEMORY;
+ if(isMemoryCheck){
+ aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
+ MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+ }
}
return aResult;
}catch(std::exception& exc){
}
//----------------------------------------------------------------------------
-int
-VISU::ScalarMap_i
-::myNbPresent = 0;
+int VISU::ScalarMap_i::myNbPresent = 0;
+//----------------------------------------------------------------------------
QString
VISU::ScalarMap_i
::GenerateName()
return VISU::GenerateName("ScalarMap",myNbPresent++);
}
-const string
-VISU::ScalarMap_i
-::myComment = "SCALARMAP";
+//----------------------------------------------------------------------------
+const string VISU::ScalarMap_i::myComment = "SCALARMAP";
+//----------------------------------------------------------------------------
const char*
VISU::ScalarMap_i
-::GetComment() const {
+::GetComment() const
+{
return myComment.c_str();
}
VISU::ScalarMap_i::
ScalarMap_i(Result_i* theResult,
bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy)
{}
+//----------------------------------------------------------------------------
VISU::ScalarMap_i::
ScalarMap_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject)
{}
+//----------------------------------------------------------------------------
VISU::ScalarMap_i
::~ScalarMap_i()
{}
return this;
}
+//----------------------------------------------------------------------------
VISU::Storable*
VISU::ScalarMap_i
::Restore(const Storable::TRestoringMap& theMap)
return this;
}
+//----------------------------------------------------------------------------
void
VISU::ScalarMap_i
::ToStream(std::ostringstream& theStr)
TSuperClass::SetBarOrientation(theOrientation);
}
+//----------------------------------------------------------------------------
VISU::ScalarMap::Orientation
VISU::ScalarMap_i
::GetBarOrientation()
return TSuperClass::GetBarOrientation();
}
+//----------------------------------------------------------------------------
VISU::Scaling
VISU::ScalarMap_i
::GetScaling()
return VISU::Scaling(myScalarMapPL->GetScaling());
}
+//----------------------------------------------------------------------------
void
VISU::ScalarMap_i
::SetScaling(VISU::Scaling theScaling)
myScalarMapPL->SetScaling(theScaling);
}
+//----------------------------------------------------------------------------
void
VISU::ScalarMap_i
::SetRange(CORBA::Double theMin, CORBA::Double theMax)
//----------------------------------------------------------------------------
void
VISU::ScalarMap_i
-::DoSetInput(Result_i* theResult)
+::DoSetInput()
{
- VISU::Result_i::TInput* anInput = theResult->GetInput();
+ VISU::Result_i::TInput* anInput = myResult->GetInput();
if(!anInput)
- throw std::runtime_error("Mesh_i::Build - theResult->GetInput() == NULL !!!");
+ throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
- myField = anInput->GetField(myMeshName,myEntity,myFieldName);
+ myField = anInput->GetField(GetMeshName(),GetTEntity(),GetFieldName());
if(!myField)
throw std::runtime_error("There is no Field with the parameters !!!");
VISU::PIDMapper anIDMapper =
- anInput->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
+ anInput->GetTimeStampOnMesh(GetMeshName(),GetTEntity(),GetFieldName(),GetTimeStampNumber());
if(!anIDMapper)
throw std::runtime_error("There is no TimeStamp with the parameters !!!");
myScalarMapPL->Build();
}
-void
+
+//----------------------------------------------------------------------------
+bool
VISU::ScalarMap_i
-::Update()
+::CheckIsPossible()
{
- TSuperClass::Update();
+ return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
}
myScalarMapPL->SetMapScale(theMapScale);
}
+//----------------------------------------------------------------------------
bool
VISU::ScalarMap_i
::IsRangeFixed()
return myIsFixedRange;
}
+//----------------------------------------------------------------------------
void
VISU::ScalarMap_i
::SetSourceRange()
return anActor;
}
+//----------------------------------------------------------------------------
VISU_Actor*
VISU::ScalarMap_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
return CreateActor(theIO, false);
}
+//----------------------------------------------------------------------------
void
VISU::ScalarMap_i
::UpdateActor(VISU_Actor* theActor)
typedef VISU::ScalarMap TInterface;
protected:
+ //! Redefines VISU_ColoredPrs3d_i::DoSetInput
virtual
void
- DoSetInput(Result_i* theResult);
+ DoSetInput();
+
+ //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
public:
+ /*!
+ Checks staticaly, whether it is possible to create presentation
+ with the given basic parameters or not.
+ */
static
int
IsPossible(Result_i* theResult,
const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- int theIteration,
+ int theTimeStampNumber,
int isMemoryCheck = true);
+
+ //! Redefines VISU_ColoredPrs3d_i::Create
virtual
Storable*
Create(const char* theMeshName,
VISU::Entity theEntity,
const char* theFieldName,
- int theIteration);
+ int theTimeStampNumber);
virtual
void
const std::string& thePrefix,
const Storable::TRestoringMap& theMap);
- virtual
- void
- Update() ;
-
virtual
void
SetMapScale(double theMapScale = 1.0);
virtual
VISU_Actor*
- CreateActor(const Handle(SALOME_InteractiveObject)& theIO, bool toSupressShrinking);
+ CreateActor(const Handle(SALOME_InteractiveObject)& theIO,
+ bool toSupressShrinking);
virtual
void
#include <vtkAppendFilter.h>
#include <vtkUnstructuredGrid.h>
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static int MYDEBUG = 0;
#endif
-int VISU::StreamLines_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int
+VISU::StreamLines_i
+::IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck)
{
try{
- if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false))
+ if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theTimeStampNumber,false))
return 0;
+ VISU::Result_i::TInput* anInput = theResult->GetInput();
VISU::PIDMapper anIDMapper =
- theResult->GetInput()->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theIteration);
+ anInput->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theTimeStampNumber);
VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
bool aResult = VISU_StreamLinesPL::IsPossible(aDataSet);
MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
return 0;
}
-
+//---------------------------------------------------------------
int VISU::StreamLines_i::myNbPresent = 0;
-QString VISU::StreamLines_i::GenerateName() { return VISU::GenerateName("StreamLines",myNbPresent++);}
+//---------------------------------------------------------------
+QString
+VISU::StreamLines_i
+::GenerateName()
+{
+ return VISU::GenerateName("StreamLines",myNbPresent++);
+}
+//---------------------------------------------------------------
const string VISU::StreamLines_i::myComment = "STREAMLINES";
-const char* VISU::StreamLines_i::GetComment() const { return myComment.c_str();}
+
+//---------------------------------------------------------------
+const char*
+VISU::StreamLines_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
-VISU::StreamLines_i::
-StreamLines_i(Result_i* theResult,
- bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+//---------------------------------------------------------------
+VISU::StreamLines_i
+::StreamLines_i(Result_i* theResult,
+ bool theAddToStudy) :
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
DeformedShape_i(theResult,theAddToStudy),
myStreamLinesPL(NULL),
myAppendFilter(vtkAppendFilter::New())
-{
-}
+{}
-VISU::StreamLines_i::
-StreamLines_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+//---------------------------------------------------------------
+VISU::StreamLines_i
+::StreamLines_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject) :
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
DeformedShape_i(theResult,theSObject),
myStreamLinesPL(NULL),
myAppendFilter(vtkAppendFilter::New())
-{
-}
+{}
-void VISU::StreamLines_i::SameAs(const Prs3d_i* theOrigin)
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::SameAs(const Prs3d_i* theOrigin)
{
TSuperClass::SameAs(theOrigin);
}
-VISU::Storable* VISU::StreamLines_i::Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration)
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::StreamLines_i
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber)
{
- return DeformedShape_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
-VISU::Storable* VISU::StreamLines_i::Restore(const Storable::TRestoringMap& theMap)
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::StreamLines_i
+::Restore(const Storable::TRestoringMap& theMap)
{
TSuperClass::Restore(theMap);
}
-void VISU::StreamLines_i::ToStream(std::ostringstream& theStr){
- DeformedShape_i::ToStream(theStr);
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myIntegrationStep", GetIntegrationStep());
Storable::DataToStream( theStr, "myPropagationTime", GetPropagationTime());
}
-VISU::StreamLines_i::~StreamLines_i(){
+//---------------------------------------------------------------
+VISU::StreamLines_i
+::~StreamLines_i()
+{
if(MYDEBUG) MESSAGE("StreamLines_i::~StreamLines_i()");
myAppendFilter->UnRegisterAllOutputs();
myAppendFilter->Delete();
}
+//---------------------------------------------------------------
CORBA::Boolean
-VISU::StreamLines_i::SetParams(CORBA::Double theIntStep,
- CORBA::Double thePropogationTime,
- CORBA::Double theStepLength,
- VISU::Prs3d_ptr thePrs3d,
- CORBA::Double thePercents,
- VISU::StreamLines::Direction theDirection)
+VISU::StreamLines_i
+::SetParams(CORBA::Double theIntStep,
+ CORBA::Double thePropogationTime,
+ CORBA::Double theStepLength,
+ VISU::Prs3d_ptr thePrs3d,
+ CORBA::Double thePercents,
+ VISU::StreamLines::Direction theDirection)
{
VISU::Prs3d_i* aPrs3di = NULL;
vtkPointSet* aSource = NULL;
}
-void VISU::StreamLines_i::SetSource(VISU::Prs3d_ptr thePrs3d){
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::SetSource(VISU::Prs3d_ptr thePrs3d)
+{
if(!thePrs3d->_is_nil()){
VISU::Prs3d_i* aPrs3di = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in());
SetSource(aPrs3di);
}
}
-void VISU::StreamLines_i::SetSource(VISU::Prs3d_i* thePrs3d){
+
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::SetSource(VISU::Prs3d_i* thePrs3d)
+{
mySourceEntry = "";
if(thePrs3d){
SALOMEDS::SObject_var aSObject = thePrs3d->GetSObject();
mySourceEntry = aString.in();
}
}
-void VISU::StreamLines_i::SetSource(){
+
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::SetSource()
+{
if(!myStreamLinesPL->GetSource() && mySourceEntry == "") return;
if(myStreamLinesPL->GetSource() == myAppendFilter->GetOutput()) return;
VISU::Prs3d_var aPrs3d = GetSource();
}
-CORBA::Double VISU::StreamLines_i::GetIntegrationStep() {
+//---------------------------------------------------------------
+CORBA::Double
+VISU::StreamLines_i
+::GetIntegrationStep()
+{
return myStreamLinesPL->GetIntegrationStep();
}
-CORBA::Double VISU::StreamLines_i::GetPropagationTime() {
+//---------------------------------------------------------------
+CORBA::Double
+VISU::StreamLines_i
+::GetPropagationTime()
+{
return myStreamLinesPL->GetPropagationTime();
}
-CORBA::Double VISU::StreamLines_i::GetStepLength() {
+//---------------------------------------------------------------
+CORBA::Double
+VISU::StreamLines_i
+::GetStepLength()
+{
return myStreamLinesPL->GetStepLength();
}
-VISU::StreamLines::Direction VISU::StreamLines_i::GetDirection() {
+//---------------------------------------------------------------
+VISU::StreamLines::Direction
+VISU::StreamLines_i
+::GetDirection()
+{
return VISU::StreamLines::Direction(myStreamLinesPL->GetDirection());
}
-VISU::Prs3d_ptr VISU::StreamLines_i::GetSource(){
+//---------------------------------------------------------------
+VISU::Prs3d_ptr
+VISU::StreamLines_i
+::GetSource()
+{
VISU::Prs3d_var aPrs3d;
if(MYDEBUG) MESSAGE("StreamLines_i::GetSource() mySourceEntry = '"<<mySourceEntry<<"'");
if(mySourceEntry != ""){
- SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(mySourceEntry.c_str());
+ SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectID(mySourceEntry.c_str());
CORBA::Object_var anObj = SObjectToObject(aSObject);
if(!CORBA::is_nil(anObj)) aPrs3d = VISU::Prs3d::_narrow(anObj);
}
return aPrs3d._retn();
}
-CORBA::Double VISU::StreamLines_i::GetUsedPoints() {
+//---------------------------------------------------------------
+CORBA::Double
+VISU::StreamLines_i
+::GetUsedPoints()
+{
return myStreamLinesPL->GetUsedPoints();
}
-void VISU::StreamLines_i::DoHook(){
- if(!myPipeLine) myPipeLine = VISU_StreamLinesPL::New();
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::CreatePipeLine()
+{
+ if(!myPipeLine)
+ myPipeLine = VISU_StreamLinesPL::New();
myStreamLinesPL = dynamic_cast<VISU_StreamLinesPL*>(myPipeLine);
- DeformedShape_i::DoHook();
+ TSuperClass::CreatePipeLine();
+}
+
+
+//----------------------------------------------------------------------------
+bool
+VISU::StreamLines_i
+::CheckIsPossible()
+{
+ return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
}
-void VISU::StreamLines_i::Update() {
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::Update()
+{
SetSource();
- VISU::DeformedShape_i::Update();
+ TSuperClass::Update();
}
+//---------------------------------------------------------------
VISU_Actor*
VISU::StreamLines_i
::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
- if(VISU_Actor* anActor = VISU::DeformedShape_i::CreateActor(theIO, true)){
+ if(VISU_Actor* anActor = TSuperClass::CreateActor(theIO, true)){
anActor->SetVTKMapping(true);
SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
int aDispMode = aResourceMgr->integerValue("VISU", "stream_lines_represent", 1);
}
-void VISU::StreamLines_i::UpdateActor(VISU_Actor* theActor) {
- VISU::DeformedShape_i::UpdateActor(theActor);
+//---------------------------------------------------------------
+void
+VISU::StreamLines_i
+::UpdateActor(VISU_Actor* theActor)
+{
+ TSuperClass::UpdateActor(theActor);
}
class VISU_StreamLinesPL;
class vtkAppendFilter;
-namespace VISU{
+namespace VISU
+{
class StreamLines_i : public virtual POA_VISU::StreamLines,
public virtual DeformedShape_i
{
explicit
StreamLines_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const Prs3d_i* theOriginal);
- virtual ~StreamLines_i();
-
- virtual VISU::VISUType GetType() { return VISU::TSTREAMLINES;}
-
- virtual CORBA::Boolean SetParams(CORBA::Double theIntStep,
- CORBA::Double thePropogationTime,
- CORBA::Double theStepLength,
- VISU::Prs3d_ptr thePrs3d,
- CORBA::Double thePercents,
- VISU::StreamLines::Direction theDirection);
- virtual CORBA::Double GetIntegrationStep();
- virtual CORBA::Double GetPropagationTime();
- virtual CORBA::Double GetStepLength();
- virtual CORBA::Double GetUsedPoints();
- virtual VISU::Prs3d_ptr GetSource();
- virtual VISU::StreamLines::Direction GetDirection();
+
+ virtual
+ void
+ SameAs(const Prs3d_i* theOriginal);
+
+ virtual
+ ~StreamLines_i();
+
+ virtual
+ VISU::VISUType GetType()
+ {
+ return VISU::TSTREAMLINES;
+ }
+
+ virtual
+ CORBA::Boolean
+ SetParams(CORBA::Double theIntStep,
+ CORBA::Double thePropogationTime,
+ CORBA::Double theStepLength,
+ VISU::Prs3d_ptr thePrs3d,
+ CORBA::Double thePercents,
+ VISU::StreamLines::Direction theDirection);
+
+ virtual
+ CORBA::Double
+ GetIntegrationStep();
+
+ virtual
+ CORBA::Double
+ GetPropagationTime();
+
+ virtual
+ CORBA::Double
+ GetStepLength();
+
+ virtual
+ CORBA::Double
+ GetUsedPoints();
+
+ virtual
+ VISU::Prs3d_ptr
+ GetSource();
+
+ virtual
+ VISU::StreamLines::Direction
+ GetDirection();
typedef VISU::StreamLines TInterface;
- VISU_StreamLinesPL* GetStreamLinesPL(){ return myStreamLinesPL;}
+ VISU_StreamLinesPL*
+ GetSpecificPL() const
+ {
+ return myStreamLinesPL;
+ }
+
protected:
- virtual void DoHook();
- virtual void SetSource(VISU::Prs3d_ptr thePrs3d);
- virtual void SetSource(VISU::Prs3d_i* thePrs3d);
- virtual void SetSource();
+ //! Extends VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine();
+
+ //! Extends VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
+
+ virtual
+ void
+ SetSource(VISU::Prs3d_ptr thePrs3d);
+
+ virtual
+ void
+ SetSource(VISU::Prs3d_i* thePrs3d);
+
+ virtual
+ void
+ SetSource();
VISU_StreamLinesPL* myStreamLinesPL;
vtkAppendFilter* myAppendFilter;
std::string mySourceEntry;
public:
- static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck = true);
- virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration);
-
- virtual void ToStream(std::ostringstream& theStr);
+ //! Extends VISU_ColoredPrs3d_i::IsPossible
+ static
+ int
+ IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck = true);
+
+ //! Extends VISU_ColoredPrs3d_i::Create
+ virtual
+ Storable*
+ Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber);
+
+ //! Extends VISU_ColoredPrs3d_i::ToStream
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
static const std::string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
- virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ virtual
+ const char*
+ GetComment() const;
- virtual void Update();
+ virtual
+ QString
+ GenerateName();
+ //! Extends VISU_ColoredPrs3d_i::Restore
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
+
+ //! Extends VISU_ColoredPrs3d_i::Update
+ virtual
+ void
+ Update();
+
+ //! Extends VISU_ColoredPrs3d_i::CreateActor
virtual
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
- virtual void UpdateActor(VISU_Actor* theActor);
-
- virtual QString GetSourceEntry() { return QString(mySourceEntry.c_str()); }
+ //! Extends VISU_ColoredPrs3d_i::UpdateActor
+ virtual
+ void
+ UpdateActor(VISU_Actor* theActor);
+
+ virtual
+ QString
+ GetSourceEntry()
+ {
+ return QString(mySourceEntry.c_str());
+ }
};
}
CORBA::Long VISU::Table_i::GetNbRows()
{
SALOMEDS::SObject_var SO = mySObj;
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
if ( !SO->_is_nil() ) {
SALOMEDS::GenericAttribute_var anAttr;
if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
CORBA::Long VISU::Table_i::GetNbColumns()
{
SALOMEDS::SObject_var SO = mySObj;
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
if ( !SO->_is_nil() ) {
SALOMEDS::GenericAttribute_var anAttr;
if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
if(!aCutLines->_is_nil())
pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
}
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
// look for component
if ( !theRestoring ) {
- SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( myStudy );
+ SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
// create SObject and set attributes
QString aComment;
if(pCutLines)
}
}
- string anEntry = CreateAttributes( myStudy,
+ string anEntry = CreateAttributes( GetStudyDocument(),
SO->GetID(),//SComponent->GetID(),
"",
GetID(),
aComment.latin1(),
pCutLines );
// create SObject referenced to real table object
- mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID( anEntry.c_str() ));
+ mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID( anEntry.c_str() ));
if(pCutLines) {
pCutLines->BuildTableOfReal(mySObj);
}
const char* VISU::Table_i::GetTableTitle()
{
SALOMEDS::SObject_var SO = mySObj;
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
SALOMEDS::AttributeTableOfReal_var aReal;
if ( myHRow > 0 && myHRow <= nbRows && myVRow > 0 && myVRow <= nbRows ) {
if ( !theRestoring ) {
// look for component
- SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( myStudy );
+ SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
// create SObject and set attributes
QString aComment;
aComment.sprintf("myComment=%s;myType=%d",GetComment(),VISU::TCURVE);
- string anEntry = CreateAttributes( myStudy,
+ string anEntry = CreateAttributes( GetStudyDocument(),
myTable->GetObjectEntry(),
"",
GetID(),
aComment.latin1(),
true );
// create SObject referenced to real table object
- mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID(anEntry.c_str()));
+ mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID(anEntry.c_str()));
}
return this;
}
CORBA::Boolean VISU::Curve_i::IsValid()
{
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
SALOMEDS::AttributeTableOfReal_var aReal;
{
string title;
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
SALOMEDS::AttributeTableOfReal_var aReal;
{
string title;
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
SALOMEDS::AttributeTableOfReal_var aReal;
{
string units;
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
SALOMEDS::AttributeTableOfReal_var aReal;
{
string units;
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
SALOMEDS::AttributeTableOfReal_var aReal;
{
theHorList = 0; theVerList = 0;
// getting table SObject by it's entry
- SALOMEDS::SObject_var SO = myStudy->FindObjectID(myTable->GetObjectEntry());
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
SALOMEDS::AttributeTableOfInteger_var anInt;
SALOMEDS::AttributeTableOfReal_var aReal;
*/
void VISU::Container_i::AddCurve( Curve_ptr theCurve )
{
- if ( myStudy->_is_nil() )
+ if ( GetStudyDocument()->_is_nil() )
return;
- SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() );
+ SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
if ( mySO->_is_nil() )
return;
PortableServer::POA_ptr aPOA = GetPOA();
Curve_i* pCurve = dynamic_cast<Curve_i*>( aPOA->reference_to_servant( theCurve ) );
if( pCurve ) {
QString entry = pCurve->GetEntry();
- SALOMEDS::SObject_var SO = myStudy->FindObjectID( entry.latin1() );
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID( entry.latin1() );
if ( !SO->_is_nil() && myCurves.find( entry ) == myCurves.end() ) {
myCurves.append( entry );
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::SObject_var newSO = Builder->NewObject( mySO );
Builder->Addreference( newSO, SO );
}
*/
void VISU::Container_i::RemoveCurve( Curve_ptr theCurve )
{
- if ( myStudy->_is_nil() )
+ if ( GetStudyDocument()->_is_nil() )
return;
- SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() );
+ SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
if ( mySO->_is_nil() )
return;
PortableServer::POA_ptr aPOA = GetPOA();
if ( myCurves.find( entry ) != myCurves.end() ) {
// found !!!
myCurves.remove( entry );
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
- SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO );
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+ SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( mySO );
for ( ; CI->More(); CI->Next() ) {
SALOMEDS::SObject_var childSO = CI->Value();
SALOMEDS::SObject_var refSO;
*/
void VISU::Container_i::Clear()
{
- if ( myStudy->_is_nil() )
+ if ( GetStudyDocument()->_is_nil() )
return;
- SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() );
+ SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
if ( mySO->_is_nil() )
return;
QStringList toDelete;
- SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO );
+ SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( mySO );
for ( ; CI->More(); CI->Next() ) {
toDelete.append( CI->Value()->GetID() );
}
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
for ( int i = 0; i < toDelete.count(); i++ ) {
- SALOMEDS::SObject_var SO = myStudy->FindObjectID( toDelete[i].latin1() );
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID( toDelete[i].latin1() );
Builder->RemoveObject( SO );
}
myCurves.clear();
{
if ( !theRestoring ) {
// looking for component
- SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( myStudy );
+ SALOMEDS::SComponent_var SComponent = VISU::FindOrCreateVisuComponent( GetStudyDocument() );
// create SObject and set attributes
QString aComment;
aComment.sprintf("myComment=%s;myType=%d",GetComment(),VISU::TCONTAINER);
- string anEntry = CreateAttributes( myStudy,
+ string anEntry = CreateAttributes( GetStudyDocument(),
SComponent->GetID(),
"",
GetID(),
"",
aComment.latin1(),
true );
- mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID(anEntry.c_str()));
+ mySObj = SALOMEDS::SObject::_duplicate(GetStudyDocument()->FindObjectID(anEntry.c_str()));
}
return this;
}
*/
void VISU::Container_i::Update()
{
- if ( myStudy->_is_nil() )
+ if ( GetStudyDocument()->_is_nil() )
return;
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
- SALOMEDS::SObject_var mySO = myStudy->FindObjectID( GetEntry() );
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
+ SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
SALOMEDS::GenericAttribute_var anAttr;
if ( !mySO->_is_nil() ) {
QStringList toDelete;
int i;
for ( i = 0; i < myCurves.count(); i++ ) {
- SALOMEDS::SObject_var SO = myStudy->FindObjectID( myCurves[i].latin1() );
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID( myCurves[i].latin1() );
if ( !SO->_is_nil() && Builder->FindAttribute( SO, anAttr, "AttributeIOR" ) ) {
// if real Curve Object still exists
- SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO );
+ SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( mySO );
bool bFound = false;
for ( ; CI->More(); CI->Next() ) {
SALOMEDS::SObject_var childSO = CI->Value();
myCurves.remove( toDelete[i] );
}
toDelete.clear();
- SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO );
+ SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( mySO );
for ( ; CI->More(); CI->Next() ) {
SALOMEDS::SObject_var childSO = CI->Value();
SALOMEDS::SObject_var refSO;
}
}
for ( i = 0; i < toDelete.count(); i++ ) {
- SALOMEDS::ChildIterator_var CI = myStudy->NewChildIterator( mySO );
+ SALOMEDS::ChildIterator_var CI = GetStudyDocument()->NewChildIterator( mySO );
for ( ; CI->More(); CI->Next() ) {
SALOMEDS::SObject_var childSO = CI->Value();
if ( toDelete[i] == CI->Value()->GetID() ) {
VISU::Curve_i* VISU::Container_i::GetCurve( CORBA::Long theIndex )
{
if ( theIndex > 0 && theIndex <= myCurves.count() ) {
- SALOMEDS::StudyBuilder_var Builder = myStudy->NewBuilder();
+ SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
SALOMEDS::GenericAttribute_var anAttr;
- SALOMEDS::SObject_var SO = myStudy->FindObjectID( myCurves[ theIndex-1 ].latin1() );
+ SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID( myCurves[ theIndex-1 ].latin1() );
CORBA::Object_var anObject = VISU::SObjectToObject( SO );
if( !CORBA::is_nil( anObject ) ) {
// if real Curve Object exists
#include <vtkProperty.h>
-using namespace VISU;
-using namespace std;
-
#ifdef _DEBUG_
static int MYDEBUG = 0;
#else
static int INCMEMORY = 4+12;
-int VISU::Vectors_i::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck)
+
+//---------------------------------------------------------------
+int
+VISU::Vectors_i
+::IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck)
{
bool aResult = false;
try{
- aResult = DeformedShape_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false);
+ aResult = TSuperClass::IsPossible(theResult,
+ theMeshName,
+ theEntity,
+ theFieldName,
+ theTimeStampNumber,
+ false);
if(isMemoryCheck && aResult){
- float aSize = INCMEMORY*
- theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
+ VISU::Result_i::TInput* anInput = theResult->GetInput();
+ float aSize = anInput->GetTimeStampSize(theMeshName,
+ (VISU::TEntity)theEntity,
+ theFieldName,
+ theTimeStampNumber);
+ aSize *= INCMEMORY;
aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
MESSAGE("Vectors_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
}
return aResult;
}
-
+//---------------------------------------------------------------
int VISU::Vectors_i::myNbPresent = 0;
-QString VISU::Vectors_i::GenerateName() { return VISU::GenerateName("Vectors",myNbPresent++);}
+//---------------------------------------------------------------
+QString
+VISU::Vectors_i
+::GenerateName()
+{
+ return VISU::GenerateName("Vectors",myNbPresent++);
+}
+//---------------------------------------------------------------
const string VISU::Vectors_i::myComment = "VECTORS";
-const char* VISU::Vectors_i::GetComment() const { return myComment.c_str();}
+
+//---------------------------------------------------------------
+const char*
+VISU::Vectors_i
+::GetComment() const
+{
+ return myComment.c_str();
+}
-VISU::Vectors_i::
-Vectors_i(Result_i* theResult,
- bool theAddToStudy) :
- PrsObject_i(theResult->GetStudyDocument()),
+//---------------------------------------------------------------
+VISU::Vectors_i
+::Vectors_i(Result_i* theResult,
+ bool theAddToStudy) :
+ PrsObject_i(SALOMEDS::Study::_nil()),
Prs3d_i(theResult,theAddToStudy),
ColoredPrs3d_i(theResult,theAddToStudy),
ScalarMap_i(theResult,theAddToStudy),
DeformedShape_i(theResult,theAddToStudy),
myVectorsPL(NULL)
-{
-}
+{}
-VISU::Vectors_i::
-Vectors_i(Result_i* theResult,
- SALOMEDS::SObject_ptr theSObject) :
- PrsObject_i(theResult->GetStudyDocument()),
+//---------------------------------------------------------------
+VISU::Vectors_i
+::Vectors_i(Result_i* theResult,
+ SALOMEDS::SObject_ptr theSObject) :
+ PrsObject_i(theSObject->GetStudy()),
Prs3d_i(theResult,theSObject),
ColoredPrs3d_i(theResult,theSObject),
ScalarMap_i(theResult,theSObject),
DeformedShape_i(theResult,theSObject),
myVectorsPL(NULL)
-{
-}
+{}
-void VISU::Vectors_i::SameAs(const VISU::Prs3d_i* theOrigin)
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::SameAs(const VISU::Prs3d_i* theOrigin)
{
TSuperClass::SameAs(theOrigin);
}
-VISU::Storable* VISU::Vectors_i::Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration)
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::Vectors_i
+::Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber)
{
myLineWidth = 1.0;
- return DeformedShape_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+ return TSuperClass::Create(theMeshName,theEntity,theFieldName,theTimeStampNumber);
}
-VISU::Storable* VISU::Vectors_i::Restore(const Storable::TRestoringMap& theMap)
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::Vectors_i
+::Restore(const Storable::TRestoringMap& theMap)
{
TSuperClass::Restore(theMap);
}
-void VISU::Vectors_i::ToStream(std::ostringstream& theStr){
- DeformedShape_i::ToStream(theStr);
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::ToStream(std::ostringstream& theStr)
+{
+ TSuperClass::ToStream(theStr);
Storable::DataToStream( theStr, "myTypeGlyph", int(GetGlyphType()));
Storable::DataToStream( theStr, "myPosGlyph", int(GetGlyphPos()));
}
-VISU::Vectors_i::~Vectors_i(){
+//---------------------------------------------------------------
+VISU::Vectors_i
+::~Vectors_i()
+{
if(MYDEBUG) MESSAGE("Vectors_i::~Vectors_i()");
}
-void VISU::Vectors_i::SetLineWidth(CORBA::Double theWidth) {
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::SetLineWidth(CORBA::Double theWidth)
+{
myLineWidth = theWidth;
}
-CORBA::Double VISU::Vectors_i::GetLineWidth() {
+
+//---------------------------------------------------------------
+CORBA::Double
+VISU::Vectors_i
+::GetLineWidth()
+{
return myLineWidth;
}
-void VISU::Vectors_i::SetGlyphType(VISU::Vectors::GlyphType theType) {
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::SetGlyphType(VISU::Vectors::GlyphType theType)
+{
myVectorsPL->SetGlyphType(VISU_VectorsPL::GlyphType(theType));
}
-VISU::Vectors::GlyphType VISU::Vectors_i::GetGlyphType() {
+
+//---------------------------------------------------------------
+VISU::Vectors::GlyphType
+VISU::Vectors_i
+::GetGlyphType()
+{
return VISU::Vectors::GlyphType(myVectorsPL->GetGlyphType());
}
-void VISU::Vectors_i::SetGlyphPos(VISU::Vectors::GlyphPos thePos) {
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::SetGlyphPos(VISU::Vectors::GlyphPos thePos)
+{
myVectorsPL->SetGlyphPos(VISU_VectorsPL::GlyphPos(thePos));
}
-VISU::Vectors::GlyphPos VISU::Vectors_i::GetGlyphPos() {
+
+//---------------------------------------------------------------
+VISU::Vectors::GlyphPos
+VISU::Vectors_i::GetGlyphPos()
+{
return VISU::Vectors::GlyphPos(myVectorsPL->GetGlyphPos());
}
-void VISU::Vectors_i::DoHook(){
- if(!myPipeLine) myPipeLine = VISU_VectorsPL::New();
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::CreatePipeLine()
+{
+ if(!myPipeLine)
+ myPipeLine = VISU_VectorsPL::New();
myVectorsPL = dynamic_cast<VISU_VectorsPL*>(myPipeLine);
- DeformedShape_i::DoHook();
+ TSuperClass::CreatePipeLine();
}
-VISU_PipeLine* VISU::Vectors_i::GetPipeLine(){
+//---------------------------------------------------------------
+VISU_PipeLine*
+VISU::Vectors_i
+::GetPipeLine()
+{
VISU_PipeLine* aPipeLine = VISU_VectorsPL::New();
aPipeLine->SetIDMapper(myPipeLine->GetIDMapper());
aPipeLine->ShallowCopy(myPipeLine);
}
-VISU_Actor* VISU::Vectors_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+//---------------------------------------------------------------
+bool
+VISU::Vectors_i
+::CheckIsPossible()
+{
+ return IsPossible(GetResult(),GetMeshName(),GetEntity(),GetFieldName(),GetTimeStampNumber());
+}
+
+//---------------------------------------------------------------
+VISU_Actor*
+VISU::Vectors_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
{
VISU_VectorsAct* anActor = VISU_VectorsAct::New();
try{
}
-void VISU::Vectors_i::UpdateActor(VISU_Actor* theActor) {
+//---------------------------------------------------------------
+void
+VISU::Vectors_i
+::UpdateActor(VISU_Actor* theActor)
+{
if(VISU_VectorsAct* anActor = dynamic_cast<VISU_VectorsAct*>(theActor)){
- VISU::DeformedShape_i::UpdateActor(anActor);
+ TSuperClass::UpdateActor(anActor);
anActor->GetProperty()->SetLineWidth(GetLineWidth());
if(VISU_VectorsPL* aVectorsPL = dynamic_cast<VISU_VectorsPL*>(anActor->GetPipeLine())){
aVectorsPL->ShallowCopy(myPipeLine);
class VISU_VectorsPL;
-namespace VISU{
+namespace VISU
+{
class Vectors_i : public virtual POA_VISU::Vectors,
public virtual DeformedShape_i
{
explicit
Vectors_i(Result_i* theResult,
SALOMEDS::SObject_ptr theSObject);
- virtual void SameAs(const Prs3d_i* theOrigin);
- virtual ~Vectors_i();
- virtual VISU::VISUType GetType() { return VISU::TVECTORS;};
+ virtual
+ void
+ SameAs(const Prs3d_i* theOrigin);
+
+ virtual
+ ~Vectors_i();
+
+ virtual
+ VISU::VISUType
+ GetType()
+ {
+ return VISU::TVECTORS;
+ }
+
+ virtual
+ void
+ SetLineWidth(CORBA::Double theWidth);
+
+ virtual
+ CORBA::Double
+ GetLineWidth();
- virtual void SetLineWidth(CORBA::Double theWidth);
- virtual CORBA::Double GetLineWidth();
+ virtual
+ void
+ SetGlyphType(VISU::Vectors::GlyphType theType);
- virtual void SetGlyphType(VISU::Vectors::GlyphType theType);
- virtual VISU::Vectors::GlyphType GetGlyphType();
+ virtual
+ VISU::Vectors::GlyphType
+ GetGlyphType();
+
+ virtual
+ void
+ SetGlyphPos(VISU::Vectors::GlyphPos thePos);
- virtual void SetGlyphPos(VISU::Vectors::GlyphPos thePos);
- virtual VISU::Vectors::GlyphPos GetGlyphPos();
+ virtual
+ VISU::Vectors::GlyphPos
+ GetGlyphPos();
typedef VISU::Vectors TInterface;
- VISU_VectorsPL* GetVectorsPL(){ return myVectorsPL;}
+ VISU_VectorsPL*
+ GetSpecificPL() const
+ {
+ return myVectorsPL;
+ }
+
protected:
- virtual void DoHook();
- virtual VISU_PipeLine* GetPipeLine();
+ //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
+ virtual
+ void
+ CreatePipeLine();
+
+ //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
+ virtual
+ bool
+ CheckIsPossible();
+
+ virtual
+ VISU_PipeLine*
+ GetPipeLine();
VISU_VectorsPL *myVectorsPL;
float myLineWidth;
public:
- static int IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration, int isMemoryCheck = true);
- virtual Storable* Create(const char* theMeshName, VISU::Entity theEntity,
- const char* theFieldName, int theIteration);
+ //! Redefines VISU_ColoredPrs3d_i::IsPossible
+ static
+ int IsPossible(Result_i* theResult,
+ const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber,
+ int isMemoryCheck = true);
+
+ //! Redefines VISU_ColoredPrs3d_i::Create
+ virtual
+ Storable*
+ Create(const char* theMeshName,
+ VISU::Entity theEntity,
+ const char* theFieldName,
+ int theTimeStampNumber);
- virtual void ToStream(std::ostringstream& theStr);
+ //! Redefines VISU_ColoredPrs3d_i::ToStream
+ virtual
+ void
+ ToStream(std::ostringstream& theStr);
- virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+ //! Redefines VISU_ColoredPrs3d_i::Restore
+ virtual
+ Storable*
+ Restore(const Storable::TRestoringMap& theMap);
static const std::string myComment;
- virtual const char* GetComment() const;
- virtual QString GenerateName();
+ //! Redefines VISU_ColoredPrs3d_i::GetComment
+ virtual
+ const char*
+ GetComment() const;
+
+ //! Redefines VISU_ColoredPrs3d_i::GenerateName
+ virtual
+ QString
+ GenerateName();
+
+ //! Redefines VISU_ColoredPrs3d_i::CreateActor
virtual
VISU_Actor*
CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
- virtual void UpdateActor(VISU_Actor* theActor) ;
+ //! Redefines VISU_ColoredPrs3d_i::UpdateActor
+ virtual
+ void
+ UpdateActor(VISU_Actor* theActor) ;
};
}
{
class TEvent: public SALOME_Event
{
- SUIT_ViewWindow* myVW;
+ SUIT_ViewWindow* myViewWindow;
public:
TEvent(SUIT_ViewWindow* theViewWindow):
- myVW(theViewWindow)
+ myViewWindow(theViewWindow)
{}
virtual void Execute()
{
- SVTK_ViewWindow* vf = dynamic_cast<SVTK_ViewWindow*>(myVW);
- vtkRenderer* Renderer = vf->getRenderer();
- vtkActorCollection* theActors = Renderer->GetActors();
- theActors->InitTraversal();
- while (vtkActor *anAct = theActors->GetNextActor()) {
+ SVTK_ViewWindow* aViewWindow = dynamic_cast<SVTK_ViewWindow*>(myViewWindow);
+ vtkRenderer* aRenderer = aViewWindow->getRenderer();
+ vtkActorCollection* anActors = aRenderer->GetActors();
+ anActors->InitTraversal();
+ while (vtkActor *anAct = anActors->GetNextActor()) {
if (VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)) {
VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d();
if (anActor->GetVisibility() && aPrs3d) {
}
}
}
- RepaintView(myVW);
+ RepaintView(myViewWindow);
}
};
- SUIT_ViewWindow* aVW = GetViewWindow();
- if (aVW)
- ProcessVoidEvent(new TEvent(aVW));
+ if (SUIT_ViewWindow* aViewWindow = GetViewWindow())
+ ProcessVoidEvent(new TEvent(aViewWindow));
}
bool View3D_i::SaveViewParams (SUIT_ViewManager* theViewManager, const char* theName)
--- /dev/null
+import os
+import time
+import VISU
+import SALOMEDS
+from batchmode_visu import *
+
+myViewManager = myVisu.GetViewManager();
+
+myView = myViewManager.Create3DView();
+myView.SetTitle("The window will be soon destroyed!")
+
+medFile = "TimeStamps.med"
+myFieldName = "vitesse";
+
+aMeshName ="dom"
+anEntity = VISU.NODE
+aTimeStampId = 1
+
+medFile = os.getenv('DATA_DIR') + '/MedFiles/' + medFile
+myResult = myVisu.ImportFile(medFile)
+
+aPrs3d = myVisu.IsoSurfacesOnField(myResult,aMeshName,anEntity,myFieldName,aTimeStampId)
+
+aPrs3d = myVisu.CreatePrs3d(VISU.TISOSURFACE,myVisu.GetCurrentStudy())
+aPrs3d.SetResultObject(myResult)
+aPrs3d.SetMeshName(aMeshName)
+aPrs3d.SetEntity(anEntity)
+aPrs3d.SetFieldName(myFieldName)
+aPrs3d.SetTimeStampNumber(aTimeStampId)
+print aPrs3d.Apply()
+
+myView.Display(aPrs3d);
+print "myView.Display(aPrs3d)"
+myView.FitAll()
+
+aDelay = 0.0
+for aTimeStampId in xrange(1,100):
+ aPrs3d.SetTimeStampNumber(aTimeStampId)
+ print aPrs3d.Apply()
+ myView.Update();
+ time.sleep(aDelay)