HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_SlicePlane.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
7 
8 #ifndef __SIM_SlicePlane_h__
9 #define __SIM_SlicePlane_h__
10 
11 #include "SIM_API.h"
12 #include "SIM_Slice.h"
13 #include "SIM_OptionsUser.h"
14 
16  public SIM_OptionsUser
17 {
18 public:
19  /// Control the force attribute.
20  GETSET_DATA_FUNCS_V3("dir", SliceDirection);
21  /// Control the position attribute.
23 
24 protected:
25  explicit SIM_SlicePlane(const SIM_DataFactory *factory);
26  ~SIM_SlicePlane() override;
27 
28  /// Returns the distance to the slice's boundary. If the point
29  /// is inside the slice this is a negative distance, else positive.
30  /// This is what must be overridden to make the slice do something
31  /// interesting
33  const UT_Vector3 &pos) const override;
34 
35  /// Returns the minimum value the slice attains inside the given bounding
36  /// box. A negative value implies the slice and bounding box overlap.
38  const UT_BoundingBox &bbox) const override;
40  const UT_BoundingBox &bbox) const override;
41 
42  /// Which side of our parent we are on
43  UT_Vector3 getCenterSubclass() const override { return myPos; }
44 
45  SIM_Guide *createGuideObjectSubclass() const override;
46  /// We override this method to create the fan geometry.
48  const SIM_RootData &root,
49  const SIM_Options &options,
50  const GU_DetailHandle &gdh,
51  UT_DMatrix4 *xform,
52  const SIM_Time &t) const override;
53 
54  /// Update our cached position and size so we can store pre-normalized
55  /// values to speed up detection
56  void optionChangedSubclass(const char *name) override;
57 
58 private:
59  static const SIM_DopDescription *getSlicePlaneDopDescription();
60 
61  UT_Vector3 myDir, myPos;
62  fpreal myOffset;
63 
66  SIM_Slice,
67  "Slice by Plane",
68  getSlicePlaneDopDescription());
69 };
70 
71 #endif
72 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
virtual void optionChangedSubclass(const char *name)
virtual fpreal getMinSliceBoundaryDistSubclass(const UT_BoundingBox &bbox) const =0
virtual fpreal getMaxSliceBoundaryDistSubclass(const UT_BoundingBox &bbox) const =0
virtual void buildGuideGeometrySubclass(const SIM_RootData &root, const SIM_Options &options, const GU_DetailHandle &gdh, UT_DMatrix4 *xform, const SIM_Time &t) const
#define GETSET_DATA_FUNCS_V3(DataName, FuncName)
#define DECLARE_DATAFACTORY(DataClass, SuperClass, Description, DopParms)
Definition: SIM_DataUtils.h:63
UT_Vector3 getCenterSubclass() const override
Which side of our parent we are on.
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual fpreal getSliceBoundaryDistSubclass(const UT_Vector3 &pos) const =0
GLdouble t
Definition: glad.h:2397
#define SIM_NAME_POSITION
Definition: SIM_Names.h:168
fpreal64 fpreal
Definition: SYS_Types.h:277
#define SIM_API
Definition: SIM_API.h:12
virtual SIM_Guide * createGuideObjectSubclass() const