]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
NPAL13444 Compilation error fix
authordmv <dmv@opencascade.com>
Thu, 10 Apr 2008 11:58:24 +0000 (11:58 +0000)
committerdmv <dmv@opencascade.com>
Thu, 10 Apr 2008 11:58:24 +0000 (11:58 +0000)
src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_PointMap3d_i.cc
src/VISU_I/VISU_PointMap3d_i.hh
src/VISU_I/VISU_Table_i.cc

index 5a3eb8a22c44a9e202f00a1daadb41efdfa5dbe6..7b1fd68eac900d3e8e1133566bc53047b445e415 100644 (file)
@@ -39,6 +39,7 @@
 #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"
@@ -731,7 +732,6 @@ namespace VISU
     return thePrefix;
   }
 
-
   //---------------------------------------------------------------------------
   // declaration
   void DumpChildrenToPython(SALOMEDS::Study_ptr theStudy,
@@ -1285,6 +1285,78 @@ namespace VISU
             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);
index a6cf7b63957556b340857ef124e55220c5ae1ff8..08a63604a9d2261b6b3a98748f824015d92b5ef0 100644 (file)
@@ -50,9 +50,9 @@
 #include <boost/bind.hpp>
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 #else
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 #endif
 
 //----------------------------------------------------------------
@@ -82,7 +82,7 @@ VISU::PointMap3d_i::PointMap3d_i( SALOMEDS::Study_ptr theStudy, const char* theO
   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;
@@ -93,7 +93,7 @@ VISU::PointMap3d_i::PointMap3d_i( SALOMEDS::Study_ptr theStudy, const char* theO
 */
 VISU::PointMap3d_i::~PointMap3d_i()
 {
-  MESSAGE("PointMap3d_i::~PointMap3d_i - "<<this);
+  if(MYDEBUG) MESSAGE("PointMap3d_i::~PointMap3d_i - this = "<<this);
 }
 
 //----------------------------------------------------------------------------
@@ -358,6 +358,7 @@ VISU_PointMap3dActor* VISU::PointMap3d_i::CreateActor()
 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());
@@ -411,6 +412,38 @@ VISU::PointMap3d_i
   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
 */
@@ -873,14 +906,6 @@ void VISU::PointMap3d_i::SetActiveState ( bool theState )
   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);
index f3772b92e345b2cc9963aa745dfce1ac905d682d..99f55d2b2ed42344f7aec48b029843447ef3af9a 100644 (file)
@@ -67,6 +67,8 @@ namespace VISU
     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
@@ -125,13 +127,13 @@ namespace VISU
     // 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; }
 
@@ -214,6 +216,7 @@ namespace VISU
     CORBA::Float             myOffset[3];
     bool                     myIsActiveState;
     vtkTimeStamp             myParamsTime;
+    vtkTimeStamp             myUpdateTime;
 
 
     //Font management
index 4ece6b612728cd4e2cd664c853e22406fcb22402..74bdb5aff6ae8ac7a81ef2e3560a29814b8dc4a2 100644 (file)
@@ -37,9 +37,9 @@
 #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
@@ -66,6 +66,7 @@ const char* VISU::Table_i::GetComment() const
 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;
 }
@@ -74,7 +75,7 @@ VISU::Table_i::Table_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry
 */
 VISU::Table_i::~Table_i()
 {
-  MESSAGE("Table_i::~Table_i");
+  MESSAGE("Table_i::~Table_i - "<<this);
 }
 
 //----------------------------------------------------------------------------