0021189: Clean up KAS:dev:ros and Products
authorbugmaster <bugmaster@opencascade.com>
Tue, 9 Oct 2012 12:29:43 +0000 (16:29 +0400)
committerbugmaster <bugmaster@opencascade.com>
Tue, 9 Oct 2012 12:29:43 +0000 (16:29 +0400)
VoxelDemo is modified to be compliant with OCC 6.5.4
Update of environment files and VS projects.

samples/qt/VoxelDemo/VoxelDemo-vc9.sln [moved from samples/qt/VoxelDemo/VoxelDemo.sln with 90% similarity]
samples/qt/VoxelDemo/VoxelDemo.vcproj
samples/qt/VoxelDemo/inc/Viewer.h
samples/qt/VoxelDemo/inc/VoxelClient_VisDrawer.h
samples/qt/VoxelDemo/msvc.bat
samples/qt/VoxelDemo/run.bat [new file with mode: 0644]
samples/qt/VoxelDemo/src/Application.cpp
samples/qt/VoxelDemo/src/Viewer.cpp
samples/qt/VoxelDemo/src/VoxelClient_VisDrawer.cxx

similarity index 90%
rename from samples/qt/VoxelDemo/VoxelDemo.sln
rename to samples/qt/VoxelDemo/VoxelDemo-vc9.sln
index 1e5a741..fabee77 100644 (file)
@@ -1,6 +1,6 @@
 \feff
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VoxelDemo", "VoxelDemo.vcproj", "{EF9DFAE9-E10E-42D4-87D1-52431728AFDF}"
 EndProject
 Global
index 538b89c..1745563 100644 (file)
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="windows-1251"?>
 <VisualStudioProject
        ProjectType="Visual C++"
-       Version="8,00"
+       Version="9.00"
        Name="VoxelDemo"
        ProjectGUID="{EF9DFAE9-E10E-42D4-87D1-52431728AFDF}"
        RootNamespace="VoxelDemo"
        Keyword="Win32Proj"
+       TargetFrameworkVersion="131072"
        >
        <Platforms>
                <Platform
@@ -40,7 +41,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="$(CSF_OPT_INC);.\inc"
+                               AdditionalIncludeDirectories=".\inc;$(CSF_OPT_INC)"
                                PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;WNT"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
@@ -66,6 +67,8 @@
                                AdditionalLibraryDirectories="$(CSF_OPT_LIB32D)"
                                GenerateDebugInformation="true"
                                SubSystem="1"
+                               RandomizedBaseAddress="1"
+                               DataExecutionPrevention="0"
                                TargetMachine="1"
                        />
                        <Tool
@@ -87,9 +90,6 @@
                                Name="VCAppVerifierTool"
                        />
                        <Tool
-                               Name="VCWebDeploymentTool"
-                       />
-                       <Tool
                                Name="VCPostBuildEventTool"
                        />
                </Configuration>
                                SubSystem="1"
                                OptimizeReferences="2"
                                EnableCOMDATFolding="2"
+                               RandomizedBaseAddress="1"
+                               DataExecutionPrevention="0"
                                TargetMachine="1"
                        />
                        <Tool
                                Name="VCAppVerifierTool"
                        />
                        <Tool
-                               Name="VCWebDeploymentTool"
-                       />
-                       <Tool
                                Name="VCPostBuildEventTool"
                        />
                </Configuration>
                                        >
                                        <Tool
                                                Name="VCCustomBuildTool"
-                                               CommandLine="moc.exe inc\$(InputFileName) -o moc\moc_$(InputName).cpp"
+                                               CommandLine="moc.exe inc\$(InputFileName) -o moc\moc_$(InputName).cpp&#x0D;&#x0A;"
                                                Outputs="moc\moc_$(InputName).cpp"
                                        />
                                </FileConfiguration>
                                        >
                                        <Tool
                                                Name="VCCustomBuildTool"
-                                               CommandLine="moc.exe inc\$(InputFileName) -o moc\moc_$(InputName).cpp"
+                                               CommandLine="moc.exe inc\$(InputFileName) -o moc\moc_$(InputName).cpp&#x0D;&#x0A;"
                                                Outputs="moc\moc_$(InputName).cpp"
                                        />
                                </FileConfiguration>
index ee57227..41c8f2d 100644 (file)
@@ -8,7 +8,9 @@
 #include <QWidget.h>
 
 #include <AIS_InteractiveContext.hxx>
+#include <OpenGl_GraphicDriver.hxx>
 #include <V3d_View.hxx>
+#include <OpenGl_View.hxx>
 
 #include <Voxel_Prs.hxx>
 #include <Voxel_Selector.hxx>
@@ -25,6 +27,7 @@ public:
 
        Handle(AIS_InteractiveContext) getIC() const { return myIC; }
        Handle(V3d_View) getView() const { return myView; }
+    Handle(OpenGl_GraphicDriver) getGraphicDriver() const { return myGraphicDriver; }
     Voxel_Selector& getSelector() { return mySelector; }
     void setPrs(const Handle(Voxel_Prs)& prs) { myPrs = prs; }
        virtual QPaintEngine*          paintEngine() const;
@@ -47,6 +50,7 @@ protected:
 private:
        Handle(AIS_InteractiveContext) myIC;
        Handle(V3d_View)               myView;
+    Handle(OpenGl_GraphicDriver)   myGraphicDriver;
 
        bool myRotate;
        bool myZoom;
index cb89ac2..a36cca9 100644 (file)
@@ -24,6 +24,8 @@
 #include "Voxel_VisData.h"
 #include <Graphic3d_CBounds.hxx>
 
+class Handle(OpenGl_GraphicDriver);
+
 class VoxelClient_VisDrawer
 {
 public:
@@ -32,7 +34,7 @@ public:
 
 public:
 
-    Standard_EXPORT static void Init();
+  Standard_EXPORT static void Init (Handle(OpenGl_GraphicDriver)& theDriver);
 
        Standard_EXPORT VoxelClient_VisDrawer(Voxel_VisData* theData);
        Standard_EXPORT virtual ~VoxelClient_VisDrawer();
index fc42168..a5b3b6c 100644 (file)
@@ -1,6 +1,4 @@
-set CASROOT=D:\OCC653\ros
-set QTDIR=D:\qt\4.8.2
-set PATH=%QTDIR%\bin;%PATH%
+call ../../../env.bat %1 %2 %3
 
-call %CASROOT%/env.bat %1 %2 %3
-call %CASROOT%/msvc.bat %1 %2 %3 VoxelDemo.sln
+if not ["%CASDEB%"] == [""] call ../../../msvc.bat %VCVER% win%ARCH% %CASDEB% VoxelDemo-%VCVER%.sln
+if ["%CASDEB%"] == [""] call ../../../msvc.bat %VCVER% win%ARCH% "" VoxelDemo-%VCVER%.sln
\ No newline at end of file
diff --git a/samples/qt/VoxelDemo/run.bat b/samples/qt/VoxelDemo/run.bat
new file mode 100644 (file)
index 0000000..33b0b79
--- /dev/null
@@ -0,0 +1,22 @@
+call ../../../env.bat %1 %2 %3
+
+IF not "%CASDEB%" EQU "" (
+SET BIN_DIR=Debug
+) ELSE (
+SET BIN_DIR=Release
+)
+
+if not exist "%BIN_DIR%\VoxelDemo.exe" goto ERR_EXE
+
+echo Starting VoxelDemo .....
+start /D "%BIN_DIR%" VoxelDemo.exe
+
+goto END
+
+:ERR_EXE
+echo Executable %BIN_DIR%\VoxelDemo.exe not found."
+echo Probably you didn't compile the application.
+pause
+goto END
+
+:END
\ No newline at end of file
index c4379b0..0a1ae07 100644 (file)
@@ -319,7 +319,7 @@ Application::Application()
     myDisplayedZMin = -DBL_MAX;
     myDisplayedZMax =  DBL_MAX;
 
-       VoxelClient_VisDrawer::Init();
+       VoxelClient_VisDrawer::Init(myViewer->getGraphicDriver());
 
     resize( 450, 600 );
 }
index d0304bf..9008c07 100644 (file)
@@ -19,9 +19,15 @@ static Handle(Graphic3d_WNTGraphicDevice) device;
 Viewer::Viewer(QWidget* parent):QWidget(parent)
 {
     if(device.IsNull())
+    {
         device = new Graphic3d_WNTGraphicDevice();
+        if (!device->GraphicDriver().IsNull())
+        {
+            myGraphicDriver = Handle(OpenGl_GraphicDriver)::DownCast(device->GraphicDriver());
+        }
+    }
     
-               Handle(V3d_Viewer) aViewer = new V3d_Viewer(device, TCollection_ExtendedString("Visu3D").ToExtString(), "",
+       Handle(V3d_Viewer) aViewer = new V3d_Viewer(device, TCollection_ExtendedString("Visu3D").ToExtString(), "",
                                                 1000, V3d_XposYnegZpos,
                                                 Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, V3d_WAIT,
                                                 true, true, V3d_TEX_NONE);
index e75fbc7..88497ec 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <InterfaceGraphic_telem.hxx>
 #include <OpenGl_Element.hxx>
-#include <OpenGl_Callback.hxx>
+#include <OpenGl_GraphicDriver.hxx>
 #include <OpenGl_NamedStatus.hxx>
 
 #include <GL/gl.h>
@@ -46,6 +46,11 @@ public:
 
   void Render (const Handle(OpenGl_Workspace) &theWorkspace) const;
 
+  virtual void Release (const Handle(OpenGl_Context)& theContext)
+  {
+    //
+  }
+
 private:
 
   VoxelClient_VisDrawer* myHandler;
@@ -126,16 +131,14 @@ static OpenGl_Element* VisDrawerCallBack (const Graphic3d_CUserDraw* theUserDraw
 }
 
 /**************************************************************************/
-void VoxelClient_VisDrawer::Init()
+void VoxelClient_VisDrawer::Init (Handle(OpenGl_GraphicDriver)& theDriver)
 {
     static Standard_Boolean isInitializeded(Standard_False);
 
     if (!isInitializeded)
     {
         isInitializeded = Standard_True;
-
-        OpenGl_UserDrawCallback& aCallback = UserDrawCallback ();
-        aCallback = VisDrawerCallBack;
+        theDriver->UserDrawCallback() = VisDrawerCallBack;
     }
 }