|
||||
File indexing completed on 2025-01-18 10:05:00
0001 // Created on: 1993-09-23 0002 // Created by: Jean Louis FRENKEL 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 _StdPrs_ShadedShape_HeaderFile 0018 #define _StdPrs_ShadedShape_HeaderFile 0019 0020 #include <Prs3d_Root.hxx> 0021 #include <Prs3d_Drawer.hxx> 0022 #include <StdPrs_Volume.hxx> 0023 0024 class Graphic3d_ArrayOfSegments; 0025 class Graphic3d_ArrayOfTriangles; 0026 class TopoDS_Shape; 0027 class BRep_Builder; 0028 class TopoDS_Compound; 0029 0030 //! Auxiliary procedures to prepare Shaded presentation of specified shape. 0031 class StdPrs_ShadedShape : public Prs3d_Root 0032 { 0033 public: 0034 0035 //! Shades <theShape>. 0036 //! @param theVolumeType defines the way how to interpret input shapes - as Closed volumes (to activate back-face 0037 //! culling and capping plane algorithms), as Open volumes (shells or solids with holes) 0038 //! or to perform Autodetection (would split input shape into two groups) 0039 Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& thePresentation, const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer, const StdPrs_Volume theVolume = StdPrs_Volume_Autodetection, const Handle(Graphic3d_Group)& theGroup = NULL); 0040 0041 //! Shades <theShape> with texture coordinates. 0042 //! @param theVolumeType defines the way how to interpret input shapes - as Closed volumes (to activate back-face 0043 //! culling and capping plane algorithms), as Open volumes (shells or solids with holes) 0044 //! or to perform Autodetection (would split input shape into two groups) 0045 Standard_EXPORT static void Add (const Handle(Prs3d_Presentation)& thePresentation, const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer, const Standard_Boolean theHasTexels, const gp_Pnt2d& theUVOrigin, const gp_Pnt2d& theUVRepeat, const gp_Pnt2d& theUVScale, const StdPrs_Volume theVolume = StdPrs_Volume_Autodetection, const Handle(Graphic3d_Group)& theGroup = NULL); 0046 0047 //! Searches closed and unclosed subshapes in shape structure and puts them 0048 //! into two compounds for separate processing of closed and unclosed sub-shapes 0049 Standard_EXPORT static void ExploreSolids (const TopoDS_Shape& theShape, const BRep_Builder& theBuilder, TopoDS_Compound& theClosed, TopoDS_Compound& theOpened, const Standard_Boolean theIgnore1DSubShape); 0050 0051 //! Computes wireframe presentation for free wires and vertices 0052 Standard_EXPORT static void AddWireframeForFreeElements (const Handle(Prs3d_Presentation)& thePrs, 0053 const TopoDS_Shape& theShape, 0054 const Handle(Prs3d_Drawer)& theDrawer); 0055 0056 //! Computes special wireframe presentation for faces without triangulation. 0057 Standard_EXPORT static void AddWireframeForFacesWithoutTriangles (const Handle(Prs3d_Presentation)& thePrs, 0058 const TopoDS_Shape& theShape, 0059 const Handle(Prs3d_Drawer)& theDrawer); 0060 0061 public: 0062 0063 //! Create primitive array with triangles for specified shape. 0064 //! @param theShape [in] the shape with precomputed triangulation 0065 static Handle(Graphic3d_ArrayOfTriangles) FillTriangles (const TopoDS_Shape& theShape) 0066 { 0067 gp_Pnt2d aDummy; 0068 return FillTriangles (theShape, Standard_False, aDummy, aDummy, aDummy); 0069 } 0070 0071 //! Create primitive array of triangles for specified shape. 0072 //! @param theShape the shape with precomputed triangulation 0073 //! @param theHasTexels define UV coordinates in primitive array 0074 //! @param theUVOrigin origin for UV coordinates 0075 //! @param theUVRepeat repeat parameters for UV coordinates 0076 //! @param theUVScale scale coefficients for UV coordinates 0077 //! @return triangles array or NULL if specified face does not have computed triangulation 0078 Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) FillTriangles (const TopoDS_Shape& theShape, 0079 const Standard_Boolean theHasTexels, 0080 const gp_Pnt2d& theUVOrigin, 0081 const gp_Pnt2d& theUVRepeat, 0082 const gp_Pnt2d& theUVScale); 0083 0084 //! Define primitive array of boundary segments for specified shape. 0085 //! @param theShape segments array or NULL if specified face does not have computed triangulation 0086 //! @param theUpperContinuity the most edge continuity class to be included to result (edges with more continuity will be ignored) 0087 Standard_EXPORT static Handle(Graphic3d_ArrayOfSegments) FillFaceBoundaries (const TopoDS_Shape& theShape, 0088 GeomAbs_Shape theUpperContinuity = GeomAbs_CN); 0089 0090 }; 0091 0092 #endif // _StdPrs_ShadedShape_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |