|
hgl 0.5.25
A compiler/interpreter suite for developing images
|
This class provides the default implementation for most types. More...
#include "typebase.h"
Public Member Functions | |
| IType * | attachType (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 void | detachType (IType *type) |
| Detaches a child from the IType. More... | |
| virtual IType::iterator | end () |
| Gets the iterator to the end over this type's attached types. More... | |
| virtual const TYPELIST & | getAttachedTypes () const |
Returns all attached IType instances. More... | |
| virtual BOUNDINGBOX | getBoundingBox () const |
| Gets the bounding box of the type. More... | |
| virtual const std::string & | getId () const |
| Gets the identifier. More... | |
| virtual IType * | getParent () 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... | |
Public Member Functions inherited from HGL::IType | |
| virtual | operator iterator ()=0 |
| Gets the iterator over this type's attached types. More... | |
| virtual SERIALID | getSerialID () const =0 |
| Gets the serialization ID of the object. More... | |
Protected Member Functions | |
| virtual IType * | attachType (IType *type, const TYPELIST::iterator &before, bool check=true) throw (Exception::AttachException) |
Attaches a child at the position before. More... | |
| 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 IType * | getRoot (const IType &type) const |
| Get the root of a type. More... | |
| virtual std::string | getTypeName () const |
| Displayable name of the IType. More... | |
| virtual bool | isValid () const |
| Checks if the type is valid. More... | |
| virtual | operator float () const throw (Exception::ReferenceException, Exception::InvalidExpressionException) |
Converts the type into a float More... | |
| virtual IType * | resolve (const std::string &id) const |
| Resolves a type by its ID. More... | |
| virtual void | setParent (IType *parent) |
| Set parent of the type. More... | |
This class provides the default implementation for most types.
|
virtual | ||||||||||||||||||||
Attach child objects to the IType at end of list.
| type | the IType to attach as child |
| check | true (default), if validity checks should be performed |
| Exception::AttachException | if a disallowed type gets attached. See Types for more. |
Implements HGL::IType.
Referenced by HGL::Type::RenderCallback::attachType(), HGL::Type::Poly::attachType(), HGL::Type::Line::attachType(), and HGL::Type::Point::attachType().
|
protectedvirtual | ||||||||||||||||||||||||
Attaches a child at the position before.
It updates the parent of the attached type to this type as well.
| type | the IType to attach as child |
| before | the type will be attached before the type referenced by before |
| check | true (default), if validity checks should be performed |
| type | the IType to attach as child |
| check | true (default), if validity checks should be performed |
| Exception::AttachException | if a disallowed type gets attached. See Types for more. |
Reimplemented in HGL::Type::Point, HGL::Type::Line, HGL::Type::AssignmentOperator, HGL::Type::Curve, HGL::Type::RenderCallback, and HGL::Type::VirtualGroup.
|
virtual |
Gets the iterator to the begin over this type's attached types.
Implements HGL::IType.
|
protectedvirtual | |||||||||||||
Creates a clone of the type.
Implements HGL::IType.
Reimplemented in HGL::Type::FloatParam.
|
virtual |
Detaches a child from the IType.
| type | the IType to detach |
Implements HGL::IType.
Reimplemented in HGL::Type::Poly, and HGL::Type::RenderCallback.
Referenced by HGL::Type::Poly::detachType().
|
virtual |
Gets the iterator to the end over this type's attached types.
Implements HGL::IType.
Referenced by HGL::Type::Ellipse::isValid(), and HGL::Type::Text::isValid().
|
virtual |
Returns all attached IType instances.
IType instances Implements HGL::IType.
Reimplemented in HGL::Type::RenderCallback, and HGL::Type::VirtualGroup.
Referenced by HGL::Type::ExpressionParam::findReference(), HGL::Type::RenderCallback::getAttachedTypes(), getBoundingBox(), HGL::Type::Poly::getFill(), HGL::Type::Ellipse::getFill(), HGL::Type::NonEmptyType::isValid(), HGL::Type::Poly::isValid(), HGL::Type::Ellipse::isValid(), HGL::Type::Text::isValid(), HGL::Type::Curve::isValid(), isValid(), and resolve().
|
virtual |
Gets the bounding box of the type.
Implements HGL::IType.
Reimplemented in HGL::Type::Point, HGL::Type::Line, HGL::Type::Vector2D, HGL::Type::Fill, HGL::Type::ParamBase, and HGL::Type::Text.
References getAttachedTypes(), and BOUNDINGBOX::isDefined().
Referenced by HGL::Type::Line::getBoundingBox().
|
protectedvirtual |
|
virtual |
Gets the identifier.
Implements HGL::IType.
Reimplemented in HGL::Type::NamedParam, and HGL::Type::Procedure.
Referenced by HGL::Type::Procedure::getId().
|
virtual |
Returns the parent IType.
IType or NULL if there is no parent Implements HGL::IType.
Referenced by HGL::Type::FloatParam::clone().
|
protectedvirtual |
Get the root of a type.
| type | the type to get the root of |
Implements HGL::IType.
References HGL::IType::getRoot().
|
protectedvirtual |
Displayable name of the IType.
Reimplemented in HGL::Type::ExpressionParam, and HGL::Type::NamedParam.
References HGL::IType::getSerialID().
Referenced by HGL::Type::NamedParam::getTypeName(), and HGL::Type::ExpressionParam::getTypeName().
|
virtual |
Checks if the type is null type.
true if the type is null type, false otherwise Implements HGL::IType.
|
protectedvirtual |
Checks if the type is valid.
A type is valid
Subclasses can add more checks if neccessary.
true if the type is valid, false otherwise Implements HGL::IType.
Reimplemented in HGL::Type::Point, HGL::Type::Curve, HGL::Type::Text, HGL::Type::Ellipse, HGL::Type::Project, HGL::Type::Poly, HGL::Type::NonEmptyType, and HGL::Type::ReferenceHolderBase.
References getAttachedTypes(), and HGL::IType::isValid().
Referenced by HGL::Type::ReferenceHolderBase::isValid(), and HGL::Type::NonEmptyType::isValid().
|
protectedvirtual | |||||||||||||||||
Converts the type into a float
float Implements HGL::IType.
Reimplemented in HGL::Type::FloatParam, and HGL::Type::ReferenceParam.
|
protectedvirtual |
Resolves a type by its ID.
| id | the id to resolve |
0L if no type could get resolved by that id Implements HGL::IType.
Reimplemented in HGL::Type::AssignmentOperator.
References getAttachedTypes().
|
virtual |
|
virtual |
Sets the identifier.
| id | the identifier |
Implements HGL::IType.
Reimplemented in HGL::Type::NamedParam.
Referenced by HGL::Type::NamedParam::setId().
|
protectedvirtual |
Set parent of the type.
| parent | the parent of the type |
Implements HGL::IType.
Referenced by HGL::Type::FloatParam::clone().
1.8.5