Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:16:34

0001 // Created on: 2003-12-17
0002 // Created by: Alexander SOLOVYOV
0003 // Copyright (c) 2003-2014 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 #ifndef _MeshVS_Tool_HeaderFile
0017 #define _MeshVS_Tool_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <NCollection_Array1.hxx>
0024 class Graphic3d_AspectFillArea3d;
0025 class MeshVS_Drawer;
0026 class Graphic3d_MaterialAspect;
0027 class Graphic3d_AspectLine3d;
0028 class Graphic3d_AspectMarker3d;
0029 class Graphic3d_AspectText3d;
0030 class gp_Vec;
0031 
0032 //! This class provides auxiliary methods to create different aspects
0033 class MeshVS_Tool
0034 {
0035 public:
0036   DEFINE_STANDARD_ALLOC
0037 
0038   //! Creates fill area aspect with values from Drawer according to keys from DrawerAttribute
0039   Standard_EXPORT static occ::handle<Graphic3d_AspectFillArea3d> CreateAspectFillArea3d(
0040     const occ::handle<MeshVS_Drawer>& theDr,
0041     const bool                        UseDefaults = true);
0042 
0043   //! Creates fill aspect with values from Drawer according to keys from DrawerAttribute
0044   //! and specific material aspect
0045   Standard_EXPORT static occ::handle<Graphic3d_AspectFillArea3d> CreateAspectFillArea3d(
0046     const occ::handle<MeshVS_Drawer>& theDr,
0047     const Graphic3d_MaterialAspect&   Mat,
0048     const bool                        UseDefaults = true);
0049 
0050   //! Creates line aspect with values from Drawer according to keys from DrawerAttribute
0051   Standard_EXPORT static occ::handle<Graphic3d_AspectLine3d> CreateAspectLine3d(
0052     const occ::handle<MeshVS_Drawer>& theDr,
0053     const bool                        UseDefaults = true);
0054 
0055   //! Creates marker aspect with values from Drawer according to keys from DrawerAttribute
0056   Standard_EXPORT static occ::handle<Graphic3d_AspectMarker3d> CreateAspectMarker3d(
0057     const occ::handle<MeshVS_Drawer>& theDr,
0058     const bool                        UseDefaults = true);
0059 
0060   //! Creates text aspect with values from Drawer according to keys from DrawerAttribute
0061   Standard_EXPORT static occ::handle<Graphic3d_AspectText3d> CreateAspectText3d(
0062     const occ::handle<MeshVS_Drawer>& theDr,
0063     const bool                        UseDefaults = true);
0064 
0065   //! Get one of normals to polygon described by these points.
0066   //! If the polygon isn't planar, function returns false
0067   Standard_EXPORT static bool GetNormal(const NCollection_Array1<double>& Nodes, gp_Vec& Norm);
0068 
0069   //! Get an average of normals to non-planar polygon described by these points or compute
0070   //! normal of planar polygon. If the polygon isn't planar, function returns false
0071   Standard_EXPORT static bool GetAverageNormal(const NCollection_Array1<double>& Nodes,
0072                                                gp_Vec&                           Norm);
0073 };
0074 
0075 #endif // _MeshVS_Tool_HeaderFile