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

#include <PDrawObject.h>

Inheritance diagram for PBezier:
PDrawObject PWidget PEBLObjectBase PlatformBezier PlatformBezier

Public Member Functions

 PBezier (pInt x, pInt y, Variant xpoints, Variant ypoints, pInt steps, Variant fg)
 
virtual ~PBezier ()
 
virtual pInt GetWidth () const
 
virtual pInt GetHeight () const
 
virtual bool SetXPoints (Variant v)
 
virtual bool SetYPoints (Variant v)
 
virtual bool SetSteps (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
 
pInt mSteps
 
- 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 308 of file PDrawObject.h.

Constructor & Destructor Documentation

◆ PBezier()

PBezier::PBezier ( pInt  x,
pInt  y,
Variant  xpoints,
Variant  ypoints,
pInt  steps,
Variant  fg 
)

Definition at line 815 of file PDrawObject.cpp.

816{
817 SetPosition(x,y);
818 InitializeProperty("XPOINTS",xpoints);
819 InitializeProperty("YPOINTS",ypoints);
820 InitializeProperty("STEPS",steps);
821 InitializeProperty("NAME",Variant("<BEZIER>"));
822 SetXPoints(xpoints);
823 SetYPoints(ypoints);
824 SetSteps(steps);
825
826 SetColor(fg);
827 SetOutlineColor(fg);
828}
virtual bool SetSteps(Variant v)
virtual bool SetXPoints(Variant v)
virtual bool SetYPoints(Variant v)
virtual void SetOutlineColor(Variant ocol)
virtual void SetColor(Variant col)
virtual bool InitializeProperty(std::string name, 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::SetColor(), PDrawObject::SetOutlineColor(), PWidget::SetPosition(), SetSteps(), SetXPoints(), and SetYPoints().

◆ ~PBezier()

PBezier::~PBezier ( )
virtual

Definition at line 830 of file PDrawObject.cpp.

831{
832
833}

Member Function Documentation

◆ GetHeight()

virtual pInt PBezier::GetHeight ( ) const
inlinevirtual

Reimplemented from PWidget.

Definition at line 315 of file PDrawObject.h.

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

References PWidget::mHeight.

◆ GetProperty()

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

Reimplemented from PDrawObject.

Definition at line 890 of file PDrawObject.cpp.

891{
892 return PEBLObjectBase::GetProperty(name);
893
894}
Variant GetProperty(std::string) const

References PEBLObjectBase::GetProperty().

◆ GetWidth()

virtual pInt PBezier::GetWidth ( ) const
inlinevirtual

Reimplemented from PWidget.

Definition at line 314 of file PDrawObject.h.

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

References PWidget::mWidth.

◆ SendToStream()

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

Definition at line 836 of file PDrawObject.cpp.

837{
838 out << "PBezier";
839 return out;
840}

◆ SetProperty()

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

Reimplemented from PDrawObject.

Reimplemented in PlatformBezier.

Definition at line 842 of file PDrawObject.cpp.

843{
844
845 if(!PDrawObject::SetProperty(name,v))
846 {
847 if("XPOINTS" == name)
848 {
849
850 SetXPoints(v);
851 }
852 else if("YPOINTS" == name)
853 {SetYPoints(v);
854 }
855 else if ("STEPS" == name)
856 {SetSteps(v);
857 }
858 else
859 {
860 return false;
861 }
862 }
863 return true;
864}
virtual bool SetProperty(std::string, Variant v)

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

Referenced by PlatformBezier::SetProperty().

◆ SetSteps()

bool PBezier::SetSteps ( Variant  v)
virtual

Definition at line 881 of file PDrawObject.cpp.

882{
883
884 mSteps = (pInt)v;
885 return true;
886
887}
#define pInt
Definition Defs.h:8
pInt mSteps

References mSteps, and pInt.

Referenced by PBezier(), and SetProperty().

◆ SetXPoints()

bool PBezier::SetXPoints ( Variant  v)
virtual

Definition at line 867 of file PDrawObject.cpp.

868{
869
870 mXPoints = v;
871 return true;
872}
Variant mXPoints

References mXPoints.

Referenced by PBezier(), and SetProperty().

◆ SetYPoints()

bool PBezier::SetYPoints ( Variant  v)
virtual

Definition at line 874 of file PDrawObject.cpp.

875{
876
877 mYPoints = v;
878 return true;
879}
Variant mYPoints

References mYPoints.

Referenced by PBezier(), and SetProperty().

◆ ValidateProperty() [1/2]

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

Reimplemented from PDrawObject.

Reimplemented in PlatformBezier.

Definition at line 902 of file PDrawObject.cpp.

903{
904
906 {
907 return OVE_VALID;
908 }
909 else
910 {
911 if("XPOINTS" == name
912 || "YPOINTS" == name
913 || "STEPS" == name
914 )
915 return OVE_VALID;
916 else return OVE_INVALID_PROPERTY_NAME;
917 }
918
919}
@ 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 PBezier::ValidateProperty ( std::string  name,
Variant  v 
) const
virtual

Reimplemented from PDrawObject.

Reimplemented in PlatformBezier.

Definition at line 897 of file PDrawObject.cpp.

898{
899 return ValidateProperty(name);
900}
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const

References ValidateProperty().

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

Member Data Documentation

◆ mSteps

pInt PBezier::mSteps
protected

Definition at line 335 of file PDrawObject.h.

Referenced by PlatformBezier::Draw(), and SetSteps().

◆ mXPoints

Variant PBezier::mXPoints
protected

Definition at line 333 of file PDrawObject.h.

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

◆ mYPoints

Variant PBezier::mYPoints
protected

Definition at line 334 of file PDrawObject.h.

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


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