AGX Dynamics  2.37.2.0
ClipPlane.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
20 #include <osg/ClipNode>
21 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
22 #include <agx/Plane.h>
23 
24 #include <agxOSG/export.h>
25 #include <agxOSG/Node.h>
26 
27 // Forward declaration
28 namespace agx
29 {
30  class ParticleSystem;
31 }
32 
33 namespace agxOSG
34 {
37 
43  class AGXOSG_EXPORT ClipPlane : public osg::ClipNode
44  {
45  public:
49  ClipPlane( const agx::Plane& plane );
50 
54  ClipPlane( const agx::Vec3& normal, const agx::Vec3& position );
55 
60 
65  void setClipPlane( const agx::Plane& plane );
66 
71  void setPosition( const agx::Vec3& position );
72 
77  void setNormal( const agx::Vec3& normal );
78 
83  void setParticleSystemToClip( agx::ParticleSystem* system );
84 
89  void setEnable(bool enable);
90 
94  agx::Plane getPlane() const;
95 
99  agx::Vec3 getPosition() const;
100 
104  agx::Vec3 getNormal() const;
105 
109  bool getEnable() const;
110 
114  void clipAgainstParticleSystem();
115 
116  private:
117  void setDataFromPlane(const agx::Plane& plane);
118 
119  private:
120  agx::Vec3 m_position;
121  agx::Vec3 m_normal;
122  osg::ref_ptr<osg::ClipPlane> m_clipPlane;
123  agx::ParticleSystem* m_system;
124  };
125 }
#define AGXOSG_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
This class wraps the ClipPlane functionality of osg together with a clip node and a clip plane...
Definition: ClipPlane.h:43
Class representing the mathematical concept of a plane, also called a half- space.
Definition: Plane.h:31
A basic particle system that contains all the storages and buffers required for basic operation and a...
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
double Real
Definition: Real.h:42
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34