PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PPolygon Class Reference

#include <PDrawObject.h>

Inheritance diagram for PPolygon:
PDrawObject PWidget PEBLObjectBase PlatformPolygon PlatformPolygon

Public Member Functions

 PPolygon (pInt x, pInt y, Variant xpoints, Variant ypoints, Variant fg, bool filled)
 
virtual ~PPolygon ()
 
virtual pInt GetWidth () const
 
virtual pInt GetHeight () const
 
virtual bool SetXPoints (Variant v)
 
virtual bool SetYPoints (Variant v)
 
virtual std::ostream & SendToStream (std::ostream &out)
 
virtual bool SetProperty (std::string, Variant v)
 
virtual Variant GetProperty (std::string) const
 
virtual ObjectValidationError ValidateProperty (std::string, Variant v) const
 
virtual ObjectValidationError ValidateProperty (std::string) const
 
- Public Member Functions inherited from PDrawObject
 PDrawObject ()
 
virtual ~PDrawObject ()
 
virtual void SetFilled (bool filled)
 
virtual void SetColor (Variant col)
 
virtual void SetOutlineColor (Variant ocol)
 
virtual void SetAA (bool aa)
 
- Public Member Functions inherited from PWidget
 PWidget ()
 
 PWidget (const PWidget &pw)
 
 PWidget (pInt x, pInt y, pInt width, pInt height, bool visible)
 
virtual ~PWidget ()
 
virtual bool RotoZoom (pDouble angle, pDouble zoomx, pDouble zoomy, pInt smooth)
 
virtual bool SetPoint (pInt x, pInt y, PColor col)
 
virtual PColor GetPixel (pInt x, pInt y)
 
virtual void SetParent (PWidget *widget)
 This unconditionally sets the parent widget.
 
virtual PWidgetGetParent ()
 
virtual bool IsParent (PWidget *parent)
 
virtual bool Draw ()
 
virtual void SetPosition (pInt x, pInt y)
 This sets the widget's position on its parent widget.
 
virtual void SetZoomX (pDouble x)
 This sets the widget's position on its parent widget.
 
virtual void SetZoomY (pDouble x)
 This sets the widget's position on its parent widget.
 
virtual void SetRotation (pDouble x)
 This sets the widget's position on its parent widget.
 
virtual void SetWidth (pInt w)
 
virtual void SetHeight (pInt h)
 
virtual pInt GetX () const
 
virtual pInt GetY () const
 
virtual void SetBackgroundColor (const PColor &color)
 
virtual PColor GetBackgroundColor ()
 
virtual bool AddSubWidget (PWidget *widget)
 
virtual bool RemoveSubWidget (PWidget *widget)
 
virtual bool RemoveSubWidgets ()
 
virtual bool RemoveLastSubWidget ()
 This is probably pretty useless.
 
virtual void Show ()
 
virtual void Hide ()
 
virtual bool IsVisible () const
 
virtual std::string ObjectName () const
 
- Public Member Functions inherited from PEBLObjectBase
 PEBLObjectBase ()
 Standard Constructor.
 
 PEBLObjectBase (ComplexDataType cdt)
 Standard Constructor.
 
 PEBLObjectBase (const PEBLObjectBase &pob)
 
virtual ~PEBLObjectBase ()
 Standard Destructor.
 
virtual bool InitializeProperty (std::string name, Variant v)
 
Variant GetProperty (std::string) const
 
ComplexDataType GetType ()
 
virtual std::ostream & PrintProperties (std::ostream &out)
 
virtual Variant GetPropertyList ()
 

Protected Attributes

Variant mXPoints
 
Variant mYPoints
 
- Protected Attributes inherited from PDrawObject
bool mFilled
 
bool mAntiAliased
 
- Protected Attributes inherited from PWidget
pInt mX
 
pInt mY
 
pInt mDrawX
 
pInt mDrawY
 
pInt mWidth
 
pInt mHeight
 
pDouble mZoomX
 
pDouble mZoomY
 
pDouble mRotation
 
PColor mBackgroundColor
 The background color of the widget. if alpha = 0, will not be painted.
 
std::list< PWidget * > mSubWidgets
 
bool mIsVisible
 
PWidgetmParent
 
- Protected Attributes inherited from PEBLObjectBase
ComplexDataType mCDT
 
std::map< std::string, VariantmProperties
 

Additional Inherited Members

- Protected Member Functions inherited from PDrawObject
virtual std::ostream & SendToStream (std::ostream &out) const =0
 An inheritable printing class used by PEBLObjectBase::operator<<.
 
PColorGetColor () const
 
PColorGetOutlineColor () const
 

Detailed Description

Definition at line 277 of file PDrawObject.h.

Constructor & Destructor Documentation

◆ PPolygon()

PPolygon::PPolygon ( pInt  x,
pInt  y,
Variant  xpoints,
Variant  ypoints,
Variant  fg,
bool  filled 
)

Definition at line 720 of file PDrawObject.cpp.

721{
722
723 SetPosition(x,y);
724 SetFilled(filled);
725 InitializeProperty("XPOINTS",xpoints);
726 InitializeProperty("YPOINTS",ypoints);
727 InitializeProperty("NAME",Variant("<POLYGON>"));
728 SetXPoints(xpoints);
729 SetYPoints(ypoints);
730 SetColor(fg);
731 SetOutlineColor(fg);
733}
virtual void SetAA(bool aa)
virtual void SetOutlineColor(Variant ocol)
virtual void SetColor(Variant col)
virtual void SetFilled(bool filled)
virtual bool InitializeProperty(std::string name, Variant v)
virtual bool SetYPoints(Variant v)
virtual bool SetXPoints(Variant v)
virtual void SetPosition(pInt x, pInt y)
This sets the widget's position on its parent widget.
Definition PWidget.cpp:220

References PEBLObjectBase::InitializeProperty(), PDrawObject::SetAA(), PDrawObject::SetColor(), PDrawObject::SetFilled(), PDrawObject::SetOutlineColor(), PWidget::SetPosition(), SetXPoints(), and SetYPoints().

◆ ~PPolygon()

PPolygon::~PPolygon ( )
virtual

Definition at line 735 of file PDrawObject.cpp.

736{
737
738}

Member Function Documentation

◆ GetHeight()

virtual pInt PPolygon::GetHeight ( ) const
inlinevirtual

Reimplemented from PWidget.

Definition at line 284 of file PDrawObject.h.

284{return mHeight;};
pInt mHeight
Definition PWidget.h:136

References PWidget::mHeight.

◆ GetProperty()

Variant PPolygon::GetProperty ( std::string  name) const
virtual

Reimplemented from PDrawObject.

Definition at line 783 of file PDrawObject.cpp.

784{
785 return PEBLObjectBase::GetProperty(name);
786
787}
Variant GetProperty(std::string) const

References PEBLObjectBase::GetProperty().

◆ GetWidth()

virtual pInt PPolygon::GetWidth ( ) const
inlinevirtual

Reimplemented from PWidget.

Definition at line 283 of file PDrawObject.h.

283{return mWidth;};
pInt mWidth
Definition PWidget.h:136

References PWidget::mWidth.

◆ SendToStream()

std::ostream & PPolygon::SendToStream ( std::ostream &  out)
virtual

Definition at line 741 of file PDrawObject.cpp.

742{
743 out << "PPolygon";
744 return out;
745}

◆ SetProperty()

bool PPolygon::SetProperty ( std::string  name,
Variant  v 
)
virtual

Reimplemented from PDrawObject.

Reimplemented in PlatformPolygon.

Definition at line 747 of file PDrawObject.cpp.

748{
749
750 if(!PDrawObject::SetProperty(name,v))
751 {
752 if("XPOINTS" == name)
753 {SetXPoints(v);
754 }
755 else if("YPOINTS" == name)
756 {SetYPoints(v);
757 }
758 else{
759 return false;
760 }
761 }
762 return true;
763}
virtual bool SetProperty(std::string, Variant v)

References PDrawObject::SetProperty(), SetXPoints(), and SetYPoints().

Referenced by PlatformPolygon::SetProperty().

◆ SetXPoints()

bool PPolygon::SetXPoints ( Variant  v)
virtual

Definition at line 766 of file PDrawObject.cpp.

767{
768
769 mXPoints = v;
770 return true;
771}
Variant mXPoints

References mXPoints.

Referenced by PPolygon(), and SetProperty().

◆ SetYPoints()

bool PPolygon::SetYPoints ( Variant  v)
virtual

Definition at line 773 of file PDrawObject.cpp.

774{
775
776
777 mYPoints = v;
778
779 return true;
780}
Variant mYPoints

References mYPoints.

Referenced by PPolygon(), and SetProperty().

◆ ValidateProperty() [1/2]

ObjectValidationError PPolygon::ValidateProperty ( std::string  name) const
virtual

Reimplemented from PDrawObject.

Reimplemented in PlatformPolygon.

Definition at line 795 of file PDrawObject.cpp.

796{
797
799 {
800 return OVE_VALID;
801 }
802 else
803 {
804 if("XPOINTS" == name
805 || "YPOINTS" == name
806 )
807 return OVE_VALID;
808 else return OVE_INVALID_PROPERTY_NAME;
809 }
810
811}
@ OVE_INVALID_PROPERTY_NAME
Definition PEBLObject.h:40
@ OVE_VALID
Definition PEBLObject.h:39
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const

References OVE_INVALID_PROPERTY_NAME, OVE_VALID, and PDrawObject::ValidateProperty().

◆ ValidateProperty() [2/2]

ObjectValidationError PPolygon::ValidateProperty ( std::string  name,
Variant  v 
) const
virtual

Reimplemented from PDrawObject.

Reimplemented in PlatformPolygon.

Definition at line 790 of file PDrawObject.cpp.

791{
792 return ValidateProperty(name);
793}
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const

References ValidateProperty().

Referenced by PlatformPolygon::ValidateProperty(), PlatformPolygon::ValidateProperty(), and ValidateProperty().

Member Data Documentation

◆ mXPoints

Variant PPolygon::mXPoints
protected

Definition at line 301 of file PDrawObject.h.

Referenced by PlatformPolygon::Draw(), and SetXPoints().

◆ mYPoints

Variant PPolygon::mYPoints
protected

Definition at line 302 of file PDrawObject.h.

Referenced by PlatformPolygon::Draw(), and SetYPoints().


The documentation for this class was generated from the following files: