SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Geometry.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 #ifndef smtk_session_polygon_vtk_Geometry_h
11 #define smtk_session_polygon_vtk_Geometry_h
12 
13 #include "smtk/session/polygon/vtk/vtkPolygonOperationsExtModule.h"
14 
15 #include "smtk/session/polygon/internal/Config.h"
16 
17 #include "smtk/extension/vtk/geometry/Geometry.h"
18 
19 #include "smtk/geometry/Cache.h"
20 
21 #include "smtk/PublicPointerDefs.h"
22 
23 namespace smtk
24 {
25 namespace session
26 {
27 namespace polygon
28 {
29 
30 class Resource;
31 
32 namespace vtk
33 {
34 
38 class VTKPOLYGONOPERATIONSEXT_EXPORT Geometry
39  : public smtk::geometry::Cache<smtk::extension::vtk::geometry::Geometry>
40 {
41 public:
45  using DataType = Superclass::DataType;
46  using VertexPtr = internal::VertexPtr;
47  using EdgePtr = internal::EdgePtr;
48  using PolyModel = internal::pmodel*;
49 
50  Geometry(const std::shared_ptr<smtk::session::polygon::Resource>& parent);
51  ~Geometry() override = default;
52 
53  smtk::geometry::Resource::Ptr resource() const override;
54  void queryGeometry(const smtk::resource::PersistentObject::Ptr& obj, CacheEntry& entry)
55  const override;
56  int dimension(const smtk::resource::PersistentObject::Ptr& obj) const override;
57  Purpose purpose(const smtk::resource::PersistentObject::Ptr& obj) const override;
58  void update() const override;
59 
60  void geometricBounds(const DataType&, BoundingBox& bbox) const override;
61 
62 protected:
63  void updateVertex(const PolyModel&, const VertexPtr&, CacheEntry& entry) const;
64  void updateEdge(const PolyModel&, const EdgePtr&, CacheEntry& entry) const;
65  void updateFace(const PolyModel&, const smtk::model::EntityPtr&, CacheEntry& entry) const;
66 
67  std::weak_ptr<smtk::session::polygon::Resource> m_parent;
68 };
69 
70 } // namespace vtk
71 } // namespace polygon
72 } // namespace session
73 } // namespace smtk
74 
75 #endif // smtk_session_polygon_vtk_Geometry_h
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
PublicPointerDefs.h
smtk::extension::vtk::geometry::Geometry
A base class for geometry providers that will supply VTK data.
Definition: Geometry.h:51
smtk::model::EntityPtr
smtk::shared_ptr< smtk::model::Entity > EntityPtr
Definition: PublicPointerDefs.h:423
smtk::session::polygon::internal::pmodel
Definition: Model.h:34
smtk::geometry::Geometry::BoundingBox
std::array< double, 6 > BoundingBox
A bounding box is represented as an array of 6 numbers, ordered xmin, xmax, ymin, ymax,...
Definition: Geometry.h:78
smtkTypeMacro
#define smtkTypeMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:51
smtk::geometry::Cache
A geometry provider that uses a cache to answer queries.
Definition: Cache.h:38
smtk::extension::vtk::geometry::Geometry::Purpose
Purpose
The contextual purpose of geometry supplied by the provider.
Definition: Geometry.h:62
smtkSuperclassMacro
#define smtkSuperclassMacro(...)
Add a typedef to the superclass of this class.
Definition: SharedFromThis.h:87
smtk::session::polygon::vtk::Geometry
A VTK geometry provider for the polygon session.
Definition: Geometry.h:38