]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
adds IDs mapping
authorpkv <pkv@opencascade.com>
Mon, 29 Aug 2005 11:57:39 +0000 (11:57 +0000)
committerpkv <pkv@opencascade.com>
Mon, 29 Aug 2005 11:57:39 +0000 (11:57 +0000)
src/CONVERTOR/VISU_Convertor.hxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx
src/OBJECT/VISU_Actor.cxx
src/PIPELINE/VISU_PipeLine.cxx
src/PIPELINE/VISU_PipeLine.hxx
src/PIPELINE/VISU_ScalarMapPL.cxx
src/PIPELINE/VISU_ScalarMapPL.hxx

index 718e18ffb8f37db97f2f6ceaeaa02a93c047fbbe..a08fef2b68c09bd50fb7dce9f6941d2c84fb9e74 100644 (file)
@@ -333,7 +333,14 @@ public:
                     const VISU::TEntity& theEntity,
                     const std::string& theFieldName,
                     int theStampsNum) = 0;
-   
+
+  virtual
+  VISU::PProfile 
+  GetProfile(const std::string& theMeshName, 
+            const VISU::TEntity& theEntity,
+            const std::string& theFieldName,
+            int theStampsNum) = 0;
+
   virtual
   TOutput* 
   GetTimeStampOnGaussPts(const std::string& theMeshName, 
index 5183abf49bc9d00c4d6c676f272acbecee3753ad..c81d28275283420e89c10b7d8d910628600f5682 100644 (file)
@@ -1467,6 +1467,22 @@ VISU_Convertor_impl
   return aSource.GetPointer();
 }
 
+//---------------------------------------------------------------
+VISU::PProfile 
+VISU_Convertor_impl::GetProfile(const std::string& theMeshName, 
+                               const VISU::TEntity& theEntity,
+                               const std::string& theFieldName,
+                               int theStampsNum)
+{
+  GetTimeStampOnMesh(theMeshName, theEntity, theFieldName, theStampsNum);
+  TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
+                                               theEntity,
+                                               theFieldName,
+                                               theStampsNum);
+  PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
+  PProfileImpl aProfile = aValForTime->myProfile;
+  return aProfile;
+}
 
 //---------------------------------------------------------------
 VISU_Convertor::TOutput* 
index 64b33f0b115de3695a5aaa5d55d3f359e38f6c51..e57c744588f13e69544c0673fa7b51b859421d9c 100644 (file)
@@ -431,6 +431,13 @@ public:
                     const std::string& theFieldName,
                     int theStampsNum);
   virtual
+  VISU::PProfile 
+  GetProfile(const std::string& theMeshName, 
+            const VISU::TEntity& theEntity,
+            const std::string& theFieldName,
+            int theStampsNum);
+
+  virtual
   TOutput* 
   GetTimeStampOnGaussPts(const std::string& theMeshName, 
                         const VISU::TEntity& theEntity,
index ac8298d3fc4822ccd69b9b6e03281121d150bb5c..072cd704be0b3d00be8525613e4c03db64c20e9c 100644 (file)
@@ -214,11 +214,29 @@ void VISU_Actor::ShallowCopy(vtkProp *prop){
 
 //----------------------------------------------------------------------------
 int VISU_Actor::GetNodeObjId(int theVtkID){
-  if ( myIsShrunk ) 
-    return myShrinkFilter->GetNodeObjId(theVtkID);
-  return theVtkID;
+  vtkIdType aID;
+  //
+  aID=theVtkID;
+  if (myIsShrunk) {
+   aID= myShrinkFilter->GetNodeObjId(theVtkID);
+  }
+  if (myPipeLine) {
+    aID=myPipeLine->GetNodeObjID(aID);
+  }
+  return aID;
 }
 
+//----------------------------------------------------------------------------
 int VISU_Actor::GetElemObjId(int theVtkID){
-  return myGeomFilter->GetElemObjId(theVtkID);
+  vtkIdType aID;
+  //
+  aID=theVtkID;
+  
+  if (myIsShrunk) {
+   aID= myShrinkFilter->GetElemObjId(theVtkID);
+  }
+  if (myPipeLine) {
+    aID=myPipeLine->GetElemObjID(aID);
+  }
+  return aID;
 }
index d670a681c9628bf6bfccf38c7e55871f2591c04e..a13806cc646d0bc5ace4ef34ec9f3b495ab159d1 100644 (file)
@@ -312,3 +312,13 @@ bool VISU_PipeLine::IsPlanarInput() const
 
   return false;
 }
+
+vtkIdType VISU_PipeLine::GetNodeObjID(vtkIdType theVtkID)
+{
+  return myExtractGeometry->GetNodeObjId(theVtkID);
+}
+
+vtkIdType VISU_PipeLine::GetElemObjID(vtkIdType theVtkID)
+{
+  return  myExtractGeometry->GetElemObjId(theVtkID);
+}
index 4dd6db6ea26d3770e796b46295a50c63775051a8..56b7dee4c527833aac5ca5ebd606ae2f7cdc139b 100644 (file)
@@ -101,6 +101,9 @@ public:
 
   bool IsShrinkable() { return myIsShrinkable; }
 
+  virtual vtkIdType GetNodeObjID(vtkIdType theVtkID);
+  virtual vtkIdType GetElemObjID(vtkIdType theVtkID);
+
 protected:
   VISU_PipeLine();
   VISU_PipeLine(const VISU_PipeLine&);
index 473d2de86da3c19e270dfda8a840c7417f71825e..5cc88197c09ae331dda5114ecd6f37eb069380e5 100644 (file)
@@ -133,6 +133,38 @@ void VISU_ScalarMapPL::Init(){
   //SetSourceRange();
 }
 
+void VISU_ScalarMapPL::SetProfile(const VISU::PProfile& theProfile)
+{
+  myProfile=theProfile;
+}
+const VISU::PProfile& VISU_ScalarMapPL::GetProfile()const
+{
+  return myProfile;
+}
+
+vtkIdType VISU_ScalarMapPL::GetNodeObjID(vtkIdType theVtkID)
+{
+  vtkIdType aIDx=-1;
+  //
+  if (!myProfile){
+    return aIDx;
+  }
+  aIDx=VISU_PipeLine::GetNodeObjID(theVtkID);
+  aIDx=myProfile->GetNodeObjID(aIDx);
+  return aIDx;
+}
+
+vtkIdType VISU_ScalarMapPL::GetElemObjID(vtkIdType theVtkID)
+{
+  vtkIdType aIDx=-1;
+  //
+  if (!myProfile){
+    return aIDx;
+  }
+  aIDx=VISU_PipeLine::GetElemObjID(theVtkID);
+  aIDx=myProfile->GetElemObjID(aIDx);
+  return aIDx;
+}
 
 void VISU_ScalarMapPL::Build() {
   myExtractor->SetInput(GetInput2());
index b535828514d01134e177b403d46ca9abec74b8e2..bfdffb22977c665c60d725e2f2ce9affeb50310f 100644 (file)
@@ -31,6 +31,8 @@
 #include "VISU_PipeLine.hxx"
 #include "VISU_ScalarBarActor.hxx"
 
+#include <VISU_Convertor.hxx>
+
 class vtkDataSet;
 
 class VISU_Extractor;
@@ -74,6 +76,12 @@ public:
   virtual void GetSourceRange(float theRange[2]);
   virtual void SetSourceRange();
 
+  virtual vtkIdType GetNodeObjID(vtkIdType theVtkID);
+  virtual vtkIdType GetElemObjID(vtkIdType theVtkID);
+
+  void SetProfile(const VISU::PProfile& theProfile);
+  const VISU::PProfile& GetProfile()const;
+
 protected:
   typedef vtkDataSet THook;
   virtual THook* DoHook();
@@ -81,6 +89,7 @@ protected:
   VISU_LookupTable *myMapperTable, *myBarTable;
   VISU_FieldTransform *myFieldTransform;
   VISU_Extractor* myExtractor;
+  VISU::PProfile myProfile;
 };
   
 #endif