CuttingPlane.h
1 //##################################################################################################
2 //
3 // Ceetron Desktop Components
4 // Component: UnstructGrid
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2011, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeUnstructGrid/Base.h"
16 
17 #include "CeeCore/RefCountedObject.h"
18 #include "CeeCore/Vec3d.h"
19 #include "CeeCore/Color3f.h"
20 
21 #include <vector>
22 
23 namespace cee {
24 namespace ug {
25 
26 class CuttingPlaneData;
27 
28 //==================================================================================================
29 //
30 //
31 //
32 //==================================================================================================
33 class CEE_UG_EXPORT CuttingPlane : public RefCountedObject
34 {
35 public:
37  enum DrawStyle
38  {
42  LINE,
43  OUTLINE
44  };
45 
48  {
50  RELATIVE_SPACING
51  };
52 
53 public:
54  CuttingPlane();
55  virtual ~CuttingPlane();
56 
57  bool visible() const;
58  void setVisible(bool visible);
59  bool highlight() const;
60  void setHighlight(bool showHighlighted);
61 
62  bool planeSurfaceVisible() const;
63  void setPlaneSurfaceVisible(bool show);
64  DrawStyle drawStyle() const;
65  void setDrawStyle(DrawStyle drawStyle);
66  Color3f surfaceColor() const;
67  void setSurfaceColor(const Color3f& color);
68  float opacity() const;
69  void setOpacity(float opacity);
70  float specularIntensity() const;
71  void setSpecularIntensity(float intensity);
72  bool useSourcePartColor() const;
73  void setUseSourcePartColor(bool useSourcePartColor);
74  bool crinkleCutSurface() const;
75  void setCrinkleCutSurface(bool useCrinkleCutSurface);
76 
77  bool clipping() const;
78  void setClipping(bool enableClipping);
79 
80  Vec3d point() const;
81  void setPoint(Vec3d pointInPlane);
82  Vec3d normal() const;
83  void setNormal(Vec3d normal);
84  bool computeFromVisibleParts() const;
85  void setComputeFromVisibleParts(bool visiblePartsOnly);
86  bool alsoComputeFromUndeformedModel() const;
87  void setAlsoComputeFromUndeformedModel(bool alsoShowForUndeformedModel);
88 
89  int mapScalarResultId() const;
90  void setMapScalarResultId(int resultId);
91  int mapVectorResultId() const;
92  void setMapVectorResultId(int resultId);
93  int mapContourLinesResultId() const;
94  void setMapContourLinesResultId(int resultId);
95 
96  double vectorGridSpacing() const;
97  SpacingMode vectorGridSpacingMode() const;
98  void setVectorGridSpacing(SpacingMode mode, double spacing);
99  bool gridLinesVisible() const;
100  void setGridLinesVisible(bool visible);
101  bool projectVectorsOnPlane() const;
102  void setProjectVectorsOnPlane(bool project);
103 
104  bool isPrecomputed() const;
105 
106  double sampleScalarValue(int stateId, const Vec3d& samplePosition, size_t triangleIndex = cee::UNDEFINED_SIZE_T) const;
107  Vec3d sampleVector(int stateId, const Vec3d& samplePosition, size_t triangleIndex = cee::UNDEFINED_SIZE_T) const;
108 
109  void data(int stateId, CuttingPlaneData* cuttingPlaneData);
110  void partData(int stateId, size_t globalGeometryIndex, int partId, CuttingPlaneData* cuttingPlaneData);
111 
112  void setPerFrameTransformationMatrices(const std::vector<Mat4d>& matrices);
113  size_t transformationMatrixFrameCount() const;
114  Mat4d frameTransformationMatrix(size_t frameIndex) const;
115 
116 
117 private:
118  CEE_BASE_F(CuttingPlanePropertyHandler);
119  CEE_PRIVATE_F(UnstructGridModel);
120  CEE_PRIVATE_IMPL(CuttingPlane);
121  CEE_DISALLOW_COPY_AND_ASSIGN(CuttingPlane);
122 };
123 
124 } // namespace ug
125 } // namespace cee
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppComponent.cpp:26
Configuration of a cutting plane.
Definition: CuttingPlane.h:33
Returns raw node coordinates and result values for a cutting plane.
Definition: CuttingPlaneData.h:30
Draw as surface.
Definition: CuttingPlane.h:39
SpacingMode
Vector grid spacing mode.
Definition: CuttingPlane.h:47
Use absolute spacing.
Definition: CuttingPlane.h:49
Draw as lines.
Definition: CuttingPlane.h:42
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
Class for storing an RGB color triplet.
Definition: Color3f.h:25
Property handler for cutting plane properties.
Definition: PropertyHandlers.h:496
const size_t UNDEFINED_SIZE_T
Undefined value for size_t.
Definition: Base.h:92
Vector class for a 3D double vector.
Definition: Vec3d.h:26
DrawStyle
Cutting plane surface draw styles.
Definition: CuttingPlane.h:37
Draw as surface mesh.
Definition: CuttingPlane.h:40
UnstructGridModel is a subclass of Model which adds specific model structure and functionality for re...
Definition: UnstructGridModel.h:72
4 dimensional matrix.
Definition: Mat4d.h:26
Draw as outline mesh.
Definition: CuttingPlane.h:41