00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: clippingPlane.h,v 1.3.18.1 2007/03/25 21:25:58 oliver Exp $ 00005 // 00006 00007 #ifndef BALL_VIEW_KERNEL_CLIPPING_PLANE_H 00008 #define BALL_VIEW_KERNEL_CLIPPING_PLANE_H 00009 00010 #ifndef BALL_DATATYPE_HASHSET_H 00011 # include <BALL/DATATYPE/hashSet.h> 00012 #endif 00013 00014 #ifndef BALL_VIEW_KERNEL_REPRESENTATION_H 00015 # include <BALL/VIEW/KERNEL/representation.h> 00016 #endif 00017 00018 namespace BALL 00019 { 00020 namespace VIEW 00021 { 00025 class BALL_VIEW_EXPORT ClippingPlane 00026 { 00027 public: 00028 00029 BALL_CREATE(ClippingPlane) 00030 00031 ClippingPlane(); 00032 00034 ClippingPlane(const ClippingPlane& plane); 00035 00038 virtual ~ClippingPlane(); 00039 00041 const ClippingPlane& operator = (const ClippingPlane& plane); 00042 00044 void clear(); 00045 00047 bool operator == (const ClippingPlane& plane) const; 00048 00050 HashSet<const Representation*>& getRepresentations() { return reps_;} 00051 00053 const Vector3& getNormal() const { return normal_;} 00054 00056 void setNormal(const Vector3& normal) { normal_ = normal;} 00057 00059 bool isActive() const { return active_;} 00060 00062 void setActive(bool state) { active_ = state;} 00063 00065 bool isHidden() const { return hidden_;} 00066 00068 void setHidden(bool hidden) { hidden_ = hidden;} 00069 00071 float getDistance() const; 00072 00074 const Vector3& getPoint() const { return point_;} 00075 00077 void setPoint(const Vector3& v) { point_ = v;} 00078 00080 void flip() { normal_ = -normal_;} 00081 00083 static ColorRGBA& getCappingColor() { return capping_color_;} 00084 00086 bool cappingEnabled() const { return cap_;} 00087 00089 void setCappingEnabled(bool state) { cap_ = state;} 00090 00091 protected: 00092 00093 HashSet<const Representation*> reps_; 00094 Vector3 normal_; 00095 Vector3 point_; 00096 bool active_; 00097 bool hidden_; 00098 bool cap_; 00099 static ColorRGBA capping_color_; 00100 }; 00101 00102 } // namespace VIEW 00103 } // namespace BALL 00104 00105 #endif // BALL_VIEW_KERNEL_CLIPPING_PLANE_H