#include "VISU_StreamLines_i.hh"
#include "VISU_Plot3D_i.hh"
#include "VISU_Table_i.hh"
+#include "VISU_PointMap3d_i.hh"
#include "VISU_GaussPoints_i.hh"
#include "VISU_ScalarMapOnDeformedShape_i.hh"
#include "VISU_ColoredPrs3dCache_i.hh"
return thePrefix;
}
-
//---------------------------------------------------------------------------
// declaration
void DumpChildrenToPython(SALOMEDS::Study_ptr theStudy,
theStr<<thePrefix<<"pass"<<endl<<endl;
}
return;
+ case VISU::TPOINTMAP3D:
+ if (PointMap3d_i* aServant = dynamic_cast<PointMap3d_i*>(GetServant(anObj).in())) {
+ CORBA::Short aTag = theSObject->Tag();
+ theStr<<thePrefix<<"anIsFound, aSObject = "<<theArgumentName<<".FindSubObject("<<aTag<<")"<<endl;
+ theStr<<thePrefix<<"if anIsFound:"<<endl;
+ thePrefix += PREFIX;
+
+ theStr<<thePrefix<<"anID = aSObject.GetID()"<<endl;
+ theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
+
+ // Set name (as this object could be renamed by user)
+ theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
+
+ // Set PointMap3D Properties
+
+ theStr<<thePrefix<<aName<<".SetScaleFactor("<<aServant->GetScaleFactor()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetContourPrs("<<aServant->GetIsContourPrs()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetNbOfContours("<<aServant->GetNbOfContours()<<")"<<endl;
+
+ std::string aParam;
+ switch(aServant->GetScaling()){
+ case LINEAR:
+ aParam = "VISU.LINEAR";
+ break;
+ case LOGARITHMIC:
+ aParam = "VISU.LOGARITHMIC";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetScaling("<<aParam<<")"<<endl;
+
+ theStr<<thePrefix<<aName<<".SetNbColors("<<aServant->GetNbColors()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetLabels("<<aServant->GetLabels()<<")"<<endl;
+
+ switch(aServant->GetBarOrientation()){
+ case ColoredPrs3dBase::HORIZONTAL:
+ aParam = "VISU.ColoredPrs3d.HORIZONTAL";
+ break;
+ case ColoredPrs3dBase::VERTICAL:
+ aParam = "VISU.ColoredPrs3d.VERTICAL";
+ break;
+ }
+ theStr<<thePrefix<<aName<<".SetBarOrientation("<<aParam<<")"<<endl;
+
+ if(aServant->IsRangeFixed())
+ theStr<<thePrefix<<aName<<".SetRange("<<aServant->GetMin()<<", "<<aServant->GetMax()<<")"<<endl;
+ else
+ theStr<<thePrefix<<aName<<".SetSourceRange()"<<endl;
+
+ theStr<<thePrefix<<aName<<".SetPosition("<<aServant->GetPosX()<<", "<<aServant->GetPosY()<<")"<<endl;
+ theStr<<thePrefix<<aName<<".SetSize("<<aServant->GetWidth()<<", "<<aServant->GetHeight()<<")"<<endl;
+
+ float dx, dy, dz;
+ aServant->GetOffset(dx, dy, dz);
+ theStr<<thePrefix<<aName<<".SetOffset("<<dx<<", "<<dy<<", "<<dz<<")"<<endl;
+
+
+ theStr<<thePrefix<<endl;
+
+ theArgumentName = aName;
+ DumpChildrenToPython(theStudy,
+ theIsPublished,
+ theIsValidScript,
+ theSObject,
+ theStr,
+ theName2EntryMap,
+ theEntry2NameMap,
+ theArgumentName,
+ thePrefix);
+
+ theStr<<thePrefix<<"pass"<<endl<<endl;
+ }
+ return;
case VISU::TGAUSSPOINTS:
if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
TCreateFromResult aPrsFactory(theSObject, aServant, aName, "GaussPointsOnField", theArgumentName);
#include <boost/bind.hpp>
#ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
#else
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
#endif
//----------------------------------------------------------------
myActorCollection(vtkActorCollection::New()),
myIsActiveState(true)
{
- MESSAGE("PointMap3d_i::PointMap3d_i - "<<this);
+ if(MYDEBUG) MESSAGE("PointMap3d_i::PointMap3d_i - this = "<<this);
SetStudyDocument(theStudy);
mySObj = theStudy->FindObjectID(theObjectEntry);
myOffset[0] = myOffset[1] = myOffset[2] = 0;
*/
VISU::PointMap3d_i::~PointMap3d_i()
{
- MESSAGE("PointMap3d_i::~PointMap3d_i - "<<this);
+ if(MYDEBUG) MESSAGE("PointMap3d_i::~PointMap3d_i - this = "<<this);
}
//----------------------------------------------------------------------------
void VISU::PointMap3d_i::UpdateActor(VISU_ActorBase* theActor)
{
if(VISU_PointMap3dActor* anActor = dynamic_cast<VISU_PointMap3dActor*>(theActor)){
+ Update();
VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
aScalarBar->SetLookupTable(GetSpecificPL()->GetBarTable());
aScalarBar->SetTitle(GetTitle());
ProcessVoidEvent(new VISU::TInvokeSignalEvent(myUpdateActorsSignal));
}
+//----------------------------------------------------------------------------
+void
+VISU::PointMap3d_i
+::Update()
+{
+ if(GetMTime() < myUpdateTime.GetMTime())
+ return;
+
+ if(MYDEBUG) MESSAGE("PointMap3d_i::Update - this = "<<this);
+
+ try{
+ ProcessVoidEvent(new TVoidMemFunEvent<VISU_PipeLine>
+ (GetSpecificPL(), &VISU_PipeLine::Update));
+ myUpdateTime.Modified();
+ }catch(std::exception&){
+ throw;
+ }catch(...){
+ throw std::runtime_error("PointMap3d_i::Update >> unexpected exception was caught!!!");
+ }
+}
+
+//----------------------------------------------------------------------------
+unsigned long int
+VISU::PointMap3d_i
+::GetMTime()
+{
+ unsigned long int aTime = myParamsTime.GetMTime();
+ if( GetSpecificPL() )
+ aTime = std::max(aTime, GetSpecificPL()->GetMTime());
+ return aTime;
+}
+
/*!
Builds presentation of table
*/
myIsActiveState = theState;
}
-unsigned long int VISU::PointMap3d_i::GetMTime ()
-{
- unsigned long int aTime = myParamsTime.GetMTime();
- if( GetSpecificPL() )
- aTime = std::max(aTime, GetSpecificPL()->GetMTime());
- return aTime;
-}
-
void VISU::PointMap3d_i::RemoveActor (VISU_ActorBase* theActor)
{
myActorCollection->RemoveItem(theActor);
virtual void UpdateActor(VISU_ActorBase* thePointMap3dActor);
virtual void UpdateActors();
+ virtual void Update();
+
//----------- override Prs3d methods -----------------------------
//! Move the 3D presentation according to the given offset parameters
// Plot3dBase methods
void SetScaleFactor (CORBA::Double theScaleFactor);
- double GetScaleFactor();
+ CORBA::Double GetScaleFactor();
void SetContourPrs (CORBA::Boolean theIsContourPrs );
- bool GetIsContourPrs();
+ CORBA::Boolean GetIsContourPrs();
void SetNbOfContours (CORBA::Long);
- long GetNbOfContours();
+ CORBA::Long GetNbOfContours();
VISU_DeformedGridPL* GetSpecificPL() const { return myTablePL; }
CORBA::Float myOffset[3];
bool myIsActiveState;
vtkTimeStamp myParamsTime;
+ vtkTimeStamp myUpdateTime;
//Font management
#include "VISU_ConvertorUtils.hxx"
#ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
#else
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
#endif
//----------------------------------------------------------------
// Table Object
VISU::Table_i::Table_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry )
: PrsObject_i(theStudy)
{
+ MESSAGE("Table_i::Table_i - "<<this);
mySObj = theStudy->FindObjectID(theObjectEntry);
myOrientation = VISU::Table::HORIZONTAL;
}
*/
VISU::Table_i::~Table_i()
{
- MESSAGE("Table_i::~Table_i");
+ MESSAGE("Table_i::~Table_i - "<<this);
}
//----------------------------------------------------------------------------