Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:00

0001 // Created on: 1993-02-03
0002 // Created by: CKY / Contract Toubro-Larsen ( Niraj RANGWALA )
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IGESDraw_PerspectiveView_HeaderFile
0018 #define _IGESDraw_PerspectiveView_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <gp_XYZ.hxx>
0025 #include <gp_XY.hxx>
0026 #include <IGESData_ViewKindEntity.hxx>
0027 class gp_Vec;
0028 class gp_Pnt;
0029 class gp_Pnt2d;
0030 class IGESData_TransfEntity;
0031 
0032 
0033 class IGESDraw_PerspectiveView;
0034 DEFINE_STANDARD_HANDLE(IGESDraw_PerspectiveView, IGESData_ViewKindEntity)
0035 
0036 //! defines IGESPerspectiveView, Type <410> Form <1>
0037 //! in package IGESDraw
0038 //!
0039 //! Supports a perspective view.
0040 //! Any geometric projection is defined by a view plane
0041 //! and the projectors that pass through the view plane.
0042 //! Projectors can be visualized as rays of light that
0043 //! form an image by passing through the viewed object
0044 //! and striking the view plane.
0045 //! The projectors are defined via a point called the
0046 //! Centre-of-Projection or the eye-point.
0047 //! A perspective view is formed by all projectors that
0048 //! emanate from the Centre-of-Projection and pass
0049 //! through the view plane.
0050 class IGESDraw_PerspectiveView : public IGESData_ViewKindEntity
0051 {
0052 
0053 public:
0054 
0055   
0056   Standard_EXPORT IGESDraw_PerspectiveView();
0057   
0058   //! This method is used to set the fields of the class
0059   //! PerspectiveView
0060   //! - aViewNumber         : The desired view
0061   //! - aScaleFactor        : Scale factor
0062   //! - aViewNormalVector   : View plane normal vector (model space)
0063   //! - aViewReferencePoint : View reference point     (model space)
0064   //! - aCenterOfProjection : Center Of Projection     (model space)
0065   //! - aViewUpVector       : View up vector           (model space)
0066   //! - aViewPlaneDistance  : View plane distance      (model space)
0067   //! - aTopLeft            : Top-left point of clipping window
0068   //! - aBottomRight        : Bottom-right point of clipping window
0069   //! - aDepthClip          : Depth clipping indicator
0070   //! - aBackPlaneDistance  : Distance of back clipping plane
0071   //! - aFrontPlaneDistance : Distance of front clipping plane
0072   Standard_EXPORT void Init (const Standard_Integer aViewNumber, const Standard_Real aScaleFactor, const gp_XYZ& aViewNormalVector, const gp_XYZ& aViewReferencePoint, const gp_XYZ& aCenterOfProjection, const gp_XYZ& aViewUpVector, const Standard_Real aViewPlaneDistance, const gp_XY& aTopLeft, const gp_XY& aBottomRight, const Standard_Integer aDepthClip, const Standard_Real aBackPlaneDistance, const Standard_Real aFrontPlaneDistance);
0073   
0074   //! Returns True (for a single view)
0075   Standard_EXPORT Standard_Boolean IsSingle() const Standard_OVERRIDE;
0076   
0077   //! Returns 1 (single view)
0078   Standard_EXPORT Standard_Integer NbViews() const Standard_OVERRIDE;
0079   
0080   //! For a single view, returns <me> whatever <num>
0081   Standard_EXPORT Handle(IGESData_ViewKindEntity) ViewItem (const Standard_Integer num) const Standard_OVERRIDE;
0082   
0083   //! returns the view number associated with <me>
0084   Standard_EXPORT Standard_Integer ViewNumber() const;
0085   
0086   //! returns the scale factor associated with <me>
0087   Standard_EXPORT Standard_Real ScaleFactor() const;
0088   
0089   //! returns the View plane normal vector (model space)
0090   Standard_EXPORT gp_Vec ViewNormalVector() const;
0091   
0092   //! returns the View reference point (model space)
0093   Standard_EXPORT gp_Pnt ViewReferencePoint() const;
0094   
0095   //! returns the Center Of Projection (model space)
0096   Standard_EXPORT gp_Pnt CenterOfProjection() const;
0097   
0098   //! returns the View up vector (model space)
0099   Standard_EXPORT gp_Vec ViewUpVector() const;
0100   
0101   //! returns the View plane distance (model space)
0102   Standard_EXPORT Standard_Real ViewPlaneDistance() const;
0103   
0104   //! returns the top left point of the clipping window
0105   Standard_EXPORT gp_Pnt2d TopLeft() const;
0106   
0107   //! returns the bottom right point of the clipping window
0108   Standard_EXPORT gp_Pnt2d BottomRight() const;
0109   
0110   //! returns the Depth clipping indicator
0111   //! 0 = No depth clipping
0112   //! 1 = Back clipping plane ON
0113   //! 2 = Front clipping plane ON
0114   //! 3 = Back and front clipping planes ON
0115   Standard_EXPORT Standard_Integer DepthClip() const;
0116   
0117   //! returns the View coordinate denoting the location of
0118   //! the back clipping plane
0119   Standard_EXPORT Standard_Real BackPlaneDistance() const;
0120   
0121   //! returns the View coordinate denoting the location of
0122   //! the front clipping plane
0123   Standard_EXPORT Standard_Real FrontPlaneDistance() const;
0124   
0125   //! returns the Transformation Matrix
0126   Standard_EXPORT Handle(IGESData_TransfEntity) ViewMatrix() const;
0127   
0128   //! returns XYX from the Model space to the View space by
0129   //! applying the View Matrix
0130   Standard_EXPORT gp_XYZ ModelToView (const gp_XYZ& coords) const;
0131 
0132 
0133 
0134 
0135   DEFINE_STANDARD_RTTIEXT(IGESDraw_PerspectiveView,IGESData_ViewKindEntity)
0136 
0137 protected:
0138 
0139 
0140 
0141 
0142 private:
0143 
0144 
0145   Standard_Integer theViewNumber;
0146   Standard_Real theScaleFactor;
0147   gp_XYZ theViewNormalVector;
0148   gp_XYZ theViewReferencePoint;
0149   gp_XYZ theCenterOfProjection;
0150   gp_XYZ theViewUpVector;
0151   Standard_Real theViewPlaneDistance;
0152   gp_XY theTopLeft;
0153   gp_XY theBottomRight;
0154   Standard_Integer theDepthClip;
0155   Standard_Real theBackPlaneDistance;
0156   Standard_Real theFrontPlaneDistance;
0157 
0158 
0159 };
0160 
0161 
0162 
0163 
0164 
0165 
0166 
0167 #endif // _IGESDraw_PerspectiveView_HeaderFile