hgl 0.5.25
A compiler/interpreter suite for developing images
Public Member Functions | Protected Member Functions | List of all members
HGL::Type::Curve Class Reference

#include "curve.h"

Inheritance diagram for HGL::Type::Curve:
[legend]

Public Member Functions

virtual const FillgetFill () const
 Gets the Fill type of the type. More...
 
- Public Member Functions inherited from HGL::Type::Poly
const FillgetFill () const
 Gets the Fill type of the type. More...
 
- Public Member Functions inherited from HGL::Type::ReferenceHolderBase
virtual const ITypefindReference (bool recache=false) const
 Searches the tree for the associated reference. More...
 
virtual const std::string * getReference () const
 Gets the reference. More...
 
virtual void setReference (const std::string &ref, bool fromStdLib=false)
 Sets the reference. More...
 
Reference access and manipulation
- Public Member Functions inherited from HGL::IType
virtual operator iterator ()=0
 Gets the iterator over this type's attached types. More...
 
- Public Member Functions inherited from HGL::Type::TypeBase
ITypeattachType (IType *type, bool check=true) throw (Exception::AttachException)
 Attach child objects to the IType at end of list. More...
 
virtual IType::iterator begin ()
 Gets the iterator to the begin over this type's attached types. More...
 
virtual IType::iterator end ()
 Gets the iterator to the end over this type's attached types. More...
 
virtual const TYPELISTgetAttachedTypes () const
 Returns all attached IType instances. More...
 
virtual const std::string & getId () const
 Gets the identifier. More...
 
virtual ITypegetParent () const
 Returns the parent IType. More...
 
virtual bool isNull () const
 Checks if the type is null type. More...
 
virtual void setDescription (const std::string &desc)
 Sets the description of the type. More...
 
virtual void setId (const std::string &id)
 Sets the identifier. More...
 

Protected Member Functions

virtual ITypeattachType (IType *type, const TYPELIST::iterator &before, bool check) throw (Exception::AttachException)
 
virtual SERIALID getSerialID () const
 Gets the SerialID of HGL::IType::SCURVE More...
 
virtual bool isValid () const
 Checks if the type is valid. More...
 
- Protected Member Functions inherited from HGL::Type::Poly
virtual ITypeattachType (IType *type, const HGL::IType::TYPELIST::iterator &before, bool check) throw (Exception::AttachException)
 
virtual void detachType (IType *type)
 Detaches a child from the IType. More...
 
- Protected Member Functions inherited from HGL::Type::TypeBase
virtual IType::Ptr clone () const throw (Exception::CloneNotSupportedException)
 Creates a clone of the type. More...
 
virtual const std::string & getDescription () const
 Gets the description of the type. More...
 
virtual const ITypegetRoot (const IType &type) const
 Get the root of a type. More...
 
virtual std::string getTypeName () const
 Displayable name of the IType. More...
 
virtual operator float () const throw (Exception::ReferenceException, Exception::InvalidExpressionException)
 Converts the type into a float More...
 
virtual ITyperesolve (const std::string &id) const
 Resolves a type by its ID. More...
 
virtual void setParent (IType *parent)
 Set parent of the type. More...
 

Detailed Description

Author
Heiko Schäfer heiko.nosp@m.@hgl.nosp@m..rang.nosp@m.un.d.nosp@m.e

Member Function Documentation

HGL::IType * Curve::attachType ( HGL::IType type,
const TYPELIST::iterator &  before,
bool  check 
)
throw (Exception::AttachException
)
protectedvirtual

Postcondition
If the Curve is invalidated after attaching, it will get reordered to be valid again.

Reimplemented from HGL::Type::TypeBase.

References HGL::Type::Poly::attachType().

const Fill * Curve::getFill ( ) const
virtual

Gets the Fill type of the type.

Note
Returns always NULL because a Curve itself cannot get filled. Attach it onto a Poly to get it filled.
See Also
Poly::getFill
Returns
a Fill or NULL if none available

Implements HGL::Type::IFillable.

HGL::IType::SERIALID Curve::getSerialID ( ) const
protectedvirtual

Gets the SerialID of HGL::IType::SCURVE

Returns
HGL::IType::SCURVE

Reimplemented from HGL::Type::Poly.

References HGL::IType::SCURVE.

bool Curve::isValid ( ) const
protectedvirtual

Checks if the type is valid.

To be a valid Curve a Line must be the first attached type.

Note
This method returns true if a reference is set, but not checking if the reference itself is valid. A type is valid
  1. if all attached types are allowed for this type, if not the type is invalid
  2. if all attached types itself are valid, if not the type is invalid

Subclasses can add more checks if neccessary.

Returns
true if the type is valid, false otherwise

Reimplemented from HGL::Type::Poly.

References HGL::Type::TypeBase::getAttachedTypes(), and HGL::Type::ReferenceHolderBase::isValid().