Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-26 09:48:07

0001 // Created on: 1997-06-06
0002 // Created by: Alexander BRIVIN
0003 // Copyright (c) 1997-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 _VrmlConverter_Projector_HeaderFile
0018 #define _VrmlConverter_Projector_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <HLRAlgo_Projector.hxx>
0024 #include <Vrml_PerspectiveCamera.hxx>
0025 #include <Vrml_OrthographicCamera.hxx>
0026 #include <Vrml_DirectionalLight.hxx>
0027 #include <Vrml_PointLight.hxx>
0028 #include <Vrml_SpotLight.hxx>
0029 #include <VrmlConverter_TypeOfCamera.hxx>
0030 #include <VrmlConverter_TypeOfLight.hxx>
0031 #include <Vrml_MatrixTransform.hxx>
0032 #include <Standard_Transient.hxx>
0033 #include <TopoDS_Shape.hxx>
0034 #include <NCollection_Array1.hxx>
0035 #include <Standard_OStream.hxx>
0036 
0037 //! defines projector and calculates properties of cameras and lights from Vrml
0038 //! (OrthograpicCamera, PerspectiveCamera, DirectionalLight, PointLight, SpotLight
0039 //! and MatrixTransform) to display all scene shapes with arbitrary locations
0040 //! for requested the Projection Vector, High Point Direction and the Focus
0041 //! and adds them (method Add) to anOSream.
0042 class VrmlConverter_Projector : public Standard_Transient
0043 {
0044 
0045 public:
0046   Standard_EXPORT VrmlConverter_Projector(
0047     const NCollection_Array1<TopoDS_Shape>& Shapes,
0048     const double                            Focus,
0049     const double                            DX,
0050     const double                            DY,
0051     const double                            DZ,
0052     const double                            XUp,
0053     const double                            YUp,
0054     const double                            ZUp,
0055     const VrmlConverter_TypeOfCamera        Camera = VrmlConverter_NoCamera,
0056     const VrmlConverter_TypeOfLight         Light  = VrmlConverter_NoLight);
0057 
0058   Standard_EXPORT void SetCamera(const VrmlConverter_TypeOfCamera aCamera);
0059 
0060   Standard_EXPORT VrmlConverter_TypeOfCamera Camera() const;
0061 
0062   Standard_EXPORT void SetLight(const VrmlConverter_TypeOfLight aLight);
0063 
0064   Standard_EXPORT VrmlConverter_TypeOfLight Light() const;
0065 
0066   //! Adds into anOStream if they are defined in Create.
0067   //! PerspectiveCamera,
0068   //! OrthographicCamera,
0069   //! DirectionLight,
0070   //! PointLight,
0071   //! SpotLight
0072   //! with MatrixTransform from VrmlConverter;
0073   Standard_EXPORT void Add(Standard_OStream& anOStream) const;
0074 
0075   Standard_EXPORT HLRAlgo_Projector Projector() const;
0076 
0077   DEFINE_STANDARD_RTTIEXT(VrmlConverter_Projector, Standard_Transient)
0078 
0079 private:
0080   HLRAlgo_Projector          myProjector;
0081   Vrml_PerspectiveCamera     myPerspectiveCamera;
0082   Vrml_OrthographicCamera    myOrthographicCamera;
0083   Vrml_DirectionalLight      myDirectionalLight;
0084   Vrml_PointLight            myPointLight;
0085   Vrml_SpotLight             mySpotLight;
0086   VrmlConverter_TypeOfCamera myTypeOfCamera;
0087   VrmlConverter_TypeOfLight  myTypeOfLight;
0088   Vrml_MatrixTransform       myMatrixTransform;
0089 };
0090 
0091 #endif // _VrmlConverter_Projector_HeaderFile