]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
OCCT dev compatibility
authorvsr <vsr@opencascade.com>
Tue, 28 Apr 2015 16:55:03 +0000 (19:55 +0300)
committervsr <vsr@opencascade.com>
Tue, 28 Apr 2015 16:55:03 +0000 (19:55 +0300)
src/OCCViewer/CMakeLists.txt
src/OCCViewer/OCCViewer_CubeAxesDlg.cxx

index eefdd3f503f7d6d9127130344fd87cf2552884a1..975d3b8ad214dd8a0b7947c4036945d92400276d 100755 (executable)
@@ -41,6 +41,11 @@ INCLUDE_DIRECTORIES(
 # additional preprocessor / compiler flags
 ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS})
 
+# VSR: TEMPORARY, to be removed
+IF(OCCT_DEV_COMPAT)
+ADD_DEFINITIONS(-DOCCT_DEV_COMPAT)
+ENDIF(OCCT_DEV_COMPAT)
+
 # libraries to link to
 SET(_link_LIBRARIES
   ${OPENGL_LIBRARIES} ${QT_LIBRARIES} ${CAS_KERNEL} ${CAS_VIEWER} ${CAS_TKGeomAlgo}
index fa66a70546057c25d47c9d3377c55816ff85f990..107824adbc8a93fd31cc0e905bc4e1f5a850bb42 100644 (file)
@@ -265,6 +265,35 @@ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView )
     int aGap = 20;
 
 #if OCC_VERSION_LARGE > 0x06080000
+#ifdef OCCT_DEV_COMPAT // VSR: temporarily, to be removed later and replace below implementation
+    Graphic3d_GraduatedTrihedron gt;
+    // main params
+    gt.SetDrawGrid(Standard_True);       // to draw grid
+    gt.SetDrawAxes(Standard_True);       // to draw axes
+    gt.SetGridColor(Quantity_NOC_WHITE); // grid color
+    // axes params
+    for ( int i = 0; i < 3; i++ ) {
+      Graphic3d_AxisAspect& aspect = gt.ChangeAxisAspect(i);
+      aspect.SetName(anAxisData[i].Name.toLatin1().constData());
+      aspect.SetDrawName(anAxisData[i].DrawName);
+      aspect.SetDrawValues(anAxisData[i].DrawValues);
+      aspect.SetDrawTickmarks(anAxisData[i].DrawTickmarks);
+      aspect.SetNameColor(Quantity_Color(anAxisData[i].NameColor.redF(),
+                                         anAxisData[i].NameColor.greenF(),
+                                         anAxisData[i].NameColor.blueF(),
+                                         Quantity_TOC_RGB));
+      aspect.SetColor(Quantity_Color(anAxisData[i].Color.redF(),
+                                     anAxisData[i].Color.greenF(),
+                                     anAxisData[i].Color.blueF(),
+                                     Quantity_TOC_RGB));
+      aspect.SetTickmarksNumber(anAxisData[i].NbValues-1);
+      aspect.SetTickmarksLength(anAxisData[i].TickmarkLength);
+      aspect.SetValuesOffset(anAxisData[i].Offset);
+      aspect.SetNameOffset(anAxisData[i].Offset + aGap); // see above
+    }
+    // draw trihedron
+    theView->GraduatedTrihedronDisplay(gt);
+#else // #ifdef OCCT_DEV_COMPAT / VSR: temporarily, to be removed later and replace below implementation
     Graphic3d_GraduatedTrihedron gt;
     // main params
     gt.SetToDrawTickmarks(Standard_True);  // to draw grid
@@ -323,6 +352,7 @@ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView )
     gt.ChangeZAxisAspect().SetNameOffset(anAxisData[2].Offset + aGap); // see above
     // draw trihedron
     theView->GraduatedTrihedronDisplay(gt);
+#endif // #ifdef OCCT_DEV_COMPAT / VSR: temporarily, to be removed later and replace below implementation
 #else
     theView->GraduatedTrihedronDisplay(
       anAxisData[0].Name.toLatin1().constData(),