Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:35

0001 // Created on: 2016-10-20
0002 // Created by: Irina KRYLOVA
0003 // Copyright (c) 2016 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 
0017 #ifndef _XCAFView_Object_HeaderFile
0018 #define _XCAFView_Object_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <gp_Pln.hxx>
0024 #include <gp_Pnt.hxx>
0025 #include <TColgp_HArray1OfPnt.hxx>
0026 #include <TCollection_HAsciiString.hxx>
0027 #include <XCAFView_ProjectionType.hxx>
0028 
0029 class XCAFView_Object;
0030 DEFINE_STANDARD_HANDLE(XCAFView_Object, Standard_Transient)
0031                             
0032 //! Access object for saved view
0033 class XCAFView_Object : public Standard_Transient
0034 {
0035 
0036 public:
0037   
0038   Standard_EXPORT XCAFView_Object();
0039   
0040   Standard_EXPORT XCAFView_Object(const Handle(XCAFView_Object)& theObj);
0041 
0042   void SetName(Handle(TCollection_HAsciiString) theName)
0043   {
0044     myName = theName;
0045   }
0046 
0047   Handle(TCollection_HAsciiString) Name()
0048   {
0049     return myName;
0050   }
0051 
0052   void SetType(XCAFView_ProjectionType theType)
0053   {
0054     myType = theType;
0055   }
0056 
0057   XCAFView_ProjectionType Type()
0058   {
0059     return myType;
0060   }
0061 
0062   void SetProjectionPoint(const gp_Pnt& thePoint)
0063   {
0064     myProjectionPoint = thePoint;
0065   }
0066 
0067   gp_Pnt ProjectionPoint()
0068   {
0069     return myProjectionPoint;
0070   }
0071 
0072   void SetViewDirection(const gp_Dir& theDirection)
0073   {
0074     myViewDirection = theDirection;
0075   }
0076 
0077   gp_Dir ViewDirection()
0078   {
0079     return myViewDirection;
0080   }
0081 
0082   void SetUpDirection(const gp_Dir& theDirection)
0083   {
0084     myUpDirection = theDirection;
0085   }
0086 
0087   gp_Dir UpDirection()
0088   {
0089     return myUpDirection;
0090   }
0091 
0092   void SetZoomFactor(Standard_Real theZoomFactor)
0093   {
0094     myZoomFactor = theZoomFactor;
0095   }
0096 
0097   Standard_Real ZoomFactor()
0098   {
0099     return myZoomFactor;
0100   }
0101 
0102   void SetWindowHorizontalSize(Standard_Real theSize)
0103   {
0104     myWindowHorizontalSize = theSize;
0105   }
0106 
0107   Standard_Real WindowHorizontalSize()
0108   {
0109     return myWindowHorizontalSize;
0110   }
0111 
0112   void SetWindowVerticalSize(Standard_Real theSize)
0113   {
0114     myWindowVerticalSize = theSize;
0115   }
0116 
0117   Standard_Real WindowVerticalSize()
0118   {
0119     return myWindowVerticalSize;
0120   }
0121 
0122   void SetClippingExpression(Handle(TCollection_HAsciiString) theExpression)
0123   {
0124     myClippingExpression = theExpression;
0125   }
0126 
0127   Handle(TCollection_HAsciiString) ClippingExpression()
0128   {
0129     return myClippingExpression;
0130   }
0131 
0132   void UnsetFrontPlaneClipping()
0133   {
0134     myFrontPlaneClipping = Standard_False;
0135   }
0136 
0137   Standard_Boolean HasFrontPlaneClipping()
0138   {
0139     return myFrontPlaneClipping;
0140   }
0141 
0142   void SetFrontPlaneDistance(Standard_Real theDistance)
0143   {
0144     myFrontPlaneDistance = theDistance;
0145     myFrontPlaneClipping = Standard_True;
0146   }
0147 
0148   Standard_Real FrontPlaneDistance()
0149   {
0150     return myFrontPlaneDistance;
0151   }
0152 
0153   void UnsetBackPlaneClipping()
0154   {
0155     myBackPlaneClipping = Standard_False;
0156   }
0157 
0158   Standard_Boolean HasBackPlaneClipping()
0159   {
0160     return myBackPlaneClipping;
0161   }
0162 
0163   void SetBackPlaneDistance(Standard_Real theDistance)
0164   {
0165     myBackPlaneDistance = theDistance;
0166     myBackPlaneClipping = Standard_True;
0167   }
0168 
0169   Standard_Real BackPlaneDistance()
0170   {
0171     return myBackPlaneDistance;
0172   }
0173 
0174   void SetViewVolumeSidesClipping(Standard_Boolean theViewVolumeSidesClipping)
0175   {
0176     myViewVolumeSidesClipping = theViewVolumeSidesClipping;
0177   }
0178 
0179   Standard_Boolean HasViewVolumeSidesClipping()
0180   {
0181     return myViewVolumeSidesClipping;
0182   }
0183 
0184   void CreateGDTPoints(const Standard_Integer theLenght)
0185   {
0186     if (theLenght > 0)
0187       myGDTPoints = new TColgp_HArray1OfPnt(1, theLenght);
0188   }
0189 
0190   Standard_Boolean HasGDTPoints()
0191   {
0192     return (!myGDTPoints.IsNull());
0193   }
0194 
0195   Standard_Integer NbGDTPoints()
0196   {
0197     if (myGDTPoints.IsNull())
0198       return 0;
0199     return myGDTPoints->Length();
0200   }
0201 
0202   void SetGDTPoint(const Standard_Integer theIndex, const gp_Pnt& thePoint)
0203   {
0204     if (myGDTPoints.IsNull())
0205       return;
0206     if (theIndex > 0 && theIndex <= myGDTPoints->Length())
0207       myGDTPoints->SetValue(theIndex, thePoint);
0208   }
0209 
0210   gp_Pnt GDTPoint(const Standard_Integer theIndex)
0211   {
0212     if (myGDTPoints.IsNull())
0213       return gp_Pnt();
0214     if (theIndex > 0 && theIndex <= myGDTPoints->Length())
0215       return myGDTPoints->Value(theIndex);
0216     else
0217       return gp_Pnt();
0218   }
0219   
0220   DEFINE_STANDARD_RTTIEXT(XCAFView_Object,Standard_Transient)
0221 
0222 private:
0223 
0224   Handle(TCollection_HAsciiString) myName;
0225   XCAFView_ProjectionType myType;
0226   gp_Pnt myProjectionPoint;
0227   gp_Dir myViewDirection;
0228   gp_Dir myUpDirection;
0229   Standard_Real myZoomFactor;
0230   Standard_Real myWindowHorizontalSize;
0231   Standard_Real myWindowVerticalSize;
0232   Handle(TCollection_HAsciiString) myClippingExpression;
0233   Standard_Boolean myFrontPlaneClipping;
0234   Standard_Real myFrontPlaneDistance;
0235   Standard_Boolean myBackPlaneClipping;
0236   Standard_Real myBackPlaneDistance;
0237   Standard_Boolean myViewVolumeSidesClipping;
0238   Handle(TColgp_HArray1OfPnt) myGDTPoints; // Point for each GDT to describe position of GDT frame in View.
0239 };
0240 
0241 #endif // _XCAFView_Object_HeaderFile