X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOCCViewer%2FOCCViewer_ClipPlane.h;h=fa9ed9a29356bd0bb3b0b47b9881bee72a2de310;hb=e6caa123c65e3c4a3017364ec5bb4225fd898465;hp=8b5906f03a0986979d47d0a56c09b66b8835f657;hpb=fb6bb99036f71260be8090f7107f2ddbe275d839;p=modules%2Fgui.git diff --git a/src/OCCViewer/OCCViewer_ClipPlane.h b/src/OCCViewer/OCCViewer_ClipPlane.h index 8b5906f03..fa9ed9a29 100644 --- a/src/OCCViewer/OCCViewer_ClipPlane.h +++ b/src/OCCViewer/OCCViewer_ClipPlane.h @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -28,45 +28,96 @@ #include #include -enum ClipPlaneMode { Absolute, Relative }; - /*! - \class OrientedPlane - \brief Parameters of clipping plane in relative mode + \class OCCViewer_ClipPlane + Definition of OCC viewer clipping plane. */ -class OCCVIEWER_EXPORT OrientedPlane { +class OCCVIEWER_EXPORT OCCViewer_ClipPlane +{ +public: - public: - OrientedPlane(); - OrientedPlane& operator =(const OrientedPlane& other); + enum PlaneMode + { + Absolute, + Relative + }; - public: - Standard_Integer Orientation; - Standard_Real Distance; - Standard_Real Rotation1; - Standard_Real Rotation2; -}; + enum AbsoluteOrientationType + { + AbsoluteCustom, + AbsoluteXY, + AbsoluteYZ, + AbsoluteZX + }; + + enum RelativeOrientationType + { + RelativeXY, + RelativeYZ, + RelativeZX + }; + +public: -class OCCVIEWER_EXPORT OCCViewer_ClipPlane -{ - - public: OCCViewer_ClipPlane(); - OCCViewer_ClipPlane& operator =(const OCCViewer_ClipPlane& other); - - public: - OrientedPlane RelativeMode; - Standard_Real X; - Standard_Real Y; - Standard_Real Z; - Standard_Real Dx; - Standard_Real Dy; - Standard_Real Dz; - Standard_Integer Orientation; - bool IsInvert; + OCCViewer_ClipPlane& operator =( const OCCViewer_ClipPlane& theOther ); + +// Parameters +public: + + // Plane definition mode + PlaneMode Mode; + + // Is active bool IsOn; - ClipPlaneMode PlaneMode; + // Plane position + double X; + double Y; + double Z; + + // Orientation type + int OrientationType; + + // Plane orientation (depends on mode) + union + { + struct + { + bool IsInvert; + double Dx; + double Dy; + double Dz; + } AbsoluteOrientation; + + struct + { + double Rotation1; + double Rotation2; + } RelativeOrientation; + }; + +// Tools +public: + + // Converts defined orientation to direction. + void OrientationToXYZ( double& theDx, double& theDy, double& theDz ) const; + + // Converts absoulte orientation to relative equivalent. + static void DXYZToRelative( const double theDx, + const double theDy, + const double theDz, + const int theRelativeType, + double& theRotation1, + double& theRotation2 ); + + // Converts relative orientation to absolute equivalent. + static void RelativeToDXYZ( const int theRelativeType, + const double theRotation1, + const double theRotation2, + double& theDx, + double& theDy, + double& theDz ); }; typedef std::vector ClipPlanesList;