From 89a929ea26e11861b956ebd80f92804e834b6d4b Mon Sep 17 00:00:00 2001 From: kgv Date: Wed, 3 Aug 2016 22:08:01 +0300 Subject: [PATCH] 0027750: Visualization, V3d_View - remove unused functionality ZClipping and ZCueing Methods V3d_View::SetZClippingType(), ::SetZClippingDepth(), ::SetZClippingWidth(), ::SetZCueingDepth(), ::SetZCueingWidth(), ::SetZCueingOn(), ::SetZCueingOff() have been removed. --- dox/dev_guides/upgrade/upgrade.md | 2 + .../modeling_algos/modeling_algos.md | 1 - .../visualization/visualization.md | 5 +- .../mfc/standard/04_Viewer3d/CMakeLists.txt | 6 +- .../04_Viewer3d/adm/win/vc10/Viewer3d.vcxproj | 38 --- .../adm/win/vc10/Viewer3d.vcxproj.filters | 12 - .../04_Viewer3d/adm/win/vc11/Viewer3d.vcxproj | 38 --- .../adm/win/vc11/Viewer3d.vcxproj.filters | 12 - .../04_Viewer3d/adm/win/vc12/Viewer3d.vcxproj | 38 --- .../adm/win/vc12/Viewer3d.vcxproj.filters | 12 - .../04_Viewer3d/adm/win/vc14/Viewer3d.vcxproj | 38 --- .../adm/win/vc14/Viewer3d.vcxproj.filters | 12 - .../mfc/standard/04_Viewer3d/res/Toolbar.bmp | Bin 7318 -> 6918 bytes .../mfc/standard/04_Viewer3d/res/Viewer3d.rc | 41 ---- .../mfc/standard/04_Viewer3d/res/resource.h | 14 -- .../standard/04_Viewer3d/src/Viewer3dView.cpp | 18 -- .../standard/04_Viewer3d/src/Viewer3dView.h | 2 - .../standard/04_Viewer3d/src/ZClippingDlg.cpp | 195 ---------------- .../standard/04_Viewer3d/src/ZClippingDlg.h | 60 ----- .../standard/04_Viewer3d/src/ZCueingDlg.cpp | 204 ---------------- .../mfc/standard/04_Viewer3d/src/ZCueingDlg.h | 59 ----- samples/mfc/standard/Common/OCC_2dView.cpp | 1 - src/Graphic3d/Graphic3d_CView.cxx | 7 - src/Graphic3d/Graphic3d_CView.hxx | 42 ---- src/OpenGl/OpenGl_Clipping.cxx | 19 +- src/OpenGl/OpenGl_Clipping.hxx | 39 +--- src/OpenGl/OpenGl_GraphicDriver.cxx | 3 +- src/OpenGl/OpenGl_ShaderManager.cxx | 43 ++-- src/OpenGl/OpenGl_ShaderProgram.cxx | 1 - src/OpenGl/OpenGl_ShaderProgram.hxx | 1 - src/OpenGl/OpenGl_View.cxx | 11 - src/OpenGl/OpenGl_View.hxx | 76 ------ src/OpenGl/OpenGl_View_Redraw.cxx | 90 +------ src/Shaders/Declarations.glsl | 5 - src/Shaders/PhongShading.fs | 15 +- src/V3d/FILES | 2 - src/V3d/V3d_TypeOfZclipping.hxx | 34 --- src/V3d/V3d_View.cxx | 6 - src/V3d/V3d_View.hxx | 36 --- src/V3d/V3d_View_1.cxx | 205 ---------------- src/ViewerTest/ViewerTest_ViewerCommands.cxx | 220 +----------------- tests/bugs/vis/bug270_1 | 26 --- tests/bugs/vis/bug270_2 | 26 --- 43 files changed, 30 insertions(+), 1685 deletions(-) delete mode 100755 samples/mfc/standard/04_Viewer3d/src/ZClippingDlg.cpp delete mode 100755 samples/mfc/standard/04_Viewer3d/src/ZClippingDlg.h delete mode 100755 samples/mfc/standard/04_Viewer3d/src/ZCueingDlg.cpp delete mode 100755 samples/mfc/standard/04_Viewer3d/src/ZCueingDlg.h delete mode 100644 src/V3d/V3d_TypeOfZclipping.hxx delete mode 100644 src/V3d/V3d_View_1.cxx delete mode 100755 tests/bugs/vis/bug270_1 delete mode 100755 tests/bugs/vis/bug270_2 diff --git a/dox/dev_guides/upgrade/upgrade.md b/dox/dev_guides/upgrade/upgrade.md index 3dcab3388a..019975b10c 100644 --- a/dox/dev_guides/upgrade/upgrade.md +++ b/dox/dev_guides/upgrade/upgrade.md @@ -1028,3 +1028,5 @@ The following obsolete features have been removed: * Obsolete Antialiasing API V3d_View::SetAntialiasingOn(). This method was intended to activate deprecated OpenGL functionality (GL_POLYGON_SMOOTH, GL_LINE_SMOOTH, GL_POINT_SMOOTH). Instead of old API, application should request MSAA buffers for antialiasing by assigning Graphic3d_RenderingParams::NbMsaaSamples property of structure returned by V3d_View::ChangeRenderingParams(). * Prs3d_Drawer::ShadingAspectGlobal() flag has been removed as not used. Corresponding calls can be removed safely from the application code. +* ZClipping planes and ZCueing (methods V3d_View::SetZClippingType(), ::SetZCueingOn() and V3d_View::others). + ZClipping planes can be replaced by general-purpose clipping planes (application should update plane definion manually). diff --git a/dox/user_guides/modeling_algos/modeling_algos.md b/dox/user_guides/modeling_algos/modeling_algos.md index b745b7b21d..86104e9090 100644 --- a/dox/user_guides/modeling_algos/modeling_algos.md +++ b/dox/user_guides/modeling_algos/modeling_algos.md @@ -2724,7 +2724,6 @@ No smoothing algorithm is provided. Consequently, a polyhedron will be treated However, there some restrictions in HLR use: * Points are not processed; - * Z-clipping planes are not used; * Infinite faces or lines are not processed. diff --git a/dox/user_guides/visualization/visualization.md b/dox/user_guides/visualization/visualization.md index 86d3a78315..07c22067f4 100644 --- a/dox/user_guides/visualization/visualization.md +++ b/dox/user_guides/visualization/visualization.md @@ -1484,7 +1484,6 @@ For more details on the algorithm and examples of usage, please, refer to @ref o @subsection occt_visu_4_1 Glossary of 3D terms * **Anti-aliasing** This mode attempts to improve the screen resolution by drawing lines and curves in a mixture of colors so that to the human eye the line or curve is smooth. The quality of the result is linked to the quality of the algorithm used by the workstation hardware. -* **Depth-cueing** Reduces the color intensity for the portion of an object further away from the eye to give the impression of depth. This is used for wireframe objects. Shaded objects do not require this. * **Group** -- a set of primitives and attributes on those primitives. Primitives and attributes may be added to a group but cannot be removed from it, unless erased globally. A group can have a pick identity. * **Light** There are five kinds of light source -- ambient, headlight, directional, positional and spot. The light is only activated in a shading context in a view. * **Primitive** -- a drawable element. It has a definition in 3D space. Primitives can either be lines, faces, text, or markers. Once displayed markers and text remain the same size. Lines and faces can be modified e.g. zoomed. Primitives must be stored in a group. @@ -1847,13 +1846,13 @@ The *Aspect* package provides classes for the graphic elements in the viewer: The *V3d* package provides the resources to define a 3D viewer and the views attached to this viewer (orthographic, perspective). This package provides the commands to manipulate the graphic scene of any 3D object visualized in a view on screen. -A set of high-level commands allows the separate manipulation of parameters and the result of a projection (Rotations, Zoom, Panning, etc.) as well as the visualization attributes (Mode, Lighting, Clipping, Depth-cueing, etc.) in any particular view. +A set of high-level commands allows the separate manipulation of parameters and the result of a projection (Rotations, Zoom, Panning, etc.) as well as the visualization attributes (Mode, Lighting, Clipping, etc.) in any particular view. The *V3d* package is basically a set of tools directed by commands from the viewer front-end. This tool set contains methods for creating and editing classes of the viewer such as: * Default parameters of the viewer, * Views (orthographic, perspective), * Lighting (positional, directional, ambient, spot, headlight), - * Clipping planes (note that only Z-clipping planes can work with the Phigs interface), + * Clipping planes, * Instantiated sequences of views, planes, light sources, graphic structures, and picks, * Various package methods. diff --git a/samples/mfc/standard/04_Viewer3d/CMakeLists.txt b/samples/mfc/standard/04_Viewer3d/CMakeLists.txt index 2eae889ad7..3c39f057d1 100644 --- a/samples/mfc/standard/04_Viewer3d/CMakeLists.txt +++ b/samples/mfc/standard/04_Viewer3d/CMakeLists.txt @@ -21,8 +21,6 @@ set (Viewer3d_HEADER_FILES ${Viewer3d_SRC_DIR}/BoxRadius.h ${Viewer3d_SRC_DIR}/Viewer3dApp.h ${Viewer3d_SRC_DIR}/Viewer3dDoc.h ${Viewer3d_SRC_DIR}/Viewer3dView.h - ${Viewer3d_SRC_DIR}/ZClippingDlg.h - ${Viewer3d_SRC_DIR}/ZCueingDlg.h ${Viewer3d_SRC_DIR}/State.h ${Viewer3d_RESOURCE_DIR}/resource.h ${Viewer3d_RESOURCE_DIR}/resource.hm) @@ -39,9 +37,7 @@ set (Viewer3d_SOURCE_FILES ${Viewer3d_SRC_DIR}/BoxRadius.cpp ${Viewer3d_SRC_DIR}/TrihedronDlg.cpp ${Viewer3d_SRC_DIR}/Viewer3dApp.cpp ${Viewer3d_SRC_DIR}/Viewer3dDoc.cpp - ${Viewer3d_SRC_DIR}/Viewer3dView.cpp - ${Viewer3d_SRC_DIR}/ZClippingDlg.cpp - ${Viewer3d_SRC_DIR}/ZCueingDlg.cpp) + ${Viewer3d_SRC_DIR}/Viewer3dView.cpp) set (Viewer3d_RESOURCE_FILES ${Viewer3d_RESOURCE_DIR}/Viewer3d.rc ${Viewer3d_RESOURCE_DIR}/AISToolbar.bmp diff --git a/samples/mfc/standard/04_Viewer3d/adm/win/vc10/Viewer3d.vcxproj b/samples/mfc/standard/04_Viewer3d/adm/win/vc10/Viewer3d.vcxproj index 394b61f900..819f58425c 100644 --- a/samples/mfc/standard/04_Viewer3d/adm/win/vc10/Viewer3d.vcxproj +++ b/samples/mfc/standard/04_Viewer3d/adm/win/vc10/Viewer3d.vcxproj @@ -439,42 +439,6 @@ %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - @@ -505,8 +469,6 @@ - - diff --git a/samples/mfc/standard/04_Viewer3d/adm/win/vc10/Viewer3d.vcxproj.filters b/samples/mfc/standard/04_Viewer3d/adm/win/vc10/Viewer3d.vcxproj.filters index 5174902abb..58bb2346ce 100644 --- a/samples/mfc/standard/04_Viewer3d/adm/win/vc10/Viewer3d.vcxproj.filters +++ b/samples/mfc/standard/04_Viewer3d/adm/win/vc10/Viewer3d.vcxproj.filters @@ -60,12 +60,6 @@ Source Files - - Source Files - - - Source Files - @@ -121,12 +115,6 @@ Header Files - - Header Files - - - Header Files - diff --git a/samples/mfc/standard/04_Viewer3d/adm/win/vc11/Viewer3d.vcxproj b/samples/mfc/standard/04_Viewer3d/adm/win/vc11/Viewer3d.vcxproj index 3aa966b477..92c2a9cca2 100644 --- a/samples/mfc/standard/04_Viewer3d/adm/win/vc11/Viewer3d.vcxproj +++ b/samples/mfc/standard/04_Viewer3d/adm/win/vc11/Viewer3d.vcxproj @@ -443,42 +443,6 @@ %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - @@ -509,8 +473,6 @@ - - diff --git a/samples/mfc/standard/04_Viewer3d/adm/win/vc11/Viewer3d.vcxproj.filters b/samples/mfc/standard/04_Viewer3d/adm/win/vc11/Viewer3d.vcxproj.filters index 5174902abb..58bb2346ce 100644 --- a/samples/mfc/standard/04_Viewer3d/adm/win/vc11/Viewer3d.vcxproj.filters +++ b/samples/mfc/standard/04_Viewer3d/adm/win/vc11/Viewer3d.vcxproj.filters @@ -60,12 +60,6 @@ Source Files - - Source Files - - - Source Files - @@ -121,12 +115,6 @@ Header Files - - Header Files - - - Header Files - diff --git a/samples/mfc/standard/04_Viewer3d/adm/win/vc12/Viewer3d.vcxproj b/samples/mfc/standard/04_Viewer3d/adm/win/vc12/Viewer3d.vcxproj index af8482271e..3dfbf5f238 100644 --- a/samples/mfc/standard/04_Viewer3d/adm/win/vc12/Viewer3d.vcxproj +++ b/samples/mfc/standard/04_Viewer3d/adm/win/vc12/Viewer3d.vcxproj @@ -443,42 +443,6 @@ %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - @@ -509,8 +473,6 @@ - - diff --git a/samples/mfc/standard/04_Viewer3d/adm/win/vc12/Viewer3d.vcxproj.filters b/samples/mfc/standard/04_Viewer3d/adm/win/vc12/Viewer3d.vcxproj.filters index 5174902abb..58bb2346ce 100644 --- a/samples/mfc/standard/04_Viewer3d/adm/win/vc12/Viewer3d.vcxproj.filters +++ b/samples/mfc/standard/04_Viewer3d/adm/win/vc12/Viewer3d.vcxproj.filters @@ -60,12 +60,6 @@ Source Files - - Source Files - - - Source Files - @@ -121,12 +115,6 @@ Header Files - - Header Files - - - Header Files - diff --git a/samples/mfc/standard/04_Viewer3d/adm/win/vc14/Viewer3d.vcxproj b/samples/mfc/standard/04_Viewer3d/adm/win/vc14/Viewer3d.vcxproj index 1036203004..5be36c182b 100644 --- a/samples/mfc/standard/04_Viewer3d/adm/win/vc14/Viewer3d.vcxproj +++ b/samples/mfc/standard/04_Viewer3d/adm/win/vc14/Viewer3d.vcxproj @@ -443,42 +443,6 @@ %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - - - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - Disabled - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - EnableFastChecks - true - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - MaxSpeed - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - @@ -509,8 +473,6 @@ - - diff --git a/samples/mfc/standard/04_Viewer3d/adm/win/vc14/Viewer3d.vcxproj.filters b/samples/mfc/standard/04_Viewer3d/adm/win/vc14/Viewer3d.vcxproj.filters index 5174902abb..58bb2346ce 100644 --- a/samples/mfc/standard/04_Viewer3d/adm/win/vc14/Viewer3d.vcxproj.filters +++ b/samples/mfc/standard/04_Viewer3d/adm/win/vc14/Viewer3d.vcxproj.filters @@ -60,12 +60,6 @@ Source Files - - Source Files - - - Source Files - @@ -121,12 +115,6 @@ Header Files - - Header Files - - - Header Files - diff --git a/samples/mfc/standard/04_Viewer3d/res/Toolbar.bmp b/samples/mfc/standard/04_Viewer3d/res/Toolbar.bmp index 223471d2c41ef1bde12dc2c692d130720f6d4d8e..df31058df0350bd8c988a4b1b49e330852cd4e33 100755 GIT binary patch literal 6918 zcmd6ry>25n6ou(v5fKnzuYeRrwsWP&2m%#u@-D6-m$b2f2+TstW2AJt0o1riv4tMO zrGNy2OLxjS=aMrVYha4s%XEuLArc}qpPCrV*9ixF2B_LKA1Y^_dD#COTh|i^3vF=S(0h2t1id8-`R&H0U)0YpO{>*1YOY2YwD%3K;C*pwJkpbLRa;wcK}o|ZD? zVaR3`vtFhsNAkDZ{TiIpjph^e*07HfK)q9OJ$txY)W43i12Z8i@Z z57Te{*{o^EXP&@R(n8yYDMFuRq*dq?&m3H#Yr|CjRMKoC(=Jmyi4Ve#PDdEu5Fm?zO`YfgrYKN(2 z)Lo|NtQUQeY49N1(dkXg^tNT1LO21q&lBQGWG;tPFMjHm(`5gPZOer{NixkXy6Vq0w zjZiyGUzkq?l2PmFv^Sk%R>p?c!?zs!rc(;_NTw&F_nfnlGy&k&Ez_9!eVk0%*x%8q z^ZGvkxjSZmwPm!!w0}Nr*8L>YVm`(43!OT;>B3UyVm>YQr))t& zfkWuLhslmIBCi@{G4@%+`}63VPeH@uVICS{Q%eDz zlTP8wJFikQ#jFaZ^bdNqJ^v~9Dz?AJeRiz%8ojRL$u85_#D0wJeA+TaKPJY$40wu2 z()K&t`6N`XAEoDN$xK2$rKK%`LxJrTa2u525J{nwI<@;RzN7Gxc^J?ZNle+93AfjG zR3p>g`PAB`+;iNJMMml)4QiAbSh9?3Rh-M`hc(JQ4s*J-)-0PdpT*F_6tvFS1nG9H z6JtM3sHvp0KjoWgjRI5ru?v}=$>LR+D59Vq9+oEs8X6SQ%|b=9A&ODYO32f`t$1D8 zFsKGu@okDLJ^;P)&*GkWros9mNvIwLSn{@88cbNB$ns48LgD}V^l^H+fz^87S|;8# zY9&-}!_5)lm>{)G<5&e`dMPX3+DS~4IdFsNmGihl--~04}_vj?Xr4{7= zOZix1LQTWaX`3&sLnG9ZsbazBhWU&F3lhBlV=hcgajE}IL4>MV=lcEU8DOARvT2#_ zZ{J(P_0wAo=0e`j#?s3=khx**d!S*e*4rC{Jspf`mZ^P|2`t+Cgs;;TYC|~^Fqi>5 zGfhNU{knvkO$wd9u5;PCajz`=e{J|$y!yU-H!>~fQw_D>*QKX?aWv7l>a@q1Z(h{M Yw9E9Bel4C}*`a8zu|GQYiyI~LKYX^YfB*mh literal 7318 zcmd6ry>8=16ou(v0SYkSwSWL>QUq?C#|Q!eTjgEG#v)^YhNaGaf;@*)O`*m`fNfml z5!|UrAh>g>oOAB{kQ603^1_>uG`yVOJ0A}(hx+B$-+!o-enb8fet&&eRo~-yRDDqS zkFlO7r}3wXYF_bM&F6MN4zqfAc)*brYkjNrnihWeun3v|_9=LM8o$Wtt2#AXA21x) z5E0S=o!`03UN?grYP@|y#=Ll=qmQlrv-QiYb^2QK|G~Mc>g^6!i$!3qQ^~gehjSS62=a_{!OrzS1Fq5a71Y>pfZ8vb5RCTFcpmWr zDapAPH{9J_Z;IhDN@?-$F$#LNex}dhe8XnSO8X(}>JI4^HSfc@Nj|u8?>i7NXv&!# zOMz_bj*+RCESWXW8{qaF#h}G&!7iu`YL^Aw(Q}XUw%daK+0gEv$3K7Oz}`ne&t6#e ziJVtYXt!FTuB_;0#l-f-y29BNvo~_SN|NM+oT5Fk_ZdS_6)NSL7E%*Rv{+jME}Kca z6)ox0ESj~Ip$o5x%?6aPEd?C-%Yr_H^9ZuP#~|LHfaz5Jd2fQAsZ5+r&-K!LvAZ#r zp{rS_^y2JqH#ko&Ca6_9SN?hG{q&Q}ODp&OVsc@o17%##T4%@ic67XS&nj9NG}x3P zlcNicocsw2Z`8&5ku#e$%mz8Lmo5$akJO7O{}_+QtY{FDaR~X-<(&Lv({!24Zs+72 zG<4#8ji6zIZgJKM+zr%g7IULpES?)@vi1S1xu5x#`xPf#s zz&V(}SPhd2uB}#2D=ws7{k>Y!kf%I=v(SVVXM_!wkzh;Dm~%8oSJjd8geT2HIe^_-Bap8P+&dCTl zb3RjvI7>jdUEmh{Re5@n6+Kg3{4vF&>6yOZhcX&Y@ys}@W$18TpiBr0Xa5m*j2>&G zm^sHMXBKpuvwXyCea?<<;|2p~T?cUvbgRQzg5KoJzI1OVXIJ<2d{H=G7S1tj_*BHW zVFCi@QRaMXvi8HAqo4;l>v^(zN^yftbKJ1UpsrJkGv|S0jdC?yTo|9R@g4(1&s!kGk<0 z^b+UG!g(6QGxQwUi}M7lg#ZxjwsIygd}EUJCe9i`40O{_&>hY@;rM2RQ zFZ&G)E|9%!QDKC}eC)uufz}!y%?9H$Xw;Z& zm~-4PaSZP;VAM1G`(TriGomy&)93u2a>9L+y_0YueQUWyuUmh#$=MgqzQpGp`wfBv z6#92x$Bmr`7;==ik_3Ii0?G-!@IFW*Ng~n}Ua44bEUouJEHYghv_%qUj=+TBgJn_9 zgYntg?#SU$6XYMR7(@8a0GrDZg;) zG%(NGjW*{(D<*GnBpXza-S^#ruSB*=0q=GHEYSD?wuvEt?~< zv-gFwKUYCJKC1v3u0}LR)#z@n_d!IBww_bd9mn$j2E9lN${l$B+DZDquJ!=|+KA<5 z9m6^#IR^$6OQ6Aq8bELf4YhMWl zo96w-zQ()ivwOQ5y{%4~*n0`HoI7!YxA)$zd)%8HO!=*P-s9Lesm^lla{daw%w7&3 OL>eja`S5{a&wl~NEA=t} diff --git a/samples/mfc/standard/04_Viewer3d/res/Viewer3d.rc b/samples/mfc/standard/04_Viewer3d/res/Viewer3d.rc index 2ad25b9e5b..2ce677f045 100755 --- a/samples/mfc/standard/04_Viewer3d/res/Viewer3d.rc +++ b/samples/mfc/standard/04_Viewer3d/res/Viewer3d.rc @@ -99,43 +99,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Dialog // -IDD_ZCLIPPING DIALOG 0, 0, 180, 95 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION -CAPTION "ZClipping" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,13,68,50,14 - PUSHBUTTON "Cancel",IDCANCEL,70,68,50,14 - CONTROL "Slider1",IDC_SLIDER_ZCLIPPINGDEPTH,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,34,6,97,15 - LTEXT "Depth:",IDC_STATIC,13,9,22,8 - GROUPBOX "",IDC_STATIC,7,0,166,44 - EDITTEXT IDC_EDIT_ZCLIPPINGDEPTH,131,7,34,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Slider2",IDC_SLIDER_ZCLIPPINGWIDTH,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,34,25,97,15 - LTEXT "Width:",IDC_STATIC,13,28,22,8 - EDITTEXT IDC_EDIT_ZCLIPPINGWIDTH,131,26,34,14,ES_AUTOHSCROLL | ES_NUMBER - COMBOBOX IDC_COMBO_ZCLIPPINGTYPE,39,47,80,55,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Type:",IDC_STATIC,13,49,19,8 - GROUPBOX "",IDC_STATIC,7,59,166,29 -END - -IDD_ZCUEING DIALOG 0, 0, 180, 95 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION -CAPTION "ZCueing" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,13,68,50,14 - PUSHBUTTON "Cancel",IDCANCEL,70,68,50,14 - CONTROL "Slider1",IDC_SLIDER_ZCUEINGDEPTH,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,34,6,97,15 - LTEXT "Depth:",-1,13,9,22,8 - GROUPBOX "",-1,7,0,166,44 - EDITTEXT IDC_EDIT_ZCUEINGDEPTH,131,7,34,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Slider2",IDC_SLIDER_ZCUEINGWIDTH,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,34,25,97,15 - LTEXT "Width:",-1,13,28,22,8 - EDITTEXT IDC_EDIT_ZCUEINGWIDTH,131,26,34,14,ES_AUTOHSCROLL | ES_NUMBER - GROUPBOX "",-1,7,59,166,29 - CONTROL "Cueing ON/OFF",IDC_CHECK_CUEINGONOFF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,49,67,10 -END - IDD_SHADINGMODEL DIALOG 0, 0, 60, 66 STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "ShadingModel" @@ -260,8 +223,6 @@ BEGIN BUTTON ID_AMBIENT_LIGHT BUTTON ID_CLEAR_LIGHTS SEPARATOR - BUTTON ID_ZCLIPPING - BUTTON ID_ZCUEING BUTTON ID_SCALE SEPARATOR BUTTON ID_NBISOS @@ -472,8 +433,6 @@ BEGIN ID_POSITIONAL_LIGHT "Create an positional light source\nPositional light" ID_SPOT_LIGHT "Create an spot light source\nSpot light" ID_LIGHTOFF "Delete lights\nDelete lights" - ID_ZCLIPPING "ZClipping\nZClipping" - ID_ZCUEING "ZCueing\nZCueing" ID_SHADINGMODEL "Define shading model\nShadingModel" ID_ANTIALIASINGONOFF "Antialiasing ON/OFF\nAntialiasing" END diff --git a/samples/mfc/standard/04_Viewer3d/res/resource.h b/samples/mfc/standard/04_Viewer3d/res/resource.h index fac2093ddb..d7e6ef7847 100755 --- a/samples/mfc/standard/04_Viewer3d/res/resource.h +++ b/samples/mfc/standard/04_Viewer3d/res/resource.h @@ -6,8 +6,6 @@ #define IDD_SETOFFSETS 134 #define IDD_SCALE 139 #define IDD_RADIUS 144 -#define IDD_ZCLIPPING 152 -#define IDD_ZCUEING 153 #define IDD_TRIHEDRON 542 #define ID_BOX 802 #define ID_Cylinder 803 @@ -19,8 +17,6 @@ #define ID_SPOT_LIGHT 809 #define ID_LIGHTOFF 810 #define ID_USERCYLINDER_CHANGEFACECOLOR 810 -#define ID_ZCLIPPING 812 -#define ID_ZCUEING 813 #define ID_SHADINGMODEL 814 #define ID_ANTIALIASINGONOFF 815 #define ID_CLEAR_LIGHTS 816 @@ -80,20 +76,10 @@ #define IDD_RESULTMESSAGEDLG 1500 #define IDD_MODELCLIPPING 1501 #define IDD_ISOS 1502 -#define IDC_COMBO_ZCLIPPINGTYPE 1650 -#define IDC_CHECK_CUEINGONOFF 1651 #define IDC_EDITTRIHEDRSCALE 1686 #define IDC_SPINTRIHEDRSCALE 1737 #define IDC_COMBOTRIHEDRPOS 1739 #define IDC_COMBOTRIHEDRCOLOR 1740 -#define IDC_SLIDER_ZCLIPPINGDEPTH 2004 -#define IDC_SLIDER_ZCLIPPINGWIDTH 2005 -#define IDC_EDIT_ZCLIPPINGDEPTH 2006 -#define IDC_EDIT_ZCLIPPINGWIDTH 2007 -#define IDC_SLIDER_ZCUEINGDEPTH 2009 -#define IDC_SLIDER_ZCUEINGWIDTH 2010 -#define IDC_EDIT_ZCUEINGDEPTH 2011 -#define IDC_EDIT_ZCUEINGWIDTH 2012 // Next default values for new objects // diff --git a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp index 0545bf9807..cd24c093df 100755 --- a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp +++ b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.cpp @@ -8,8 +8,6 @@ #include "OCC_MainFrame.h" #include "Viewer3dApp.h" #include "Viewer3dDoc.h" -#include "ZClippingDlg.h" -#include "ZCueingDlg.h" #include "ScaleDlg.h" #include "ShadingModelDlg.h" #include "ModelClippingDlg.h" @@ -86,9 +84,7 @@ BEGIN_MESSAGE_MAP(CViewer3dView, CView) ON_COMMAND(ID_SPOT_LIGHT, OnSpotLight) ON_COMMAND(ID_POSITIONAL_LIGHT, OnPositionalLight) ON_COMMAND(ID_AMBIENT_LIGHT, OnAmbientLight) - ON_COMMAND(ID_ZCUEING, OnZcueing) ON_COMMAND(ID_SCALE, OnScale) - ON_COMMAND(ID_ZCLIPPING, OnZclipping) ON_COMMAND(ID_SHADINGMODEL, OnShadingmodel) ON_COMMAND(ID_ANTIALIASINGONOFF, OnAntialiasingonoff) ON_COMMAND(ID_CLEAR_LIGHTS, OnClearLights) @@ -1001,20 +997,6 @@ void CViewer3dView::OnScale() myView->Redraw(); } -void CViewer3dView::OnZcueing() -{ - ZCueingDlg Dlg(myView, GetDocument()); - Dlg.DoModal(); - myView->Redraw(); -} - -void CViewer3dView::OnZclipping() -{ - ZClippingDlg Dlg(myView, GetDocument()); - Dlg.DoModal(); - myView->Redraw(); -} - //V3d_View.hxx void CViewer3dView::OnShadingmodel() diff --git a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.h b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.h index 06eef81652..a3d0174470 100755 --- a/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.h +++ b/samples/mfc/standard/04_Viewer3d/src/Viewer3dView.h @@ -116,9 +116,7 @@ protected: afx_msg void OnSpotLight(); afx_msg void OnPositionalLight(); afx_msg void OnAmbientLight(); - afx_msg void OnZcueing(); afx_msg void OnScale(); - afx_msg void OnZclipping(); afx_msg void OnShadingmodel(); afx_msg void OnAntialiasingonoff(); afx_msg void OnClearLights(); diff --git a/samples/mfc/standard/04_Viewer3d/src/ZClippingDlg.cpp b/samples/mfc/standard/04_Viewer3d/src/ZClippingDlg.cpp deleted file mode 100755 index 14e2e355e4..0000000000 --- a/samples/mfc/standard/04_Viewer3d/src/ZClippingDlg.cpp +++ /dev/null @@ -1,195 +0,0 @@ -// ZClippingDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "Viewer3dApp.h" -#include "Viewer3dDoc.h" -#include "ZClippingDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// ZClippingDlg dialog - -ZClippingDlg::ZClippingDlg(Handle(V3d_View) Current_V3d_View, CViewer3dDoc* pDoc, CWnd* pParent /*=NULL*/) - : CDialog(ZClippingDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(ZClippingDlg) - m_ZClippingDepth = 0.0; - m_ZClippingWidth = 0.0; - myDoc=pDoc; - myCurrent_V3d_View = Current_V3d_View; - //}}AFX_DATA_INIT -} - - -void ZClippingDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(ZClippingDlg) - DDX_Control(pDX, IDC_SLIDER_ZCLIPPINGWIDTH, m_ZClippingWidthSlidCtrl); - DDX_Control(pDX, IDC_SLIDER_ZCLIPPINGDEPTH, m_ZClippingDepthSlidCtrl); - DDX_Control(pDX, IDC_COMBO_ZCLIPPINGTYPE, m_ZClippingTypeList); - DDX_Text(pDX, IDC_EDIT_ZCLIPPINGDEPTH, m_ZClippingDepth); - DDV_MinMaxDouble(pDX, m_ZClippingDepth, -1500., 1500.); - DDX_Text(pDX, IDC_EDIT_ZCLIPPINGWIDTH, m_ZClippingWidth); - DDV_MinMaxDouble(pDX, m_ZClippingWidth, 0., 1500.); - //}}AFX_DATA_MAP -} - -BOOL ZClippingDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - -// Initializing the ComboBox - m_ZClippingTypeList.InsertString(-1, L"OFF"); - m_ZClippingTypeList.InsertString(-1, L"BACK"); - m_ZClippingTypeList.InsertString(-1, L"FRONT"); - m_ZClippingTypeList.InsertString(-1, L"SLICE"); - -// Getting the type of ZClipping and select it in the ComboBox - Quantity_Length Depth, Width; - V3d_TypeOfZclipping myTypeOfZclipping=myCurrent_V3d_View->ZClipping(Depth, Width); - if(myTypeOfZclipping==V3d_OFF) - m_ZClippingTypeList.SetCurSel(0); - else if(myTypeOfZclipping==V3d_BACK) - m_ZClippingTypeList.SetCurSel(1); - else if(myTypeOfZclipping==V3d_FRONT) - m_ZClippingTypeList.SetCurSel(2); - else if(myTypeOfZclipping==V3d_SLICE) - m_ZClippingTypeList.SetCurSel(3); - -// Setting the m_ZClippingWidth value at ZClipping width - m_ZClippingWidth=Width; -// Setting the m_ZClippingWidthSlidCtrl position at floor(Width) value (because slider position is an integer) - m_ZClippingWidthSlidCtrl.SetRange(0, 1500, TRUE); - m_ZClippingWidthSlidCtrl.SetPos( (int) floor(Width)); - -// Setting the m_ZClippingDepth value at ZClipping depth - m_ZClippingDepth=Depth; -// Setting the m_ZClippingDepthSlidCtrl position at floor(Depth) value (because slider position is an integer) - m_ZClippingDepthSlidCtrl.SetRange(-1500, 1500, TRUE); - m_ZClippingDepthSlidCtrl.SetPos( (int) floor(Depth)); - - UpdateData(FALSE); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -BEGIN_MESSAGE_MAP(ZClippingDlg, CDialog) - //{{AFX_MSG_MAP(ZClippingDlg) - ON_EN_CHANGE(IDC_EDIT_ZCLIPPINGDEPTH, OnChangeEditZclippingdepth) - ON_EN_CHANGE(IDC_EDIT_ZCLIPPINGWIDTH, OnChangeEditZclippingwidth) - ON_CBN_SELCHANGE(IDC_COMBO_ZCLIPPINGTYPE, OnSelchangeComboZclippingtype) - ON_WM_HSCROLL() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// ZClippingDlg message handlers - -void ZClippingDlg::OnChangeEditZclippingdepth() -{ - UpdateData(TRUE); - -// Setting the m_ZClippingDepthSlidCtrl position at floor(m_ZClippingDepth) value (because slider position is an integer) - m_ZClippingDepthSlidCtrl.SetPos( (int) floor(m_ZClippingDepth)); -// Setting the ZClipping depth at m_ZClippingDepth value - myCurrent_V3d_View->SetZClippingDepth( (const Quantity_Length) m_ZClippingDepth); - - myCurrent_V3d_View->Update(); - - TCollection_AsciiString Message("\ -myCurrent_V3d_View->SetZClippingDepth( (const Quantity_Length) m_ZClippingDepth);\n\ -\n\ -myCurrent_V3d_View->Update();\n\ - "); - - // Update The Result Message Dialog - myDoc->UpdateResultMessageDlg("SetZClippingDepth",Message); -} - -void ZClippingDlg::OnChangeEditZclippingwidth() -{ - UpdateData(TRUE); - -// ZClipping width must be >0 - if(m_ZClippingWidth<=0) - { - m_ZClippingWidth=1; - UpdateData(FALSE); - } - -// Setting the m_ZClippingWidthSlidCtrl position at floor(m_ZClippingWidth) value (because slider position is an integer) - m_ZClippingWidthSlidCtrl.SetPos( (int) floor(m_ZClippingWidth)); -// Setting the ZClipping width at m_ZClippingWidth value - myCurrent_V3d_View->SetZClippingWidth( (const Quantity_Length) m_ZClippingWidth); - - myCurrent_V3d_View->Update(); - - TCollection_AsciiString Message("\ -myCurrent_V3d_View->SetZClippingWidth( (const Quantity_Length) m_ZClippingWidth);\n\ -\n\ -myCurrent_V3d_View->Update();\n\ - "); - - // Update The Result Message Dialog - myDoc->UpdateResultMessageDlg("SetZClippingDepth",Message); -} - -void ZClippingDlg::OnSelchangeComboZclippingtype() -{ -// Setting the ZClipping type as selected in the ComboBox - myCurrent_V3d_View->SetZClippingType(V3d_TypeOfZclipping(m_ZClippingTypeList.GetCurSel())); - myCurrent_V3d_View->Update(); - - TCollection_AsciiString Message("\ -myCurrent_V3d_View->SetZClippingType(V3d_TypeOfZclipping myTypeOfZclipping);\n\ -\n\ -myCurrent_V3d_View->Update();\n\ - "); - - // Update The Result Message Dialog - myDoc->UpdateResultMessageDlg("SetZClippingType",Message); -} - -void ZClippingDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) -{ -// Setting the m_ZClippingDepth value at m_ZClippingDepthSlidCtrl position - m_ZClippingDepth = m_ZClippingDepthSlidCtrl.GetPos(); -// Setting the m_ZClippingWidth value at m_ZClippingWidthSlidCtrl position - m_ZClippingWidth = m_ZClippingWidthSlidCtrl.GetPos(); - - if(m_ZClippingWidth<=0) - { - m_ZClippingWidth=1; - m_ZClippingWidthSlidCtrl.SetPos( 1 ); - } - - UpdateData(FALSE); - -// Setting the ZClipping depth at m_ZClippingDepth value - myCurrent_V3d_View->SetZClippingDepth( (const Quantity_Length) m_ZClippingDepth); -// Setting the ZClipping width at m_ZClippingWidth value - myCurrent_V3d_View->SetZClippingWidth( (const Quantity_Length) m_ZClippingWidth); - myCurrent_V3d_View->Update(); - - TCollection_AsciiString Message("\ -myCurrent_V3d_View->SetZClippingWidth( (const Quantity_Length) m_ZClippingWidth);\n\ -\n\ -myCurrent_V3d_View->SetZClippingDepth( (const Quantity_Length) m_ZClippingDepth);\n\ -\n\ -myCurrent_V3d_View->Update();\n\ - "); - - // Update The Result Message Dialog - myDoc->UpdateResultMessageDlg("SetZClippingDepth/SetZClippingWidth",Message); - - CDialog::OnHScroll(nSBCode, nPos, pScrollBar); -} - diff --git a/samples/mfc/standard/04_Viewer3d/src/ZClippingDlg.h b/samples/mfc/standard/04_Viewer3d/src/ZClippingDlg.h deleted file mode 100755 index 7b83f5136d..0000000000 --- a/samples/mfc/standard/04_Viewer3d/src/ZClippingDlg.h +++ /dev/null @@ -1,60 +0,0 @@ -#if !defined(AFX_ZCLIPPINGDLG_H__B8439A01_61FB_11D3_8D0A_00AA00D10994__INCLUDED_) -#define AFX_ZCLIPPINGDLG_H__B8439A01_61FB_11D3_8D0A_00AA00D10994__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// ZClippingDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// ZClippingDlg dialog - -class ZClippingDlg : public CDialog -{ -// Construction -public: - ZClippingDlg(Handle(V3d_View) Current_V3d_View, CViewer3dDoc* pDoc, CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(ZClippingDlg) - enum { IDD = IDD_ZCLIPPING }; - CSliderCtrl m_ZClippingWidthSlidCtrl; - CSliderCtrl m_ZClippingDepthSlidCtrl; - CComboBox m_ZClippingTypeList; - double m_ZClippingDepth; - double m_ZClippingWidth; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(ZClippingDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(ZClippingDlg) - afx_msg void OnChangeEditZclippingdepth(); - afx_msg void OnChangeEditZclippingwidth(); - afx_msg void OnSelchangeComboZclippingtype(); - virtual BOOL OnInitDialog(); - afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -private: - - Handle(V3d_View) myCurrent_V3d_View; - CViewer3dDoc* myDoc; -}; - - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_ZCLIPPINGDLG_H__B8439A01_61FB_11D3_8D0A_00AA00D10994__INCLUDED_) diff --git a/samples/mfc/standard/04_Viewer3d/src/ZCueingDlg.cpp b/samples/mfc/standard/04_Viewer3d/src/ZCueingDlg.cpp deleted file mode 100755 index 3edbc0045f..0000000000 --- a/samples/mfc/standard/04_Viewer3d/src/ZCueingDlg.cpp +++ /dev/null @@ -1,204 +0,0 @@ -// ZCueingDlg.cpp : implementation file -// - -#include "stdafx.h" -#include "Viewer3dApp.h" -#include "Viewer3dDoc.h" -#include "ZCueingDlg.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// ZCueingDlg dialog - - -ZCueingDlg::ZCueingDlg(Handle(V3d_View) Current_V3d_View, CViewer3dDoc* pDoc, CWnd* pParent /*=NULL*/) - : CDialog(ZCueingDlg::IDD, pParent) -{ - //{{AFX_DATA_INIT(ZCueingDlg) - myCurrent_V3d_View = Current_V3d_View; - myDoc=pDoc; - m_Cueing = FALSE; - m_ZCueingDepth = 0.0; - m_ZCueingWidth = 0.0; - //}}AFX_DATA_INIT -} - - -void ZCueingDlg::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(ZCueingDlg) - DDX_Control(pDX, IDC_SLIDER_ZCUEINGWIDTH, m_ZCueingWidthSlidCtrl); - DDX_Control(pDX, IDC_SLIDER_ZCUEINGDEPTH, m_ZCueingDepthSlidCtrl); - DDX_Check(pDX, IDC_CHECK_CUEINGONOFF, m_Cueing); - DDX_Text(pDX, IDC_EDIT_ZCUEINGDEPTH, m_ZCueingDepth); - DDV_MinMaxDouble(pDX, m_ZCueingDepth, -1500., 1500.); - DDX_Text(pDX, IDC_EDIT_ZCUEINGWIDTH, m_ZCueingWidth); - DDV_MinMaxDouble(pDX, m_ZCueingWidth, 0., 1500.); - //}}AFX_DATA_MAP -} - -BOOL ZCueingDlg::OnInitDialog() -{ - CDialog::OnInitDialog(); - - Quantity_Length Depth, Width; - -// Getting the ZCueing state (ON or OFF) and check (or not) the check button - if(myCurrent_V3d_View->ZCueing(Depth, Width)) - m_Cueing=TRUE; - else - m_Cueing=FALSE; - -// Setting the m_ZCueingWidth value at ZCueing Width - m_ZCueingWidth=Width; - m_ZCueingWidthSlidCtrl.SetRange(0, 1500, TRUE); -// Setting the m_ZCueingWidthSlidCtrl position at floor(Width) value (because slider position is an integer) - m_ZCueingWidthSlidCtrl.SetPos( (int) floor(Width)); - -// Setting the m_ZCueingWidth value at ZCueing Width - m_ZCueingDepth=Depth; - m_ZCueingDepthSlidCtrl.SetRange(-1500, 1500, TRUE); -// Setting the m_ZCueingDepthSlidCtrl position at floor(Depth) value (because slider position is an integer) - m_ZCueingDepthSlidCtrl.SetPos( (int) floor(Depth)); - - UpdateData(FALSE); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -BEGIN_MESSAGE_MAP(ZCueingDlg, CDialog) - //{{AFX_MSG_MAP(ZCueingDlg) - ON_BN_CLICKED(IDC_CHECK_CUEINGONOFF, OnCheckCueingonoff) - ON_EN_CHANGE(IDC_EDIT_ZCUEINGDEPTH, OnChangeEditZcueingdepth) - ON_EN_CHANGE(IDC_EDIT_ZCUEINGWIDTH, OnChangeEditZcueingwidth) - ON_WM_HSCROLL() - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// ZCueingDlg message handlers - -void ZCueingDlg::OnCheckCueingonoff() -{ - Quantity_Length Depth, Width; - UpdateData(TRUE); - - if(m_Cueing) - { - if(!myCurrent_V3d_View->ZCueing(Depth, Width)) -// Setting the ZCueing on if it's not yet - myCurrent_V3d_View->SetZCueingOn(); - } - else - { - if(myCurrent_V3d_View->ZCueing(Depth, Width)) -// Setting the ZCueing off if it's not yet - myCurrent_V3d_View->SetZCueingOff(); - } - - myCurrent_V3d_View->Update(); - - - TCollection_AsciiString Message("\ -if(!myCurrent_V3d_View->ZCueing(Depth, Width));\n\ - myCurrent_V3d_View->SetZCueingOn();\n\ -else\n\ - myCurrent_V3d_View->SetZCueingOff();\n\ -\n\ -myCurrent_V3d_View->Update();\n\ - "); - - // Update The Result Message Dialog - myDoc->UpdateResultMessageDlg("SetZCueingWidth",Message); -} - -void ZCueingDlg::OnChangeEditZcueingdepth() -{ - UpdateData(TRUE); - -// Setting the m_ZCueingDepthSlidCtrl position at floor(m_ZCueingDepth) value (because slider position is an integer) - m_ZCueingDepthSlidCtrl.SetPos( (int) floor(m_ZCueingDepth)); -// Setting the ZCueing depth at m_ZCueingDepth value - myCurrent_V3d_View->SetZCueingDepth( (const Quantity_Length) m_ZCueingDepth); - - myCurrent_V3d_View->Update(); - - TCollection_AsciiString Message("\ -myCurrent_V3d_View->SetZCueingDepth( (const Quantity_Length) m_ZCueingDepth);\n\ -\n\ -myCurrent_V3d_View->Update();\n\ - "); - - // Update The Result Message Dialog - myDoc->UpdateResultMessageDlg("SetZCueingDepth",Message); -} - -void ZCueingDlg::OnChangeEditZcueingwidth() -{ - UpdateData(TRUE); - - if(m_ZCueingWidth<=0) - { - m_ZCueingWidth=1; - UpdateData(FALSE); - } - -// Setting the m_ZCueingWidthSlidCtrl position at floor(m_ZCueingWidth) value (because slider position is an integer) - m_ZCueingWidthSlidCtrl.SetPos( (int) floor(m_ZCueingWidth)); -// Setting the ZCueing width at m_ZCueingWidth value - myCurrent_V3d_View->SetZCueingWidth( (const Quantity_Length) m_ZCueingWidth); - - myCurrent_V3d_View->Update(); - - TCollection_AsciiString Message("\ -myCurrent_V3d_View->SetZCueingWidth( (const Quantity_Length) m_ZCueingWidth);\n\ -\n\ -myCurrent_V3d_View->Update();\n\ - "); - - // Update The Result Message Dialog - myDoc->UpdateResultMessageDlg("SetZCueingWidth",Message); -} - -void ZCueingDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) -{ -// Setting the m_ZCueingDepth value at m_ZCueingDepthSlidCtrl position - m_ZCueingDepth = m_ZCueingDepthSlidCtrl.GetPos(); -// Setting the m_ZCueingWidth value at m_ZCueingWidthSlidCtrl position - m_ZCueingWidth = m_ZCueingWidthSlidCtrl.GetPos(); - - if(m_ZCueingWidth<=0) - { - m_ZCueingWidth=1; - m_ZCueingWidthSlidCtrl.SetPos( 1 ); - } - - UpdateData(FALSE); - -// Setting the ZCueing depth at m_ZCueingDepth value - myCurrent_V3d_View->SetZCueingDepth( (const Quantity_Length) m_ZCueingDepth); -// Setting the ZCueing width at m_ZCueingWidth value - myCurrent_V3d_View->SetZCueingWidth( (const Quantity_Length) m_ZCueingWidth); - myCurrent_V3d_View->Update(); - - TCollection_AsciiString Message("\ -myCurrent_V3d_View->SetZCueingDepth( (const Quantity_Length) m_ZCueingDepth);\n\ -\n\ -myCurrent_V3d_View->SetZCueingWidth( (const Quantity_Length) m_ZCueingWidth);\n\ -\n\ -myCurrent_V3d_View->Update();\n\ - "); - - // Update The Result Message Dialog - myDoc->UpdateResultMessageDlg("SetZCueingDepth/SetZCueingWidth",Message); - - CDialog::OnHScroll(nSBCode, nPos, pScrollBar); -} - diff --git a/samples/mfc/standard/04_Viewer3d/src/ZCueingDlg.h b/samples/mfc/standard/04_Viewer3d/src/ZCueingDlg.h deleted file mode 100755 index 55e98623ce..0000000000 --- a/samples/mfc/standard/04_Viewer3d/src/ZCueingDlg.h +++ /dev/null @@ -1,59 +0,0 @@ -#if !defined(AFX_ZCUEINGDLG_H__B8439A02_61FB_11D3_8D0A_00AA00D10994__INCLUDED_) -#define AFX_ZCUEINGDLG_H__B8439A02_61FB_11D3_8D0A_00AA00D10994__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// ZCueingDlg.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// ZCueingDlg dialog - -class ZCueingDlg : public CDialog -{ -// Construction -public: - ZCueingDlg(Handle(V3d_View) Current_V3d_View, CViewer3dDoc* pDoc, CWnd* pParent = NULL); -// Dialog Data - //{{AFX_DATA(ZCueingDlg) - enum { IDD = IDD_ZCUEING }; - CSliderCtrl m_ZCueingWidthSlidCtrl; - CSliderCtrl m_ZCueingDepthSlidCtrl; - BOOL m_Cueing; - double m_ZCueingDepth; - double m_ZCueingWidth; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(ZCueingDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(ZCueingDlg) - afx_msg void OnCheckCueingonoff(); - virtual BOOL OnInitDialog(); - afx_msg void OnChangeEditZcueingdepth(); - afx_msg void OnChangeEditZcueingwidth(); - afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -private: - - Handle(V3d_View) myCurrent_V3d_View; - CViewer3dDoc* myDoc; -}; - - -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_ZCUEINGDLG_H__B8439A02_61FB_11D3_8D0A_00AA00D10994__INCLUDED_) diff --git a/samples/mfc/standard/Common/OCC_2dView.cpp b/samples/mfc/standard/Common/OCC_2dView.cpp index dcd52bdb7c..aa7c11b680 100755 --- a/samples/mfc/standard/Common/OCC_2dView.cpp +++ b/samples/mfc/standard/Common/OCC_2dView.cpp @@ -100,7 +100,6 @@ void OCC_2dView::OnInitialUpdate() Handle(WNT_Window) aWNTWindow = new WNT_Window(GetSafeHwnd(),Quantity_NOC_MATRAGRAY); myV2dView =((OCC_2dDoc*)GetDocument())->GetViewer2D()->CreateView(); myV2dView->SetWindow(aWNTWindow); - myV2dView->SetZClippingType(V3d_OFF); // initialize the grids dialogs TheRectangularGridDialog.Create(CRectangularGrid::IDD, NULL); TheCircularGridDialog.Create(CCircularGrid::IDD, NULL); diff --git a/src/Graphic3d/Graphic3d_CView.cxx b/src/Graphic3d/Graphic3d_CView.cxx index a3428f4da5..4fcf838ea2 100644 --- a/src/Graphic3d/Graphic3d_CView.cxx +++ b/src/Graphic3d/Graphic3d_CView.cxx @@ -1149,13 +1149,6 @@ void Graphic3d_CView::CopySettings (const Handle(Graphic3d_CView)& theOther) SetShadingModel (theOther->ShadingModel()); SetBackfacingModel (theOther->BackfacingModel()); SetCamera (new Graphic3d_Camera (theOther->Camera())); - SetBackZClippingOn (theOther->BackZClippingIsOn()); - SetFrontZClippingOn (theOther->FrontZClippingIsOn()); - SetZClippingBackPlane (theOther->ZClippingBackPlane()); - SetZClippingFrontPlane (theOther->ZClippingFrontPlane()); - SetDepthCueingOn (theOther->DepthCueingIsOn()); - SetDepthCueingBackPlane (theOther->DepthCueingBackPlane()); - SetDepthCueingFrontPlane (theOther->DepthCueingFrontPlane()); SetGLLightEnabled (theOther->IsGLLightEnabled()); SetLights (theOther->Lights()); SetClipPlanes (theOther->ClipPlanes()); diff --git a/src/Graphic3d/Graphic3d_CView.hxx b/src/Graphic3d/Graphic3d_CView.hxx index 520acacb25..146c742b19 100644 --- a/src/Graphic3d/Graphic3d_CView.hxx +++ b/src/Graphic3d/Graphic3d_CView.hxx @@ -456,48 +456,6 @@ public: //! Sets camera used by the view. virtual void SetCamera (const Handle(Graphic3d_Camera)& theCamera) = 0; - //! Returns the activity of back z-clipping plane. - virtual Standard_Boolean BackZClippingIsOn() const = 0; - - //! Activates the back Z-clipping plane. - virtual void SetBackZClippingOn (const Standard_Boolean theIsOn) = 0; - - //! Returns the definition of the back Z-clipping plane. - virtual Standard_Real ZClippingBackPlane() const = 0; - - //! Sets the definition of the back Z-clipping plane. - virtual void SetZClippingBackPlane (const Standard_Real theValue) = 0; - - //! Returns the activity of front z-clipping plane. - virtual Standard_Boolean FrontZClippingIsOn() const = 0; - - //! Activates the front Z-clipping plane. - virtual void SetFrontZClippingOn (const Standard_Boolean theIsOn) = 0; - - //! Returns the definition of the front Z-clipping plane. - virtual Standard_Real ZClippingFrontPlane() const = 0; - - //! Sets the definition of the front Z-clipping plane. - virtual void SetZClippingFrontPlane (const Standard_Real theValue) = 0; - - //! Returns the activity of depth cueing. - virtual Standard_Boolean DepthCueingIsOn() const = 0; - - //! Sets the activity of depth cueing. - virtual void SetDepthCueingOn (const Standard_Boolean theIsOn) = 0; - - //! Returns the back depth cueing plane. - virtual Standard_Real DepthCueingBackPlane() const = 0; - - //! Set the back depth cueing plane. - virtual void SetDepthCueingBackPlane (const Standard_Real theValue) = 0; - - //! Returns the front depth cueing plane. - virtual Standard_Real DepthCueingFrontPlane() const = 0; - - //! Set the front depth cueing plane. - virtual void SetDepthCueingFrontPlane (const Standard_Real theValue) = 0; - //! Returns true if GL lighting is enabled. virtual Standard_Boolean IsGLLightEnabled() const = 0; diff --git a/src/OpenGl/OpenGl_Clipping.cxx b/src/OpenGl/OpenGl_Clipping.cxx index be8ebffc9c..25398dc512 100755 --- a/src/OpenGl/OpenGl_Clipping.cxx +++ b/src/OpenGl/OpenGl_Clipping.cxx @@ -54,32 +54,20 @@ void OpenGl_Clipping::Init (const Standard_Integer theMaxPlanes) // purpose : // ======================================================================= void OpenGl_Clipping::add (const Handle(OpenGl_Context)& theGlCtx, - const EquationCoords& theCoordSpace, Graphic3d_SequenceOfHClipPlane& thePlanes) { const bool toUseFfp = theGlCtx->core11 != NULL && theGlCtx->caps->ffpEnable; if (!toUseFfp) { - addLazy (theGlCtx, theCoordSpace, thePlanes); + addLazy (theGlCtx, thePlanes); return; } - if (EquationCoords_View == theCoordSpace) - { - theGlCtx->WorldViewState.Push(); - theGlCtx->WorldViewState.SetIdentity(); - } - // Set either identity or pure view matrix. theGlCtx->ApplyWorldViewMatrix(); - addLazy (theGlCtx, theCoordSpace, thePlanes); - - if (EquationCoords_View == theCoordSpace) - { - theGlCtx->WorldViewState.Pop(); - } + addLazy (theGlCtx, thePlanes); // Restore combined model-view matrix. theGlCtx->ApplyModelViewMatrix(); @@ -90,7 +78,6 @@ void OpenGl_Clipping::add (const Handle(OpenGl_Context)& theGlCtx, // purpose : // ======================================================================= void OpenGl_Clipping::addLazy (const Handle(OpenGl_Context)& theGlCtx, - const EquationCoords& theCoordSpace, Graphic3d_SequenceOfHClipPlane& thePlanes) { #if !defined(GL_ES_VERSION_2_0) @@ -112,7 +99,7 @@ void OpenGl_Clipping::addLazy (const Handle(OpenGl_Context)& theGlCtx, Standard_Integer anID = myEmptyPlaneIds->Next(); myPlanes.Append (aPlane); - myPlaneStates.Bind (aPlane, PlaneProps (theCoordSpace, anID, Standard_True)); + myPlaneStates.Bind (aPlane, PlaneProps (anID, Standard_True)); #if !defined(GL_ES_VERSION_2_0) if (toUseFfp) diff --git a/src/OpenGl/OpenGl_Clipping.hxx b/src/OpenGl/OpenGl_Clipping.hxx index b88979a5a0..6588ffa0b9 100755 --- a/src/OpenGl/OpenGl_Clipping.hxx +++ b/src/OpenGl/OpenGl_Clipping.hxx @@ -34,15 +34,6 @@ class OpenGl_Workspace; //! class. class OpenGl_Clipping { -public: - - //! Enumerates supported equation coordinate spaces. - enum EquationCoords - { - EquationCoords_View, - EquationCoords_World - }; - public: //! @name general methods //! Default constructor. @@ -69,12 +60,6 @@ public: //! @name non-modifying getters return myPlanes; } - //! @return kind of equation coordinate space used for the clip plane. - inline EquationCoords GetEquationSpace (const Handle(Graphic3d_ClipPlane)& thePlane) const - { - return myPlaneStates.Find (thePlane).CoordSpace; - } - //! Check whether the clipping plane has been set and enabled for the current context state. //! @param thePlane [in] the plane to check. //! @return True if plane is enabled. @@ -113,12 +98,10 @@ public: //! @name clipping state modification commands //! Otherwise the method just redirects to addLazy(). //! //! @param theGlCtx [in] context to access the matrices - //! @param theCoordSpace [in] the equation definition space //! @param thePlanes [in/out] the list of planes to be added //! The list then provides information on which planes were really added to clipping state. //! This list then can be used to fall back to previous state. Standard_EXPORT void add (const Handle(OpenGl_Context)& theGlCtx, - const EquationCoords& theCoordSpace, Graphic3d_SequenceOfHClipPlane& thePlanes); //! Add planes to the context clipping at the specified system of coordinates. @@ -128,9 +111,7 @@ public: //! @name clipping state modification commands //! @param thePlanes [in/out] the list of planes to be added. //! The list then provides information on which planes were really added to clipping state. //! This list then can be used to fall back to previous state. - //! @param theCoordSpace [in] the equation definition space. Standard_EXPORT void addLazy (const Handle(OpenGl_Context)& theGlCtx, - const EquationCoords& theCoordSpace, Graphic3d_SequenceOfHClipPlane& thePlanes); //! Remove the passed set of clipping planes from the context state. @@ -147,19 +128,6 @@ public: //! @name clipping state modification commands public: //! @name Short-cuts - //! Add planes to the context clipping at the view system of coordinates. - //! If the number of the passed planes exceeds capabilities of OpenGl, the last planes - //! are simply ignored. - //! @param theGlCtx [in] context to access the matrices - //! @param thePlanes [in/out] the list of planes to be added - //! The list then provides information on which planes were really added to clipping state. - //! This list then can be used to fall back to previous state. - inline void AddView (const Handle(OpenGl_Context)& theGlCtx, - Graphic3d_SequenceOfHClipPlane& thePlanes) - { - add (theGlCtx, EquationCoords_View, thePlanes); - } - //! Add planes to the context clipping at the world system of coordinates. //! If the number of the passed planes exceeds capabilities of OpenGl, the last planes //! are simply ignored. @@ -170,7 +138,7 @@ public: //! @name Short-cuts inline void AddWorld (const Handle(OpenGl_Context)& theGlCtx, Graphic3d_SequenceOfHClipPlane& thePlanes) { - add (theGlCtx, EquationCoords_World, thePlanes); + add (theGlCtx, thePlanes); } //! Remove all of the planes from context state. @@ -186,16 +154,13 @@ private: // declare default constructor // to allow compilation of template collections PlaneProps() {} - PlaneProps (const EquationCoords theCoords, - const Standard_Integer theID, + PlaneProps (const Standard_Integer theID, const Standard_Boolean theIsEnabled) { - CoordSpace = theCoords; ContextID = theID; IsEnabled = theIsEnabled; } - EquationCoords CoordSpace; Standard_Integer ContextID; Standard_Boolean IsEnabled; }; diff --git a/src/OpenGl/OpenGl_GraphicDriver.cxx b/src/OpenGl/OpenGl_GraphicDriver.cxx index 2047328c5f..819f0b30ec 100644 --- a/src/OpenGl/OpenGl_GraphicDriver.cxx +++ b/src/OpenGl/OpenGl_GraphicDriver.cxx @@ -386,9 +386,8 @@ Standard_Integer OpenGl_GraphicDriver::InquireViewLimit() // ======================================================================= Standard_Integer OpenGl_GraphicDriver::InquirePlaneLimit() { - // NOTE the 2 first planes are reserved for ZClipping const Handle(OpenGl_Context)& aCtx = GetSharedContext(); - return aCtx.IsNull() ? 0 : Max (aCtx->MaxClipPlanes() - 2, 0); + return aCtx.IsNull() ? aCtx->MaxClipPlanes() : 0; } // ======================================================================= diff --git a/src/OpenGl/OpenGl_ShaderManager.cxx b/src/OpenGl/OpenGl_ShaderManager.cxx index 7fb2266505..a8f3a2e387 100644 --- a/src/OpenGl/OpenGl_ShaderManager.cxx +++ b/src/OpenGl/OpenGl_ShaderManager.cxx @@ -28,14 +28,14 @@ #include - - - IMPLEMENT_STANDARD_RTTIEXT(OpenGl_ShaderManager,Standard_Transient) namespace { + //! Clipping planes limit (see the same definition in Declarations.glsl). + static const Standard_Size THE_MAX_CLIP_PLANES = 8; + #define EOL "\n" //! Definition of TexCoord varying. @@ -225,20 +225,9 @@ const char THE_FRAG_CLIP_PLANES[] = EOL" for (int aPlaneIter = 0; aPlaneIter < occClipPlaneCount; ++aPlaneIter)" EOL" {" EOL" vec4 aClipEquation = occClipPlaneEquations[aPlaneIter];" - EOL" int aClipSpace = occClipPlaneSpaces[aPlaneIter];" - EOL" if (aClipSpace == OccEquationCoords_World)" + EOL" if (dot (aClipEquation.xyz, PositionWorld.xyz / PositionWorld.w) + aClipEquation.w < 0.0)" EOL" {" - EOL" if (dot (aClipEquation.xyz, PositionWorld.xyz / PositionWorld.w) + aClipEquation.w < 0.0)" - EOL" {" - EOL" discard;" - EOL" }" - EOL" }" - EOL" else if (aClipSpace == OccEquationCoords_View)" - EOL" {" - EOL" if (dot (aClipEquation.xyz, Position.xyz) + aClipEquation.w < 0.0)" - EOL" {" - EOL" discard;" - EOL" }" + EOL" discard;" EOL" }" EOL" }"; @@ -755,9 +744,7 @@ void OpenGl_ShaderManager::PushClippingState (const Handle(OpenGl_ShaderProgram) theProgram->UpdateState (OpenGl_CLIP_PLANES_STATE, myClippingState.Index()); const GLint aLocEquations = theProgram->GetStateLocation (OpenGl_OCC_CLIP_PLANE_EQUATIONS); - const GLint aLocSpaces = theProgram->GetStateLocation (OpenGl_OCC_CLIP_PLANE_SPACES); - if (aLocEquations == OpenGl_ShaderProgram::INVALID_LOCATION - && aLocSpaces == OpenGl_ShaderProgram::INVALID_LOCATION) + if (aLocEquations == OpenGl_ShaderProgram::INVALID_LOCATION) { return; } @@ -779,9 +766,7 @@ void OpenGl_ShaderManager::PushClippingState (const Handle(OpenGl_ShaderProgram) return; } - const Standard_Size MAX_CLIP_PLANES = 8; - OpenGl_Vec4* anEquations = new OpenGl_Vec4[MAX_CLIP_PLANES]; - GLint* aSpaces = new GLint [MAX_CLIP_PLANES]; + OpenGl_Vec4 anEquations[THE_MAX_CLIP_PLANES]; GLuint aPlaneId = 0; for (Graphic3d_SequenceOfHClipPlane::Iterator anIter (myContext->Clipping().Planes()); anIter.More(); anIter.Next()) @@ -791,24 +776,26 @@ void OpenGl_ShaderManager::PushClippingState (const Handle(OpenGl_ShaderProgram) { continue; } + else if (aPlaneId >= THE_MAX_CLIP_PLANES) + { + myContext->PushMessage (GL_DEBUG_SOURCE_APPLICATION, + GL_DEBUG_TYPE_PORTABILITY, 0, GL_DEBUG_SEVERITY_MEDIUM, + "Warning: clipping planes limit (8) has been exceeded."); + break; + } const Graphic3d_ClipPlane::Equation& anEquation = aPlane->GetEquation(); anEquations[aPlaneId] = OpenGl_Vec4 ((float) anEquation.x(), (float) anEquation.y(), (float) anEquation.z(), (float) anEquation.w()); - aSpaces[aPlaneId] = myContext->Clipping().GetEquationSpace (aPlane); ++aPlaneId; } theProgram->SetUniform (myContext, theProgram->GetStateLocation (OpenGl_OCC_CLIP_PLANE_COUNT), aPlanesNb); - theProgram->SetUniform (myContext, aLocEquations, MAX_CLIP_PLANES, anEquations); - theProgram->SetUniform (myContext, aLocSpaces, MAX_CLIP_PLANES, aSpaces); - - delete[] anEquations; - delete[] aSpaces; + theProgram->SetUniform (myContext, aLocEquations, THE_MAX_CLIP_PLANES, anEquations); } // ======================================================================= diff --git a/src/OpenGl/OpenGl_ShaderProgram.cxx b/src/OpenGl/OpenGl_ShaderProgram.cxx index a3c0a4654c..6f501d1676 100755 --- a/src/OpenGl/OpenGl_ShaderProgram.cxx +++ b/src/OpenGl/OpenGl_ShaderProgram.cxx @@ -53,7 +53,6 @@ Standard_CString OpenGl_ShaderProgram::PredefinedKeywords[] = "occProjectionMatrixInverseTranspose", // OpenGl_OCC_PROJECTION_MATRIX_INVERSE_TRANSPOSE "occClipPlaneEquations", // OpenGl_OCC_CLIP_PLANE_EQUATIONS - "occClipPlaneSpaces", // OpenGl_OCC_CLIP_PLANE_SPACES "occClipPlaneCount", // OpenGl_OCC_CLIP_PLANE_COUNT "occLightSourcesCount", // OpenGl_OCC_LIGHT_SOURCE_COUNT diff --git a/src/OpenGl/OpenGl_ShaderProgram.hxx b/src/OpenGl/OpenGl_ShaderProgram.hxx index a2b23fc175..8cde6177fd 100755 --- a/src/OpenGl/OpenGl_ShaderProgram.hxx +++ b/src/OpenGl/OpenGl_ShaderProgram.hxx @@ -49,7 +49,6 @@ enum OpenGl_StateVariable // OpenGL clip planes state OpenGl_OCC_CLIP_PLANE_EQUATIONS, - OpenGl_OCC_CLIP_PLANE_SPACES, OpenGl_OCC_CLIP_PLANE_COUNT, // OpenGL light state diff --git a/src/OpenGl/OpenGl_View.cxx b/src/OpenGl/OpenGl_View.cxx index 9d5600892b..42dec5a9a4 100644 --- a/src/OpenGl/OpenGl_View.cxx +++ b/src/OpenGl/OpenGl_View.cxx @@ -40,14 +40,6 @@ IMPLEMENT_STANDARD_RTTIEXT(OpenGl_View,Graphic3d_CView) #include #endif -/*----------------------------------------------------------------------*/ - -namespace -{ - static const OPENGL_ZCLIP myDefaultZClip = { { Standard_False, 0.F }, { Standard_False, 1.F } }; - static const OPENGL_FOG myDefaultFog = { Standard_False, 0.F, 1.F, OpenGl_Vec4 (0.0f, 0.0f, 0.0f, 1.0f) }; -} - // ======================================================================= // function : Constructor // purpose : @@ -66,8 +58,6 @@ OpenGl_View::OpenGl_View (const Handle(Graphic3d_StructureManager)& theMgr, myShadingModel (Graphic3d_TOSM_FACET), myBackfacing (Graphic3d_TOBM_AUTOMATIC), myBgColor (Quantity_NOC_BLACK), - myFog (myDefaultFog), - myZClip (myDefaultZClip), myCamera (new Graphic3d_Camera()), myUseGLLight (Standard_True), myToShowTrihedron (false), @@ -401,7 +391,6 @@ Aspect_Background OpenGl_View::Background() const void OpenGl_View::SetBackground (const Aspect_Background& theBackground) { myBgColor.SetRGB (theBackground.Color()); - myFog.Color = myBgColor; } // ======================================================================= diff --git a/src/OpenGl/OpenGl_View.hxx b/src/OpenGl/OpenGl_View.hxx index a46a6db766..2012acc8e7 100644 --- a/src/OpenGl/OpenGl_View.hxx +++ b/src/OpenGl/OpenGl_View.hxx @@ -53,26 +53,6 @@ #include #include -struct OPENGL_ZCLIP -{ - struct { - Standard_Boolean IsOn; - Standard_ShortReal Limit; /* in the range [0., 1.] */ - } Back; - struct { - Standard_Boolean IsOn; - Standard_ShortReal Limit; /* in the range [0., 1.] */ - } Front; -}; - -struct OPENGL_FOG -{ - Standard_Boolean IsOn; - Standard_ShortReal Front; /* in the range [0., 1.] */ - Standard_ShortReal Back; /* in the range [0., 1.] */ - OpenGl_Vec4 Color; -}; - struct OpenGl_Matrix; class Graphic3d_StructureManager; @@ -327,60 +307,6 @@ public: //! Sets camera used by the view. virtual void SetCamera (const Handle(Graphic3d_Camera)& theCamera) Standard_OVERRIDE { myCamera = theCamera; } - //! Returns the activity of back z-clipping plane. - virtual Standard_Boolean BackZClippingIsOn() const Standard_OVERRIDE { return myZClip.Back.IsOn; } - - //! Activates the back Z-clipping plane. - virtual void SetBackZClippingOn (const Standard_Boolean theIsOn) Standard_OVERRIDE { myZClip.Back.IsOn = theIsOn; } - - //! Returns the definition of the back Z-clipping plane. - virtual Standard_Real ZClippingBackPlane() const Standard_OVERRIDE { return myZClip.Back.Limit; } - - //! Sets the definition of the back Z-clipping plane. - virtual void SetZClippingBackPlane (const Standard_Real theValue) Standard_OVERRIDE - { - myZClip.Back.Limit = static_cast (theValue); - } - - //! Returns the activity of front z-clipping plane. - virtual Standard_Boolean FrontZClippingIsOn() const Standard_OVERRIDE { return myZClip.Front.IsOn; } - - //! Activates the front Z-clipping plane. - virtual void SetFrontZClippingOn (const Standard_Boolean theIsOn) Standard_OVERRIDE{ myZClip.Front.IsOn = theIsOn; } - - //! Returns the definition of the front Z-clipping plane. - virtual Standard_Real ZClippingFrontPlane() const Standard_OVERRIDE { return myZClip.Front.Limit; } - - //! Sets the definition of the front Z-clipping plane. - virtual void SetZClippingFrontPlane (const Standard_Real theValue) Standard_OVERRIDE - { - myZClip.Front.Limit = static_cast (theValue); - } - - //! Returns the activity of depth cueing. - virtual Standard_Boolean DepthCueingIsOn() const Standard_OVERRIDE { return myFog.IsOn; } - - //! Sets the activity of depth cueing. - virtual void SetDepthCueingOn (const Standard_Boolean theIsOn) Standard_OVERRIDE { myFog.IsOn = theIsOn; } - - //! Returns the back depth cueing plane. - virtual Standard_Real DepthCueingBackPlane() const Standard_OVERRIDE { return myFog.Back; } - - //! Set the back depth cueing plane. - virtual void SetDepthCueingBackPlane (const Standard_Real theValue) Standard_OVERRIDE - { - myFog.Back = static_cast (theValue); - } - - //! Returns the front depth cueing plane. - virtual Standard_Real DepthCueingFrontPlane() const Standard_OVERRIDE { return myFog.Front; } - - //! Set the front depth cueing plane. - virtual void SetDepthCueingFrontPlane (const Standard_Real theValue) Standard_OVERRIDE - { - myFog.Front = static_cast (theValue); - } - //! Returns true if GL lighting is enabled. virtual Standard_Boolean IsGLLightEnabled() const Standard_OVERRIDE { return myUseGLLight; } @@ -561,8 +487,6 @@ protected: Graphic3d_TypeOfShadingModel myShadingModel; Graphic3d_TypeOfBackfacingModel myBackfacing; Quantity_ColorRGBA myBgColor; - OPENGL_FOG myFog; - OPENGL_ZCLIP myZClip; Graphic3d_SequenceOfHClipPlane myClipPlanes; Handle(Graphic3d_Camera) myCamera; Handle(OpenGl_FrameBuffer) myFBO; diff --git a/src/OpenGl/OpenGl_View_Redraw.cxx b/src/OpenGl/OpenGl_View_Redraw.cxx index 7478fbbb1e..b633873f37 100644 --- a/src/OpenGl/OpenGl_View_Redraw.cxx +++ b/src/OpenGl/OpenGl_View_Redraw.cxx @@ -893,41 +893,6 @@ void OpenGl_View::render (Graphic3d_Camera::Projection theProjection, aContext->SetGlNormalizeEnabled (Standard_False); } - // Apply Fog - if (myFog.IsOn - && aContext->core11 != NULL) - { - Standard_Real aFogFrontConverted = (Standard_Real )myFog.Front + myCamera->Distance(); - if (myCamera->ZFar() < aFogFrontConverted) - { - aFogFrontConverted = myCamera->ZFar(); - myFog.Front = (Standard_ShortReal )(aFogFrontConverted - myCamera->Distance()); - } - - Standard_Real aFogBackConverted = (Standard_Real )myFog.Back + myCamera->Distance(); - if (myCamera->ZFar() < aFogFrontConverted) - { - aFogBackConverted = myCamera->ZFar(); - myFog.Back = (Standard_ShortReal )(aFogBackConverted - myCamera->Distance()); - } - - if (aFogFrontConverted > aFogBackConverted) - { - myFog.Front = (Standard_ShortReal )(aFogFrontConverted - myCamera->Distance()); - myFog.Back = (Standard_ShortReal )(aFogBackConverted - myCamera->Distance()); - } - - glFogi(GL_FOG_MODE, GL_LINEAR); - glFogf(GL_FOG_START, (Standard_ShortReal )aFogFrontConverted); - glFogf(GL_FOG_END, (Standard_ShortReal )aFogBackConverted); - glFogfv(GL_FOG_COLOR, myFog.Color.GetData()); - glEnable(GL_FOG); - } - else if (aContext->core11 != NULL) - { - glDisable (GL_FOG); - } - // Apply InteriorShadingMethod if (aContext->core11 != NULL) { @@ -1151,56 +1116,6 @@ void OpenGl_View::renderScene (Graphic3d_Camera::Projection theProjection, { const Handle(OpenGl_Context)& aContext = myWorkspace->GetGlContext(); - if (myZClip.Back.IsOn || myZClip.Front.IsOn) - { - Handle(Graphic3d_ClipPlane) aPlaneBack; - Handle(Graphic3d_ClipPlane) aPlaneFront; - - if (myZClip.Back.IsOn) - { - Standard_Real aClipBackConverted = (Standard_Real )myZClip.Front.Limit + myCamera->Distance(); - if (myCamera->ZFar() < aClipBackConverted) - { - aClipBackConverted = myCamera->ZFar(); - myZClip.Back.Limit = (Standard_ShortReal )(aClipBackConverted - myCamera->Distance()); - } - const Graphic3d_ClipPlane::Equation aBackEquation (0.0, 0.0, 1.0, (Standard_ShortReal )aClipBackConverted); - aPlaneBack = new Graphic3d_ClipPlane (aBackEquation); - } - - if (myZClip.Front.IsOn) - { - Standard_Real aClipFrontConverted = (Standard_Real )myZClip.Front.Limit + myCamera->Distance(); - if (myCamera->ZNear() > aClipFrontConverted) - { - aClipFrontConverted = myCamera->ZNear(); - myZClip.Front.Limit = (Standard_ShortReal )(aClipFrontConverted - myCamera->Distance()); - } - const Graphic3d_ClipPlane::Equation aFrontEquation (0.0, 0.0, -1.0, (Standard_ShortReal )-aClipFrontConverted); - aPlaneFront = new Graphic3d_ClipPlane (aFrontEquation); - } - - // Specify slicing planes with identity transformation - if (!aPlaneBack.IsNull() || !aPlaneFront.IsNull()) - { - Graphic3d_SequenceOfHClipPlane aSlicingPlanes; - if (!aPlaneBack.IsNull()) - { - aSlicingPlanes.Append (aPlaneBack); - } - - if (!aPlaneFront.IsNull()) - { - aSlicingPlanes.Append (aPlaneFront); - } - - // add planes at loaded view matrix state - aContext->ChangeClipping().AddView (aContext, aSlicingPlanes); - } - - aContext->ShaderManager()->UpdateClippingState(); - } - #ifdef _WIN32 // set printing scale/tiling transformation Handle(OpenGl_PrinterContext) aPrintContext = myWorkspace->PrinterContext(); @@ -1213,6 +1128,7 @@ void OpenGl_View::renderScene (Graphic3d_Camera::Projection theProjection, #endif // Specify clipping planes in view transformation space + aContext->ChangeClipping().RemoveAll (aContext); if (!myClipPlanes.IsEmpty()) { Graphic3d_SequenceOfHClipPlane aUserPlanes; @@ -1323,10 +1239,6 @@ void OpenGl_View::renderScene (Graphic3d_Camera::Projection theProjection, { aContext->ShaderManager()->RevertClippingState(); } - if (myZClip.Back.IsOn || myZClip.Front.IsOn) - { - aContext->ShaderManager()->RevertClippingState(); - } #ifdef _WIN32 // set printing scale/tiling transformation diff --git a/src/Shaders/Declarations.glsl b/src/Shaders/Declarations.glsl index 6dd9f62c3d..5a0c1dfcac 100644 --- a/src/Shaders/Declarations.glsl +++ b/src/Shaders/Declarations.glsl @@ -110,11 +110,6 @@ uniform sampler2D occActiveSampler; //!< Current active sampl uniform vec4 occTexTrsf2d[2]; //!< 2D texture transformation parameters uniform float occPointSize; //!< point size -// clipping planes state -const int OccEquationCoords_View = 0; //!< view-space clipping plane -const int OccEquationCoords_World = 1; //!< world-space clipping plane - //! Parameters of clipping planes uniform vec4 occClipPlaneEquations[THE_MAX_CLIP_PLANES]; -uniform THE_PREC_ENUM int occClipPlaneSpaces [THE_MAX_CLIP_PLANES]; uniform THE_PREC_ENUM int occClipPlaneCount; //!< Total number of clip planes diff --git a/src/Shaders/PhongShading.fs b/src/Shaders/PhongShading.fs index d7fb9b2934..088384d872 100755 --- a/src/Shaders/PhongShading.fs +++ b/src/Shaders/PhongShading.fs @@ -179,20 +179,9 @@ void main() for (int anIndex = 0; anIndex < occClipPlaneCount; ++anIndex) { vec4 aClipEquation = occClipPlaneEquations[anIndex]; - int aClipSpace = occClipPlaneSpaces[anIndex]; - if (aClipSpace == OccEquationCoords_World) + if (dot (aClipEquation.xyz, PositionWorld.xyz / PositionWorld.w) + aClipEquation.w < 0.0) { - if (dot (aClipEquation.xyz, PositionWorld.xyz / PositionWorld.w) + aClipEquation.w < 0.0) - { - discard; - } - } - else if (aClipSpace == OccEquationCoords_View) - { - if (dot (aClipEquation.xyz, Position.xyz) + aClipEquation.w < 0.0) - { - discard; - } + discard; } } diff --git a/src/V3d/FILES b/src/V3d/FILES index 4b129d65b0..6bde8a8b73 100755 --- a/src/V3d/FILES +++ b/src/V3d/FILES @@ -34,11 +34,9 @@ V3d_TypeOfShadingModel.hxx V3d_TypeOfUpdate.hxx V3d_TypeOfView.hxx V3d_TypeOfVisualization.hxx -V3d_TypeOfZclipping.hxx V3d_UnMapped.hxx V3d_View.cxx V3d_View.hxx -V3d_View_1.cxx V3d_View_2.cxx V3d_View_3.cxx V3d_View_4.cxx diff --git a/src/V3d/V3d_TypeOfZclipping.hxx b/src/V3d/V3d_TypeOfZclipping.hxx deleted file mode 100644 index de39f142b6..0000000000 --- a/src/V3d/V3d_TypeOfZclipping.hxx +++ /dev/null @@ -1,34 +0,0 @@ -// Created on: 1992-11-13 -// Created by: GG -// Copyright (c) 1992-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _V3d_TypeOfZclipping_HeaderFile -#define _V3d_TypeOfZclipping_HeaderFile - -//! The available options are -//! - V3d_OFF: Zclipping (clipping executed in the -//! depth of the view) is deactivated, -//! - V3d_BACK: back Zclipping is activated, -//! - V3d_FRONT: front Zclipping is activated, -//! - V3d_SLICE: both front and back Zclippings are activated. -enum V3d_TypeOfZclipping -{ -V3d_OFF, -V3d_BACK, -V3d_FRONT, -V3d_SLICE -}; - -#endif // _V3d_TypeOfZclipping_HeaderFile diff --git a/src/V3d/V3d_View.cxx b/src/V3d/V3d_View.cxx index 20012ad873..d0c815c945 100644 --- a/src/V3d/V3d_View.cxx +++ b/src/V3d/V3d_View.cxx @@ -165,12 +165,6 @@ V3d_View::V3d_View (const Handle(V3d_Viewer)& theViewer, const V3d_TypeOfView th SetSize (theViewer->DefaultViewSize()); Standard_Real zsize = theViewer->DefaultViewSize(); SetZSize (2.*zsize); - SetZClippingType (V3d_OFF); - SetZClippingDepth (0.); - SetZClippingWidth (zsize); - SetZCueingOff(); - SetZCueingDepth (0.); - SetZCueingWidth (zsize); SetDepth (theViewer->DefaultViewSize() / 2.0); SetViewMappingDefault(); SetViewOrientationDefault(); diff --git a/src/V3d/V3d_View.hxx b/src/V3d/V3d_View.hxx index 52bc122767..100cf4ae30 100644 --- a/src/V3d/V3d_View.hxx +++ b/src/V3d/V3d_View.hxx @@ -77,7 +77,6 @@ #include #include #include -#include #include #include @@ -263,27 +262,6 @@ public: //! Defines the visualization type in the view. Standard_EXPORT void SetVisualization (const V3d_TypeOfVisualization theType); - //! Defines the depth of the medium clipping plane. - Standard_EXPORT void SetZClippingDepth (const Quantity_Length theDepth); - - //! Defines the thickness around the medium clipping plane. - Standard_EXPORT void SetZClippingWidth (const Quantity_Length theWidth); - - //! Defines the type of ZClipping. - Standard_EXPORT void SetZClippingType (const V3d_TypeOfZclipping theType); - - //! Defines the depth of the medium plane. - Standard_EXPORT void SetZCueingDepth (const Quantity_Length theDepth); - - //! Defines the thickness around the medium plane. - Standard_EXPORT void SetZCueingWidth (const Quantity_Length theWidth); - - //! Activates ZCueing in the view. - Standard_EXPORT void SetZCueingOn(); - - //! Deactivates ZCueing in the view. - Standard_EXPORT void SetZCueingOff(); - //! Activates theLight in the view. Standard_EXPORT void SetLightOn (const Handle(V3d_Light)& theLight); @@ -714,20 +692,6 @@ public: //! Returns the current visualisation mode. Standard_EXPORT V3d_TypeOfVisualization Visualization() const; - //! Returns activity and information on the Zcueing. - //! : Depth of plane. - //! : Thickness around the plane. - Standard_EXPORT Standard_Boolean ZCueing (Quantity_Length& theDepth, Quantity_Length& theWidth) const; - - //! Returns current information on the ZClipping. - //! : Depth of plane. - //! : Thickness around the plane. - //! : "BACK" - //! "FRONT" - //! "SLICE" - //! "OFF" - Standard_EXPORT V3d_TypeOfZclipping ZClipping (Quantity_Length& theDepth, Quantity_Length& theWidth) const; - //! Returns True if One light more can be //! activated in this View. Standard_EXPORT Standard_Boolean IfMoreLights() const; diff --git a/src/V3d/V3d_View_1.cxx b/src/V3d/V3d_View_1.cxx deleted file mode 100644 index bbe9887459..0000000000 --- a/src/V3d/V3d_View_1.cxx +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -/***********************************************************************/ -/* FUNCTION : - ---------- - File V3d_View_1.cxx : */ -/*----------------------------------------------------------------------*/ -/* - * Includes - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//============================================================================= -//function : SetZClippingDepth -//purpose : -//============================================================================= -void V3d_View::SetZClippingDepth (const Standard_Real theDepth) -{ - Standard_Real aFront = 0., aBack = 0., aWidth = 0.; - - aFront = myView->ZClippingFrontPlane(); - aBack = myView->ZClippingBackPlane(); - aWidth = aFront - aBack; - aFront = theDepth + aWidth / 2.; - aBack = theDepth - aWidth / 2.; - myView->SetZClippingBackPlane (aBack); - myView->SetZClippingFrontPlane (aFront); -} - -//============================================================================= -//function : SetZClippingWidth -//purpose : -//============================================================================= -void V3d_View::SetZClippingWidth (const Standard_Real theWidth) -{ - Standard_Real aFront = 0., aBack = 0., aDepth = 0.; - V3d_BadValue_Raise_if (theWidth <= 0., "V3d_View::SetZClippingWidth, bad width"); - - aFront = myView->ZClippingFrontPlane(); - aBack = myView->ZClippingBackPlane(); - aDepth = (aFront + aBack) / 2.; - aFront = aDepth + theWidth / 2.; - aBack = aDepth - theWidth / 2.; - myView->SetZClippingBackPlane (aBack); - myView->SetZClippingFrontPlane (aFront); -} - -//============================================================================= -//function : SetZClippingType -//purpose : -//============================================================================= -void V3d_View::SetZClippingType (const V3d_TypeOfZclipping theType) -{ - switch (theType) - { - case V3d_OFF : - myView->SetFrontZClippingOn (Standard_False); - myView->SetBackZClippingOn (Standard_False); - break; - - case V3d_BACK : - myView->SetBackZClippingOn (Standard_True); - myView->SetFrontZClippingOn (Standard_False); - break; - - case V3d_FRONT : - myView->SetFrontZClippingOn (Standard_True); - myView->SetBackZClippingOn (Standard_False); - break; - - case V3d_SLICE : - myView->SetFrontZClippingOn (Standard_False); - myView->SetBackZClippingOn (Standard_False); - break; - } -} - -//============================================================================= -//function : ZClipping -//purpose : -//============================================================================= -V3d_TypeOfZclipping V3d_View::ZClipping (Standard_Real& theDepth, Standard_Real& theWidth) const -{ - V3d_TypeOfZclipping aType = V3d_OFF; - - Standard_Real aBack = myView->ZClippingBackPlane(); - Standard_Real aFront = myView->ZClippingFrontPlane(); - Standard_Boolean isBackOn = myView->BackZClippingIsOn(); - Standard_Boolean isFrontOn = myView->FrontZClippingIsOn(); - - theWidth = aFront - aBack ; - theDepth = (aFront + aBack) / 2.0; - if (isBackOn) - { - if (isFrontOn) - { - aType = V3d_SLICE; - } - else - { - aType = V3d_BACK; - } - } - else if (isFrontOn) - { - aType = V3d_FRONT; - } - - return aType; -} - -//============================================================================= -//function : SetZCueingDepth -//purpose : -//============================================================================= -void V3d_View::SetZCueingDepth (const Standard_Real theDepth) -{ - Standard_Real aFront = myView->DepthCueingFrontPlane(); - Standard_Real aBack = myView->DepthCueingBackPlane(); - Standard_Real aWidth = aFront - aBack; - aFront = theDepth + aWidth / 2.; - aBack = theDepth - aWidth / 2.; - myView->SetDepthCueingBackPlane (aBack); - myView->SetDepthCueingFrontPlane (aFront); -} - -//============================================================================= -//function : SetZCueingWidth -//purpose : -//============================================================================= -void V3d_View::SetZCueingWidth (const Standard_Real theWidth) -{ - V3d_BadValue_Raise_if (theWidth <= 0., "V3d_View::SetZCueingWidth, bad width"); - - Standard_Real aFront = myView->DepthCueingFrontPlane(); - Standard_Real aBack = myView->DepthCueingBackPlane(); - Standard_Real aDepth = (aFront + aBack) / 2.0; - aFront = aDepth + theWidth / 2.0; - aBack = aDepth - theWidth / 2.0; - myView->SetDepthCueingBackPlane (aBack); - myView->SetDepthCueingFrontPlane (aFront); -} - -//============================================================================= -//function : SetZCueingOn -//purpose : -//============================================================================= -void V3d_View::SetZCueingOn() -{ - myView->SetDepthCueingOn (Standard_True); -} - -//============================================================================= -//function : SetZCueingOff -//purpose : -//============================================================================= -void V3d_View::SetZCueingOff() -{ - myView->SetDepthCueingOn (Standard_False); -} - -//============================================================================= -//function : ZCueing -//purpose : -//============================================================================= -Standard_Boolean V3d_View::ZCueing (Standard_Real& theDepth, Standard_Real& theWidth) const -{ - Standard_Boolean isOn = myView->DepthCueingIsOn(); - Standard_Real aFront = myView->DepthCueingFrontPlane(); - Standard_Real aBack = myView->DepthCueingBackPlane(); - - theWidth = aFront - aBack ; - theDepth = (aFront + aBack) / 2.; - - return isOn; -} diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index 52e2203334..9c86583f05 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -172,8 +172,6 @@ static NCollection_DoubleMap ViewerTest_myDrivers; static OpenGl_Caps ViewerTest_myDefaultCaps; -#define ZCLIPWIDTH 1. - static void OSWindowSetup(); static struct @@ -189,7 +187,6 @@ static struct //============================================================================== static int Start_Rot = 0; -static int ZClipIsOn = 0; int X_Motion = 0; // Current cursor position int Y_Motion = 0; int X_ButtonPress = 0; // Last ButtonPress position @@ -713,8 +710,6 @@ TCollection_AsciiString ViewerTest::ViewerInit (const Standard_Integer thePxLeft const Handle (V3d_View) aV3dView = ViewerTest::CurrentView(); aV3dView->SetComputedMode(Standard_False); MyHLRIsOn = aV3dView->ComputedMode(); - aV3dView->SetZClippingDepth(0.5); - aV3dView->SetZClippingWidth(ZCLIPWIDTH/2.); a3DViewer->SetDefaultBackgroundColor(Quantity_NOC_BLACK); if (toCreateViewer) @@ -1487,24 +1482,6 @@ void VT_ProcessKeyPress (const char* buf_ret) Ctx->UpdateCurrentViewer(); } } - else if (!strcasecmp (buf_ret, "Z")) - { - // ZCLIP - if ( ZClipIsOn ) { - cout << "ZClipping OFF" << endl; - ZClipIsOn = 0; - - aView->SetZClippingType(V3d_OFF); - aView->Redraw(); - } - else { - cout << "ZClipping ON" << endl; - ZClipIsOn = 1; - - aView->SetZClippingType(V3d_FRONT); - aView->Redraw(); - } - } else if (!strcasecmp (buf_ret, ",")) { ViewerTest::GetAISContext()->HilightNextDetected(ViewerTest::CurrentView()); @@ -1663,41 +1640,6 @@ void VT_ProcessButton3Release() } } -//============================================================================== -//function : ProcessZClipMotion -//purpose : Zoom -//============================================================================== - -void ProcessZClipMotion() -{ - Handle(V3d_View) a3DView = ViewerTest::CurrentView(); - if ( Abs(X_Motion - X_ButtonPress) > 2 ) { - - //Quantity_Length VDX, VDY; - //a3DView->Size(VDX,VDY); - //Standard_Real VDZ = a3DView->ZSize(); - //printf("View size (%lf,%lf,%lf)\n", VDX, VDY, VDZ); - - Quantity_Length aDx = a3DView->Convert(X_Motion - X_ButtonPress); - - // Front = Depth + width/2. - Standard_Real aDepth = 0.5; - Standard_Real aWidth = 0.1; - a3DView->ZClipping(aDepth,aWidth); - - aDepth += aDx; - - //printf("dx %lf Depth %lf Width %lf\n", dx, D, W); - - a3DView->SetZClippingDepth(aDepth); - - a3DView->Redraw(); - - X_ButtonPress = X_Motion; - Y_ButtonPress = Y_Motion; - } -} - //============================================================================== //function : ProcessControlButton1Motion //purpose : Zoom @@ -2205,27 +2147,9 @@ static LRESULT WINAPI ViewerWindowProc( HWND hwnd, VT_ProcessControlButton3Motion(); } } -#ifdef BUG - else if ( fwKeys & MK_SHIFT ) { - if ( fwKeys & MK_MBUTTON || - ((fwKeys&MK_LBUTTON) && - (fwKeys&MK_RBUTTON) ) ) { - cout << "ProcessZClipMotion()" << endl; - ProcessZClipMotion(); - } - } -#endif else if (GetWindowHandle (VT_GetWindow()) == hwnd) { - if ((fwKeys & MK_MBUTTON - || ((fwKeys & MK_LBUTTON) && (fwKeys & MK_RBUTTON)))) - { - ProcessZClipMotion(); - } - else - { - VT_ProcessMotion(); - } + VT_ProcessMotion(); } } break; @@ -2463,30 +2387,6 @@ int ViewerMainLoop(Standard_Integer argc, const char** argv) // remove all the ButtonMotionMaskr while( XCheckMaskEvent( aDisplay, ButtonMotionMask, &aReport) ) ; - if ( ZClipIsOn && aReport.xmotion.state & ShiftMask ) { - if ( Abs(X_Motion - X_ButtonPress) > 2 ) { - - Quantity_Length VDX, VDY; - - ViewerTest::CurrentView()->Size(VDX,VDY); - Standard_Real VDZ =0 ; - VDZ = ViewerTest::CurrentView()->ZSize(); - - printf("%f,%f,%f\n", VDX, VDY, VDZ); - - Quantity_Length dx = 0 ; - dx = ViewerTest::CurrentView()->Convert(X_Motion - X_ButtonPress); - - cout << dx << endl; - - dx = dx / VDX * VDZ; - - cout << dx << endl; - - ViewerTest::CurrentView()->Redraw(); - } - } - if ( aReport.xmotion.state & ControlMask ) { if ( aReport.xmotion.state & Button1Mask ) { ProcessControlButton1Motion(); @@ -6203,119 +6103,6 @@ static Standard_Integer VChangeSelected (Draw_Interpretor& di, return 0; } -//======================================================================= -//function : VZClipping -//purpose : Gets or sets ZClipping mode, width and depth -//======================================================================= -static Standard_Integer VZClipping (Draw_Interpretor& di, - Standard_Integer argc, - const char ** argv) -{ - if(argc>4) - { - di << "Usage : " << argv[0] << " [mode] [depth width]\n" - <<"mode = OFF|BACK|FRONT|SLICE depth = [0..1] width = [0..1]\n"; - return -1; - } - Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext(); - if(aContext.IsNull()) - { - di << "use 'vinit' command before " << argv[0] << "\n"; - return 1; - } - Handle(V3d_View) aView = ViewerTest::CurrentView(); - V3d_TypeOfZclipping aZClippingMode = V3d_OFF; - if(argc==1) - { - TCollection_AsciiString aZClippingModeString; - Quantity_Length aDepth, aWidth; - aZClippingMode = aView->ZClipping(aDepth, aWidth); - switch (aZClippingMode) - { - case V3d_OFF: - aZClippingModeString.Copy("OFF"); - break; - case V3d_BACK: - aZClippingModeString.Copy("BACK"); - break; - case V3d_FRONT: - aZClippingModeString.Copy("FRONT"); - break; - case V3d_SLICE: - aZClippingModeString.Copy("SLICE"); - break; - default: - aZClippingModeString.Copy(TCollection_AsciiString(aZClippingMode)); - break; - } - di << "ZClippingMode = " << aZClippingModeString.ToCString() << "\n" - << "ZClipping depth = " << aDepth << "\n" - << "ZClipping width = " << aWidth << "\n"; - } - else - { - if(argc !=3) - { - Standard_Integer aStatus = 0; - if ( strcmp (argv [1], "OFF") == 0 ) { - aStatus = 1; - aZClippingMode = V3d_OFF; - } - if ( strcmp (argv [1], "BACK") == 0 ) { - aStatus = 1; - aZClippingMode = V3d_BACK; - } - if ( strcmp (argv [1], "FRONT") == 0 ) { - aStatus = 1; - aZClippingMode = V3d_FRONT; - } - if ( strcmp (argv [1], "SLICE") == 0 ) { - aStatus = 1; - aZClippingMode = V3d_SLICE; - } - if (aStatus != 1) - { - di << "Bad mode; Usage : " << argv[0] << " [mode] [depth width]\n" - << "mode = OFF|BACK|FRONT|SLICE depth = [0..1] width = [0..1]\n"; - return 1; - } - aView->SetZClippingType(aZClippingMode); - } - if(argc >2) - { - Quantity_Length aDepth = 0., aWidth = 1.; - if(argc == 3) - { - aDepth = Draw::Atof (argv[1]); - aWidth = Draw::Atof (argv[2]); - } - else if(argc == 4) - { - aDepth = Draw::Atof (argv[2]); - aWidth = Draw::Atof (argv[3]); - } - - if(aDepth<0. || aDepth>1.) - { - di << "Bad depth; Usage : " << argv[0] << " [mode] [depth width]\n" - << "mode = OFF|BACK|FRONT|SLICE depth = [0..1] width = [0..1]\n"; - return 1; - } - if(aWidth<0. || aWidth>1.) - { - di << "Bad width; Usage : " << argv[0] << " [mode] [depth width]\n" - << "mode = OFF|BACK|FRONT|SLICE depth = [0..1] width = [0..1]\n"; - return 1; - } - - aView->SetZClippingDepth(aDepth); - aView->SetZClippingWidth(aWidth); - } - aView->Redraw(); - } - return 0; -} - //======================================================================= //function : VNbSelected //purpose : Returns number of selected objects @@ -9472,11 +9259,6 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands) "vchangeselected shape" "- adds to shape to selection or remove one from it", __FILE__, VChangeSelected, group); - theCommands.Add("vzclipping", - "vzclipping [mode] [depth width]\n" - "- mode = OFF|BACK|FRONT|SLICE depth = [0..1] width = [0..1]\n" - "- gets or sets ZClipping mode, width and depth", - __FILE__,VZClipping,group); theCommands.Add ("vnbselected", "vnbselected" "\n\t\t: Returns number of selected objects", __FILE__, VNbSelected, group); diff --git a/tests/bugs/vis/bug270_1 b/tests/bugs/vis/bug270_1 deleted file mode 100755 index c078cc8c9b..0000000000 --- a/tests/bugs/vis/bug270_1 +++ /dev/null @@ -1,26 +0,0 @@ -puts "========" -puts "OCC270" -puts "========" - -vinit -box box 10 10 10 -vaxis axis 1 1 1 7 7 7 -vdisplay box -vdisplay axis -vsetdispmode 1 - -set x1 172 -set y1 223 - -checkcolor ${x1} ${y1} 1 0 0 - -vzclipping FRONT -set ZClippingMode [lindex [vzclipping] 2] -if {${ZClippingMode} != "FRONT"} { - puts "OCC270: Error (ZClippingMode != FRONT)" -} - -checkcolor ${x1} ${y1} 1 0 0 -vfit - -checkview -screenshot -3d -path ${imagedir}/${test_image}.png diff --git a/tests/bugs/vis/bug270_2 b/tests/bugs/vis/bug270_2 deleted file mode 100755 index 09ae4364a2..0000000000 --- a/tests/bugs/vis/bug270_2 +++ /dev/null @@ -1,26 +0,0 @@ -puts "========" -puts "OCC270" -puts "========" - -vinit -box box 10 10 10 -vaxis axis 1 1 1 7 7 7 -vdisplay box -vdisplay axis -vsetdispmode 0 - -set x1 172 -set y1 223 - -checkcolor ${x1} ${y1} 1 0 0 - -vzclipping FRONT -set ZClippingMode [lindex [vzclipping] 2] -if {${ZClippingMode} != "FRONT"} { - puts "OCC270: Error (ZClippingMode != FRONT)" -} - -checkcolor ${x1} ${y1} 1 0 0 -vfit - -checkview -screenshot -3d -path ${imagedir}/${test_image}.png