]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
PAL10147: Impossible to create groups and families presentations - two different...
authorjfa <jfa@opencascade.com>
Wed, 5 Oct 2005 10:08:47 +0000 (10:08 +0000)
committerjfa <jfa@opencascade.com>
Wed, 5 Oct 2005 10:08:47 +0000 (10:08 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Mesh_i.hh

index a039ad746114f5920828dfefe1585f08b35f8b9b..531e792da260a1ecb8c6c9cf50aa5ece771ceb47 100644 (file)
@@ -232,41 +232,55 @@ static int ComputeVisiblePropBounds(VTKViewer_ViewFrame* theViewFrame, float all
   return nothingVisible;
 }
 
-VisuGUI::CameraOrient VisuGUI::SetFitAll(VTKViewer_ViewFrame* theViewFrame){ 
+VisuGUI::CameraOrient VisuGUI::SetFitAll(VTKViewer_ViewFrame* theViewFrame)
+{
   static float PRECISION = 0.000001;
   static float DEVIATION = 600;
   float XYZ_Bnd[6];
-  if(ComputeVisiblePropBounds(theViewFrame,XYZ_Bnd)) return e3D;
+  if (ComputeVisiblePropBounds(theViewFrame,XYZ_Bnd)) return e3D;
 
   float absX = XYZ_Bnd[1]-XYZ_Bnd[0];
+
   float absY = XYZ_Bnd[3]-XYZ_Bnd[2];
-  
+
   float absZ = XYZ_Bnd[5]-XYZ_Bnd[4];
-  
+
   CameraOrient aCameraOrient = e3D;
-  if(absX <= PRECISION) aCameraOrient = eFront;
-  else {if(absY <= PRECISION) aCameraOrient = eLeft;
-  else {if(absZ <= PRECISION) aCameraOrient = eTop;}}
-  
-    float dev_abs_XY = absX / absY;
-    float dev_abs_YZ = absY / absZ;
-    float dev_abs_XZ = absX / absZ;
-    if(dev_abs_XY >= DEVIATION || 1./dev_abs_YZ >= DEVIATION) aCameraOrient = eLeft;
-    else{if(1./dev_abs_XY >= DEVIATION || 1./dev_abs_XZ >= DEVIATION) aCameraOrient = eFront; 
-    else {if(dev_abs_XZ >= DEVIATION || dev_abs_YZ >= DEVIATION) aCameraOrient = eTop;}}  
-  switch(aCameraOrient){
+  if (absX <= PRECISION) aCameraOrient = eFront;
+  else {
+    if (absY <= PRECISION) aCameraOrient = eLeft;
+    else {
+      if (absZ <= PRECISION) aCameraOrient = eTop;
+      else {
+        // all the three dimensions exceeds precision
+        float dev_abs_XY = absX / absY;
+        float dev_abs_YZ = absY / absZ;
+        float dev_abs_XZ = absX / absZ;
+        if (dev_abs_XY >= DEVIATION || 1./dev_abs_YZ >= DEVIATION)
+          aCameraOrient = eLeft;
+        else {
+          if (1./dev_abs_XY >= DEVIATION || 1./dev_abs_XZ >= DEVIATION)
+            aCameraOrient = eFront;
+          else {
+            if (dev_abs_XZ >= DEVIATION || dev_abs_YZ >= DEVIATION)
+              aCameraOrient = eTop;
+          }
+        }
+      }
+    }
+  }
+
+  switch (aCameraOrient) {
   case eFront: theViewFrame->onViewFront();  break;
   case eLeft:  theViewFrame->onViewLeft();   break;
   case eTop:   theViewFrame->onViewTop();    break;
-  case e3D:    theViewFrame->onViewReset();  break; 
+  case e3D:    theViewFrame->onViewReset();  break;
   }
   theViewFrame->getRenderer()->ResetCameraClippingRange();
   theViewFrame->onViewFitAll();
   return aCameraOrient;
 }
+
 QAD_Desktop* VisuGUI::GetDesktop(){
   return QAD_Application::getDesktop() ;
 }
index 27b69a654d6ad5ccac9a8c60d5a413c0214aa422..71a45766dc3688383730cf9ea1b8694e68f4f180 100644 (file)
@@ -98,7 +98,8 @@ int VISU::Mesh_i::IsPossible(Result_i* theResult, const char* theMeshName, Entit
 
 VISU::Storable* VISU::Mesh_i::Create(const char* theMeshName, Entity theEntity, const char* theFamilyName){
   myMeshName = theMeshName;
-  myEntity = VISU::TEntity(theEntity);
+  //jfa PAL10147:myEntity = VISU::TEntity(theEntity);
+  myEntity = int(theEntity);//jfa PAL10147
   mySubMeshName = theFamilyName;
   return Build(false);
 }
@@ -121,9 +122,11 @@ int VISU::Mesh_i::IsPossible(Result_i* theResult, const char* theMeshName, const
 }
 
 
-VISU::Storable* VISU::Mesh_i::Create(const char* theMeshName, const char* theGroupName){
+VISU::Storable* VISU::Mesh_i::Create(const char* theMeshName, const char* theGroupName)
+{
   myMeshName = theMeshName;
-  myEntity = VISU::TEntity(-1);
+  //jfa PAL10147:myEntity = VISU::TEntity(-1);
+  myEntity = -1;//jfa PAL10147
   mySubMeshName = theGroupName;
   return Build(false);
 }
@@ -134,7 +137,8 @@ VISU::Storable* VISU::Mesh_i::Restore(const Storable::TRestoringMap& theMap)
   Prs3d_i::Restore(theMap);
 
   myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
-  myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
+  //jfa PAL10147:myEntity = (VISU::TEntity)VISU::Storable::FindValue(theMap,"myEntity").toInt();
+  myEntity = VISU::Storable::FindValue(theMap,"myEntity").toInt();//jfa PAL10147
   mySubMeshName = VISU::Storable::FindValue(theMap,"mySubMeshName").latin1();
 
   myPresentType = VISU::PresentationType(VISU::Storable::FindValue(theMap,"myPresentType").toInt());
@@ -196,7 +200,8 @@ VISU::Storable* VISU::Mesh_i::Build(int theRestoring){
       myNodeColor.R = myNodeColor.G = 1.0;  myNodeColor.B = 1.0;
       myLinkColor.R = myLinkColor.G = myLinkColor.B = 83/255.;
     }
-    if(int(myEntity) >= 0) 
+    //jfa PAL10147:if(int(myEntity) >= 0) 
+    if(myEntity >= 0) //jfa PAL10147
       if(mySubMeshName == "") 
        myType = VISU::TENTITY; 
       else 
@@ -209,12 +214,15 @@ VISU::Storable* VISU::Mesh_i::Build(int theRestoring){
     VISU_Convertor::TOutput *anOutput;
     switch(myType){
     case VISU::TENTITY : 
-      anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,myEntity);
+      //jfa PAL10147:anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,myEntity);
+      anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity);//jfa PAL10147
       aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d",
                       VISU::TENTITY,myMeshName.c_str(),myEntity);
       break;
     case VISU::TFAMILY : 
-      anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,myEntity,mySubMeshName);
+      //jfa PAL10147:anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,myEntity,mySubMeshName);
+      anOutput = myResult->GetInput()->GetMeshOnEntity
+        (myMeshName,(VISU::TEntity)myEntity,mySubMeshName);//jfa PAL10147
       aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
                       VISU::TFAMILY,myMeshName.c_str(),myEntity,mySubMeshName.c_str());
       break;
index ebed10ace9222dd38d02bb1e4bab4a4661b6aee9..6593658da6f7641249e1a5da105cb8ca8e01164a 100644 (file)
@@ -71,7 +71,7 @@ namespace VISU{
     VISU_MeshPL* myMeshPL;
 
     string myMeshName;
-    TEntity myEntity;
+    int myEntity;//jfa PAL10147: TEntity myEntity;
     string mySubMeshName;
     VISU::VISUType myType;