30 glNormal3d (0.0, 0.0, 1.0);
31 glVertex3dv(fBoundingBox[4].CArr());
32 glVertex3dv(fBoundingBox[7].CArr());
33 glVertex3dv(fBoundingBox[6].CArr());
34 glVertex3dv(fBoundingBox[5].CArr());
40 virtual ~TGLClipPlaneLogical() {}
44 fBoundingBox.SetAligned(
TGLVertex3(-ext, -ext, 0),
57 glEnable(GL_NORMALIZE);
59 glDisable(GL_NORMALIZE);
64 virtual ~TGLClipBoxLogical() {}
68 fBoundingBox.SetAligned(lowVertex, highVertex);
112 Warning(
"TGLClip::Setup",
"Called on base-class -- should be re-implemented in derived class.");
122 glDepthMask(GL_FALSE);
124 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
125 glDisable(GL_CULL_FACE);
126 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
130 glPolygonMode(GL_FRONT, GL_FILL);
131 glEnable(GL_CULL_FACE);
133 glDepthMask(GL_TRUE);
145 const float TGLClipPlane::fgColor[4] = { 1.0, 0.6, 0.2, 0.5 };
166 TGLPlane plane(0.0, -1.0, 0.0, 0.0);
184 TGLClipPlaneLogical* cpl = (TGLClipPlaneLogical*)
GetLogical();
185 cpl->Resize(extents);
213 TGLClipPlaneLogical* cpl = (TGLClipPlaneLogical*)
GetLogical();
214 cpl->Resize(extents);
222 Warning(
"TGLClipPlane::Setup",
"Normal with zero length passed.");
257 const float TGLClipBox::fgColor[4] = { 1.0, 0.6, 0.2, 0.3 };
284 TGLClipBoxLogical* cbl = (TGLClipBoxLogical*)
GetLogical();
285 cbl->Resize(center - halfLengths, center + halfLengths);
304 TGLClipBoxLogical* cbl = (TGLClipBoxLogical*)
GetLogical();
305 cbl->Resize(min_point, max_point);
319 while (i != set.end()) {
490 data[0] = planes[0].A();
491 data[1] = planes[0].B();
492 data[2] = planes[0].C();
493 data[3] = planes[0].D();
511 Error(
"TGLClipSet::GetClipState",
"invalid clip type '%d'.", type);
531 TGLPlane newPlane(-data[0], -data[1], -data[2], -data[3]);
540 data[1] - currentBox.
Center().
Y(),
541 data[2] - currentBox.
Center().
Z());
547 data[4] / currentBox.
Extents().
Y() * currentScale.
Y(),
548 data[5] / currentBox.
Extents().
Z() * currentScale.
Z());
570 Error(
"TGLClipSet::GetClipType" ,
"Unknown clip type");
596 Error(
"TGLClipSet::SetClipType" ,
"Unknown clip type");
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
virtual void Setup(const TGLBoundingBox &bbox)=0
void Translate(const TGLVector3 &vect)
void SetClipType(TGLClip::EType type)
Set current clip active in viewer - 'type' is one of kClipNone kClipPlane or kClipBox.
virtual ~TGLClip()
Destroy clip object.
16 component (4x4) transform matrix - column MAJOR as per GL.
void UpdateBoundingBoxesOfPhysicals()
Update bounding-boxed of all dependent physicals.
const TGLBoundingBox & BoundingBox() const
virtual void SetPShape(TGLPhysicalShape *shape)
Set phys-shape, override of virtual from TGLPShapeRef.
TGLVertex3 Center() const
virtual void MouseLeave()
Mouse has left the element.
virtual Bool_t MouseStillInside(TGLOvlSelectRecord &selRec)
Abstract clipping shape - derives from TGLPhysicalShape Adds clip mode (inside/outside) and pure virt...
void Set(const TGLPlane &plane)
Update clip plane object to follow passed 'plane' equation.
Concrete clip box object.
void FillPlaneSet(TGLPlaneSet_t &set) const
Forward request to fill the plane-set to the current clip.
void SetupClips(const TGLBoundingBox &sceneBBox)
Setup clipping objects for given scene bounding box.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Combine all available manipulators in a collection.
void SetShapeLOD(Short_t LOD)
TGLClipPlane * fClipPlane
Concrete physical shape - a GL drawable.
virtual void Setup(const TGLBoundingBox &bbox)
Setup the clip object for scene encompassed by bbox.
virtual ~TGLClipPlane()
Destroy clip plane object.
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw physical shape, using LOD flags, potential from display list cache.
void GetClipState(TGLClip::EType type, Double_t data[6]) const
Get state of clip object 'type' into data vector:
3 component (x/y/z) vertex class.
virtual void PlaneSet(TGLPlaneSet_t &set) const
Return set of 6 planes describing faces of the box but invert them so that they point inside of box...
const TGLLogicalShape * GetLogical() const
Bool_t IsDrawPassFilled() const
Returns true if current render-pass uses filled polygon style.
void SetupCurrentClip(const TGLBoundingBox &sceneBBox)
Setup current clipping object for given scene bounding box.
virtual Bool_t MouseEnter(TGLOvlSelectRecord &selRec)
Mouse has entered this element.
virtual Bool_t MouseEnter(TGLOvlSelectRecord &selRec)
Mouse has entered this element.
virtual Bool_t MouseStillInside(TGLOvlSelectRecord &selRec)
3 component (x/y/z) vector class.
std::vector< TGLPlane >::iterator TGLPlaneSet_i
virtual void PlaneSet(TGLPlaneSet_t &set) const
Return set of planes (actually a single one) describing this clip plane.
void Error(const char *location, const char *msgfmt,...)
virtual Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event)
Handle overlay event.
virtual Bool_t Handle(TGLRnrCtx &rnrCtx, TGLOvlSelectRecord &selRec, Event_t *event)
Handle overlay event.
TGLVector3 Extents() const
void InvalidateCurrentClip()
Invalidate current clip object.
void StrongRef(Bool_t strong) const
void SetManip(EManip manip)
TGLVector3 GetScale() const
virtual void MouseLeave()
Mouse has left the element.
Concrete clip plane object.
TGLClip::EType GetClipType() const
Get current type active in viewer - returns one of kClipNone kClipPlane or kClipBox.
TGLPlane GetNearPlane() const
Return the near-plane.
TGLClipBox()
Fixed color of clip box.
virtual void PlaneSet(TGLPlaneSet_t &set) const =0
virtual void Draw(TGLRnrCtx &rnrCtx) const
Draw out clipping object with blending and back + front filling.
A collection of concrete TGLClip objects to be selected from.
void InvalidateClips()
Invalidate clip objects.
virtual void Setup(const TGLBoundingBox &bbox)
Setup the clip object for scene encompassed by bbox.
void Warning(const char *location, const char *msgfmt,...)
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const =0
Abstract logical shape - a GL 'drawable' - base for all shapes - faceset sphere etc.
TGLVertex3 NearestOn(const TGLVertex3 &point) const
Return nearest point on plane.
void Scale(const TGLVector3 &scale)
std::vector< TGLPlane > TGLPlaneSet_t
void Negate()
Negate the plane.
void SetTransform(const TGLMatrix &transform)
virtual ~TGLClipSet()
Destructor.
virtual ~TGLClipBox()
Destroy clip box object.
TGLClip(const TGLLogicalShape &logical, const TGLMatrix &transform, const float color[4])
Construct a stand-alone physical clipping object.
virtual void Render(TGLRnrCtx &rnrCtx)
Render the manipulator and bounding-box.
void SetClipState(TGLClip::EType type, const Double_t data[6])
Set state of clip object 'type' into data vector:
void SetDrawPass(Short_t dpass)
Concrete class describing an orientated (free) or axis aligned box of 8 vertices. ...
void SetupCurrentClipIfInvalid(const TGLBoundingBox &sceneBBox)
Setup current clipping object for given scene bounding box.
void PlaneSet(TGLPlaneSet_t &planeSet) const
Fill out supplied plane set vector with TGLPlane objects representing six faces of box...
virtual void Render(TGLRnrCtx &rnrCtx)
Render clip-shape and manipulator.
TGLClipPlane()
Fixed color of clip plane.
Selection record for overlay objects.
3D plane class - of format Ax + By + Cz + D = 0