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

#include <PlatformDrawObject.h>

Inheritance diagram for PlatformThickLine:
PlatformDrawObject PThickLine PlatformDrawObject PThickLine PlatformWidget PlatformWidget PDrawObject PlatformWidget PlatformWidget PDrawObject PWidget PWidget PWidget PWidget PWidget PWidget PWidget PWidget PWidget PWidget

Public Member Functions

 PlatformThickLine (int x1, int y1, int x2, int y2, int width, Variant fg)
 
virtual ~PlatformThickLine ()
 
virtual bool Draw ()
 This method initiates everything needed to display the main window

 
 PlatformThickLine (int x1, int y1, int x2, int y2, int width, Variant fg)
 
virtual ~PlatformThickLine ()
 
virtual bool Draw ()
 This method initiates everything needed to display the main window

 
virtual std::string ObjectName () const
 
virtual bool SetProperty (std::string name, Variant v)
 
virtual ObjectValidationError ValidateProperty (std::string name, Variant v) const
 
virtual ObjectValidationError ValidateProperty (std::string name) const
 
virtual void SetPosition (pInt x, pInt y)
 This sets the widget's position on its parent widget.
 
- Public Member Functions inherited from PlatformDrawObject
 PlatformDrawObject ()
 
 ~PlatformDrawObject ()
 
 PlatformDrawObject ()
 
 ~PlatformDrawObject ()
 
- Public Member Functions inherited from PlatformWidget
 PlatformWidget ()
 
virtual ~PlatformWidget ()
 
virtual SDL_Texture * GetSDL_Texture ()
 Used to extract an SDL surface from the widget. Used by children drawing themselves on their parent.
 
void SetParent (PlatformWidget *parent)
 
SDL_Surface * GetSurface ()
 
virtual bool SetRenderer (SDL_Renderer *renderer)
 
SDL_Renderer * GetRenderer ()
 
virtual bool AddToParentWidget (PlatformWidget *parent)
 
virtual bool AddSubWidget (PlatformWidget *widget)
 
virtual bool RemoveSubWidget (PlatformWidget *widget)
 
virtual bool RemoveSubWidgets ()
 
virtual bool RotoZoom (double angle, double zoomx, double zoomy, int smooth)
 This uses the SDL_gfx package to 'rotozoom'.
 
bool SetPoint (int x, int y, PColor col)
 
PColor GetPixel (int x, int y)
 
 PlatformWidget ()
 
 PlatformWidget (pInt x, pInt y, pInt width, pInt height, bool visible)
 
virtual ~PlatformWidget ()
 
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)
 
- 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 void SetParent (PWidget *widget)
 This unconditionally sets the parent widget.
 
virtual PWidgetGetParent ()
 
virtual bool IsParent (PWidget *parent)
 
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 pInt GetWidth () const
 
virtual pInt GetHeight () const
 
virtual void SetBackgroundColor (const PColor &color)
 
virtual PColor GetBackgroundColor ()
 
virtual bool AddSubWidget (PWidget *widget)
 
virtual bool RemoveSubWidget (PWidget *widget)
 
virtual bool RemoveLastSubWidget ()
 This is probably pretty useless.
 
virtual void Show ()
 
virtual void Hide ()
 
virtual bool IsVisible () 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 ()
 
- Public Member Functions inherited from PThickLine
 PThickLine (pInt x1, pInt y1, pInt x2, pInt y2, pInt width, Variant fg)
 
virtual ~PThickLine ()
 
virtual std::ostream & SendToStream (std::ostream &out)
 
virtual void SetEnds (pInt x1, pInt y1, pInt x2, pInt y2)
 
virtual void SetThickness (pInt t)
 
virtual Variant GetProperty (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)
 

Protected Member Functions

virtual std::ostream & SendToStream (std::ostream &out) const
 An inheritable printing class used by PEBLObjectBase::operator<<.
 
virtual std::ostream & SendToStream (std::ostream &out) const
 An inheritable printing class used by PEBLObjectBase::operator<<.
 
- Protected Member Functions inherited from PlatformWidget
virtual void PrintSubWidgets (std::ostream &out) const
 
virtual bool LockSurface ()
 This needs to be used on some platforms/video cards.
 
virtual bool UnlockSurface ()
 This needs to be used on some platforms/video cards.
 
- Protected Member Functions inherited from PDrawObject
PColorGetColor () const
 
PColorGetOutlineColor () const
 

Additional Inherited Members

- Protected Attributes inherited from PlatformWidget
pInt mTextureWidth
 
pInt mTextureHeight
 
bool mNeedsTexture
 
SDL_Texture * mTexture
 
SDL_Surface * mSurface
 
SDL_Renderer * mRenderer
 
- 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
 
- Protected Attributes inherited from PThickLine
pInt mX1
 
pInt mY1
 
pInt mX2
 
pInt mY2
 
pInt mThickness
 
- Protected Attributes inherited from PDrawObject
bool mFilled
 
bool mAntiAliased
 

Detailed Description

Definition at line 70 of file sdl/PlatformDrawObject.h.

Constructor & Destructor Documentation

◆ PlatformThickLine() [1/2]

PlatformThickLine::PlatformThickLine ( int  x1,
int  y1,
int  x2,
int  y2,
int  width,
Variant  fg 
)

Definition at line 195 of file sdl/PlatformDrawObject.cpp.

196 :
197 PThickLine(x1,y1,x2,y2,thickness,fg)
198{
199
200 mNeedsTexture=false;
202
203 mSurface =NULL;
204 mParent = NULL;
205 mIsVisible=true;
206}
#define NULL
Definition BinReloc.cpp:317
@ CDT_THICKLINE
Definition PEBLObject.h:61
ComplexDataType mCDT
Definition PEBLObject.h:109
PWidget * mParent
Definition PWidget.h:154
bool mIsVisible
Definition PWidget.h:150
SDL_Surface * mSurface

References CDT_THICKLINE, PEBLObjectBase::mCDT, PWidget::mIsVisible, PlatformWidget::mNeedsTexture, PWidget::mParent, PlatformWidget::mSurface, and NULL.

◆ ~PlatformThickLine() [1/2]

PlatformThickLine::~PlatformThickLine ( )
virtual

Definition at line 208 of file sdl/PlatformDrawObject.cpp.

209{
210}

◆ PlatformThickLine() [2/2]

PlatformThickLine::PlatformThickLine ( int  x1,
int  y1,
int  x2,
int  y2,
int  width,
Variant  fg 
)

◆ ~PlatformThickLine() [2/2]

virtual PlatformThickLine::~PlatformThickLine ( )
virtual

Member Function Documentation

◆ Draw() [1/2]

bool PlatformThickLine::Draw ( )
virtual

This method initiates everything needed to display the main window

Reimplemented from PlatformWidget.

Definition at line 218 of file sdl/PlatformDrawObject.cpp.

219{
220
221 //First, create a sdl_surface with blank background to draw on:
222 int result=0;
223
224 if(mParent && mRenderer)
225 {
226
227 SDL_SetRenderTarget(mRenderer, dynamic_cast<PlatformWidget*>(mParent)->GetSDL_Texture());
228
229 result = thickLineRGBA(mRenderer,mX1,mY1,mX2,mY2,mThickness,
230 GetColor()->GetRed(), GetColor()->GetGreen(),
231 GetColor()->GetBlue(), GetColor()->GetAlpha());
232 SDL_SetRenderTarget(mRenderer,NULL);
233 }
234 return result;
235}
PColor * GetColor() const
pInt mThickness
SDL_Renderer * mRenderer
virtual SDL_Texture * GetSDL_Texture()
Used to extract an SDL surface from the widget. Used by children drawing themselves on their parent.

References PDrawObject::GetColor(), PlatformWidget::GetSDL_Texture(), PWidget::mParent, PlatformWidget::mRenderer, PThickLine::mThickness, PThickLine::mX1, PThickLine::mX2, PThickLine::mY1, PThickLine::mY2, and NULL.

◆ Draw() [2/2]

virtual bool PlatformThickLine::Draw ( )
virtual

This method initiates everything needed to display the main window

Reimplemented from PlatformWidget.

◆ ObjectName()

virtual std::string PlatformThickLine::ObjectName ( ) const
inlinevirtual

Reimplemented from PWidget.

Definition at line 58 of file validator/PlatformDrawObject.h.

58{ return "PlatformThickLine (validator)"; }

◆ SendToStream() [1/2]

std::ostream & PlatformThickLine::SendToStream ( std::ostream &  out) const
protectedvirtual

An inheritable printing class used by PEBLObjectBase::operator<<.

Reimplemented from PlatformWidget.

Definition at line 212 of file sdl/PlatformDrawObject.cpp.

213{
214 out << "<A thick line:"<< mX1 << ", " << mY1 << "| w: " << mX2 << ", h:" << mY2 << std::endl;
215 return out;
216}

References PThickLine::mX1, PThickLine::mX2, PThickLine::mY1, and PThickLine::mY2.

◆ SendToStream() [2/2]

virtual std::ostream & PlatformThickLine::SendToStream ( std::ostream &  out) const
protectedvirtual

An inheritable printing class used by PEBLObjectBase::operator<<.

Reimplemented from PlatformWidget.

◆ SetPosition()

virtual void PlatformThickLine::SetPosition ( pInt  x,
pInt  y 
)
inlinevirtual

This sets the widget's position on its parent widget.

Sets the location of the upper left-hand corner of the image on the parent widget; unless overridden

Reimplemented from PWidget.

Definition at line 62 of file validator/PlatformDrawObject.h.

virtual void SetPosition(pInt x, pInt y)
This sets the widget's position on its parent widget.

References PThickLine::SetPosition().

Referenced by PEBLObjects::Move().

◆ SetProperty()

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

Reimplemented from PWidget.

Definition at line 59 of file validator/PlatformDrawObject.h.

59{ return PThickLine::SetProperty(name, v); }
virtual bool SetProperty(std::string, Variant v)

References PThickLine::SetProperty().

◆ ValidateProperty() [1/2]

virtual ObjectValidationError PlatformThickLine::ValidateProperty ( std::string  name) const
inlinevirtual

Reimplemented from PWidget.

Definition at line 61 of file validator/PlatformDrawObject.h.

61{ return PThickLine::ValidateProperty(name); }
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const

References PThickLine::ValidateProperty().

◆ ValidateProperty() [2/2]

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

Reimplemented from PWidget.

Definition at line 60 of file validator/PlatformDrawObject.h.

60{ return PThickLine::ValidateProperty(name, v); }

References PThickLine::ValidateProperty().


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