PackFloat_FixedPoint Class Reference
[Base Type Serializable Classes]

#include <PackFloat_FixedPoint.h>

Inherits PackFloat.

Inherited by PackList_TimeBlockTrack::TimeBlockTrackElement::PackFloat_FixedPoint_TimeBlock, and PackList_TimeTrack::TimeTrackElement::PackFloat_FixedPoint_Time.

List of all members.


Detailed Description

Base type managing a float, but serialized like a PackLong. You provide a const number at construction that fixes a number of bit after the point. For example, 1 bit after the point will make possible: 0.0f , 0.5f, 1.0f, 1.5f,... 2 bits after the point will manage: 0.0f,0.25f,0.5f,0.75f,1.0f,1.25f,...

Definition at line 20 of file PackFloat_FixedPoint.h.

Public Types

enum  VectorDimension { vd_X = 1, vd_XY = 2, vd_XYZ = 3, vd_XYZD = 4 }
enum  eVedaUpdate {
  eVedaUpdate_NoUpdate = 0, eVedaUpdate_MemberIsGoingToChange, eVedaUpdate_MemberChanged, eVedaUpdate_MemberChangedBecauseOfUndo,
  eVedaUpdate_MemberDestroyed, eVedaUpdate_ObjectNew, eVedaUpdate_ObjectDestroyed, eVedaUpdate_ObjectReCreated,
  eVedaUpdate_ObjectClosed, eVedaUpdate_NewRegisteredClass
}
 enum used by BaseContext::NotifyObjectChange() to describe the notification meaning. Used by interfaces to monitor a context. More...

Public Member Functions

 PackFloat_FixedPoint ()
 Constructor by default number of bit after the point is 6: (_ValueToMultiplyFromIntToFloat=1/64.0).
 PackFloat_FixedPoint (const float _ValueToMultiplyFromIntToFloat)
 Constructor.
 PackFloat_FixedPoint (VectorDimension _DimensionEnum, const float _ValueToMultiplyFromIntToFloat)
 Constructor To initialize PackFloat as a multi dimentional vector.
virtual ~PackFloat_FixedPoint (void)
 Destructor.
virtual const unsigned char * Serialize_In (const unsigned char *_pDescriptionChunk)
 Read the object description from a byte chunk. Could crash if chunk not valid.
virtual unsigned int GetSerializedDescriptionSize (void)
 get the size of the whole byte chunk that will be written by Serialize_Out().
virtual unsigned char * Serialize_Out (unsigned char *_pDescriptionChunkToFill)
 write the Current object definition to a Chunk using private packed types, recursively.
virtual const char * GetClassID () const
 Each BaseType's inherited classes must explicit an ID for their class, or let use one of the super class at least through this virtual method. This is needed by GUIs to detect the types of each sub-members, and shape an interface for each Object according to their member list.
virtual const char * ValueToString ()
 convert the value of this object to an explicit string. The object manages the string privately, so just read it or copy it. the string would be destroyed with the objects, and changed when using Set() methods. Note: this is not virtual, but each class can manage m_pValueString or not.
virtual void Set (float _value)
 change the value:
virtual void Set (unsigned int _dimensionIndex, float _value)
 change the value of a given dimension:
void Set3f (float _x, float _y, float _z)
 change values of X,Y and Z.
float Get () const
 Get the value.
float Get (unsigned int _dimensionIndex) const
 Get the value. WILL CRASH IF _dimensionIndex>2.
VectorDimension GetVectorDimension ()
 return Dimension Managed. it should be
virtual unsigned int WriteFile (const char *_pFileName)
 write a serialized form, using GetSerializedDescriptionSize() and Serialize_Out().
virtual unsigned int ReadFile (const char *_pFileName)
 Try to read a serialized form, using Serialize_In().
virtual void SetObjectThatManagesThis (BaseObject *_pManager)
 The Object this one belong to as a member. Should only be used at init.
void SetMemberName (const char *_MemberName)
 Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() returning NULL should not be edited by an interface or undo-managed. Use REGISTER_MEMBER macros family: it registers the members and use SetMemberName() automatically (or not, according to the compilation mode).
const char * GetMemberName () const
 Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() to NULL should not be edited by an interface or undo-managed. set with SetMemberName().
void SetMemberInfo (const char *_MemberInfo)
 Explicits the use of an object when used as a class member. It should explain what the member does for the object. It exists only in editable mode,and can be used by any GUI. Don't use html tags , only \n are allowed. Use REGISTER_MEMBER_INFO macro after the REGISTER_MEMBER macro in the constructors. It can be left NULL.
const char * GetMemberInfo () const
 Explicits the use of an object when used as a class member. It exists only in editable mode and can be used by any GUI. It should explain what the member does for the object.
BaseObjectGetObjectThatManagesThis ()
 If there is any, get the object that manages this one as a member.
void MakeCloneOf (BaseType &_ModelObject)
 Tool that makes an object take the values of another using serialization. Use with care: You got to clone a PackUlong with a PackULong, a PackString with a PackString: Clone Object of the same type or it will crash . A test is done at the beginning to check that for both types are the sames, if not it does nothing. however it may still crash with 2 objects from unherited classes. Also, some type like PackObjectReference, will not clone its value by copying a pointer.Reference member clonage is done with BaseObject::Clone().

Static Public Attributes

static const float m_0p0
 public const float value in order to optimize size access for equations:
static const float m_0p01
static const float m_0p00001
static const float m_0p25
static const float m_0p5
static const float m_1p0
static const float m_2p0
static const float m_255p0
static const float m_256p0
static const float m_0p0625
static const float m_100p0
static const float m_1Div255
static const float m_1Div256
static const float m_1Div64
static const float m_Pi
static const float m_2Pi
static const float m_180DivPi
static const float m_32767p0
static const float m_Max

Protected Member Functions

void BeginChangeNotification ()
 In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.
void EndChangeNotification ()
 In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.

Protected Attributes

float m_ValueToMultiplyFromIntToFloat
 the value that give the ratio for serialization:
float m_value [vd_XYZD]
 the value of this class:
const unsigned int m_NumberOfDimensionManaged
 the number of Dimension managed if PackFloat was initialized as a vector
BaseObjectm_pObjectThatManagesThis
 an object can belong (or not) to a BaseObject,( and to a BaseContext through it).
const char * m_pMemberName
 If used as a member in an object, the member name, or NULL (not editable member).
const char * m_pMemberInfo
 a short string explaining what's the object for in editable mode. OK if NULL (no info).
PackStringm_pValueString
 a string standing for an expression of the value of the object:
unsigned char * m_pPreviousValueShape
 used as a temp for object change notification in Begin/EndChangeNotification():
unsigned int m_PreviousValueShapeLength


Member Enumeration Documentation

enum eVedaUpdate [inherited]
 

enum used by BaseContext::NotifyObjectChange() to describe the notification meaning. Used by interfaces to monitor a context.

Enumerator:
eVedaUpdate_NoUpdate  0 means No Update.
eVedaUpdate_MemberIsGoingToChange  Sent before a BaseObject member value change.( in order to lock the context to prevent object use from other thread.).
eVedaUpdate_MemberChanged  a member of a BaseObject just changed.
eVedaUpdate_MemberChangedBecauseOfUndo  a member of a BaseObject just changed, but because of an undo. you may treat it the same as eVedaUpdate_MemberChanged.
eVedaUpdate_MemberDestroyed  Member of object Destroyed ! Watch out, the ID of the member is a dead pointer.
eVedaUpdate_ObjectNew  new BaseObject created.
eVedaUpdate_ObjectDestroyed  BaseObject just destroyed.Watch out, the ID of the object is a dead pointer.
eVedaUpdate_ObjectReCreated  an object has just been Created; It's state has changed!
eVedaUpdate_ObjectClosed  an object has just been closed; It's state has changed!
eVedaUpdate_NewRegisteredClass  TODO: a new class has been registered to the context.

Definition at line 194 of file BaseType.h.

enum VectorDimension [inherited]
 

Enumerator:
vd_X  declare a PackFloat with one dimension
vd_XY  declare a PackFloat with two dimensions
vd_XYZ  declare a PackFloat with three dimensions
vd_XYZD  declare a PackFloat with 4 dimensions

Definition at line 40 of file PackFloat.h.


Constructor & Destructor Documentation

PackFloat_FixedPoint  ) 
 

Constructor by default number of bit after the point is 6: (_ValueToMultiplyFromIntToFloat=1/64.0).

PackFloat_FixedPoint const float  _ValueToMultiplyFromIntToFloat  ) 
 

Constructor.

Parameters:
_ValueToMultiplyFromIntToFloat fixes how many bit are used after the point.

PackFloat_FixedPoint VectorDimension  _DimensionEnum,
const float  _ValueToMultiplyFromIntToFloat
 

Constructor To initialize PackFloat as a multi dimentional vector.

Parameters:
_DimensionEnum on of the 3 VectorDimension enum.
_ValueToMultiplyFromIntToFloat fixes how many bit are used after the point.

virtual ~PackFloat_FixedPoint void   )  [virtual]
 

Destructor.


Member Function Documentation

void BeginChangeNotification  )  [protected, inherited]
 

In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.

void EndChangeNotification  )  [protected, inherited]
 

In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.

float Get unsigned int  _dimensionIndex  )  const [inline, inherited]
 

Get the value. WILL CRASH IF _dimensionIndex>2.

Parameters:
_dimensionIndex 0 for X, 1 for Y, 2 for Z
Returns:
the float

Definition at line 137 of file PackFloat.h.

References PackFloat::m_value.

float Get  )  const [inline, inherited]
 

Get the value.

Returns:
the float

Definition at line 131 of file PackFloat.h.

References PackFloat::m_value.

Referenced by InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::GetPlaySpeed(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::GetPreviewCurrentTime(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::GetPreviewEndTime(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::GetPreviewPosition(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::GetPreviewRotation(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::GetPreviewStartTime(), InterfacePrefObject::GetSoundMainVolume(), PackList_TimeTrack::TimeTrackElement::GetTimeInSecond(), PackList_TimeBlockTrack::TimeBlockTrackElement::GetTimeInSecond(), and InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::GetViewportScale().

virtual const char* GetClassID  )  const [inline, virtual]
 

Each BaseType's inherited classes must explicit an ID for their class, or let use one of the super class at least through this virtual method. This is needed by GUIs to detect the types of each sub-members, and shape an interface for each Object according to their member list.

Returns:
a const character string, that must be unique and unchanged for all serializable base type.

Reimplemented from PackFloat.

Definition at line 78 of file PackFloat_FixedPoint.h.

const char* GetMemberInfo  )  const [inline, inherited]
 

Explicits the use of an object when used as a class member. It exists only in editable mode and can be used by any GUI. It should explain what the member does for the object.

Returns:
a short string explaining what's the object for, or NULL if not set.

Definition at line 144 of file BaseType.h.

References BaseType::m_pMemberInfo.

const char* GetMemberName  )  const [inline, inherited]
 

Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() to NULL should not be edited by an interface or undo-managed. set with SetMemberName().

Returns:
the member name or NULL

Definition at line 123 of file BaseType.h.

References BaseType::m_pMemberName.

BaseObject* GetObjectThatManagesThis  )  [inline, inherited]
 

If there is any, get the object that manages this one as a member.

Returns:
the object that manages this one as a member, or NULL

Definition at line 170 of file BaseType.h.

References BaseType::m_pObjectThatManagesThis.

virtual unsigned int GetSerializedDescriptionSize void   )  [virtual]
 

get the size of the whole byte chunk that will be written by Serialize_Out().

Returns:
byte size of the serialisation to do.(1,2,3, or4)

Reimplemented from PackFloat.

VectorDimension GetVectorDimension  )  [inline, inherited]
 

return Dimension Managed. it should be

Returns:
the float

Definition at line 145 of file PackFloat.h.

void MakeCloneOf BaseType _ModelObject  )  [inherited]
 

Tool that makes an object take the values of another using serialization. Use with care: You got to clone a PackUlong with a PackULong, a PackString with a PackString: Clone Object of the same type or it will crash . A test is done at the beginning to check that for both types are the sames, if not it does nothing. however it may still crash with 2 objects from unherited classes. Also, some type like PackObjectReference, will not clone its value by copying a pointer.Reference member clonage is done with BaseObject::Clone().

Parameters:
_ModelObject the object took as a model.

virtual unsigned int ReadFile const char *  _pFileName  )  [virtual, inherited]
 

Try to read a serialized form, using Serialize_In().

Parameters:
_pFileName the file path.
Returns:
0 if OK.

virtual const unsigned char* Serialize_In const unsigned char *  _pDescriptionChunk  )  [virtual]
 

Read the object description from a byte chunk. Could crash if chunk not valid.

Parameters:
_pDescriptionChunk the objet description chunk.
Returns:
the end of the chunk written, possibly unlocated. Don't use this if you don't need it.

Reimplemented from PackFloat.

virtual unsigned char* Serialize_Out unsigned char *  _pDescriptionChunkToFill  )  [virtual]
 

write the Current object definition to a Chunk using private packed types, recursively.

Parameters:
_pDescriptionChunkToFill the chunk where to write the objet description chunk.
Returns:
the end of the chunk written, possibly unlocated. Don't use this if you don't need it.

Reimplemented from PackFloat.

virtual void Set unsigned int  _dimensionIndex,
float  _value
[virtual, inherited]
 

change the value of a given dimension:

Parameters:
_dimensionIndex 0 for X, 1 for Y, 2 for Z
_value value

Reimplemented in PackFloatByte_Limits.

virtual void Set float  _value  )  [virtual, inherited]
 

change the value:

Parameters:
_value value

Reimplemented in PackFloatByte_Limits, PackList_TimeBlockTrack::TimeBlockTrackElement::PackFloat_FixedPoint_TimeBlock, and PackList_TimeTrack::TimeTrackElement::PackFloat_FixedPoint_Time.

Referenced by PackFloat::Set3f(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::SetPlaySpeed(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::SetPreviewCurrentTime(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::SetPreviewEndTime(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::SetPreviewPosition(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::SetPreviewRotation(), InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::SetPreviewStartTime(), and InterfacePrefObject::PreviewEdited::InterfacePreviewConfiguration::SetViewportScale().

void Set3f float  _x,
float  _y,
float  _z
[inline, inherited]
 

change values of X,Y and Z.

Parameters:
_x value
_y value
_z value

Definition at line 125 of file PackFloat.h.

References PackFloat::Set().

void SetMemberInfo const char *  _MemberInfo  )  [inherited]
 

Explicits the use of an object when used as a class member. It should explain what the member does for the object. It exists only in editable mode,and can be used by any GUI. Don't use html tags , only \n are allowed. Use REGISTER_MEMBER_INFO macro after the REGISTER_MEMBER macro in the constructors. It can be left NULL.

Parameters:
_MemberName a short string explaining what's the object for.

void SetMemberName const char *  _MemberName  )  [inherited]
 

Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() returning NULL should not be edited by an interface or undo-managed. Use REGISTER_MEMBER macros family: it registers the members and use SetMemberName() automatically (or not, according to the compilation mode).

Parameters:
_MemberName the member name

virtual void SetObjectThatManagesThis BaseObject _pManager  )  [virtual, inherited]
 

The Object this one belong to as a member. Should only be used at init.

Parameters:
_pManager BaseObject

Reimplemented in PackObjectReference, PackResource, PackStruct, and PackTreeCell.

virtual const char* ValueToString  )  [virtual, inherited]
 

convert the value of this object to an explicit string. The object manages the string privately, so just read it or copy it. the string would be destroyed with the objects, and changed when using Set() methods. Note: this is not virtual, but each class can manage m_pValueString or not.

Returns:
the value as a const string.

Reimplemented from BaseType.

virtual unsigned int WriteFile const char *  _pFileName  )  [virtual, inherited]
 

write a serialized form, using GetSerializedDescriptionSize() and Serialize_Out().

Parameters:
_pFileName the file path.
Returns:
0 if OK.


Member Data Documentation

const float m_0p0 [static, inherited]
 

public const float value in order to optimize size access for equations:

Definition at line 145 of file PackFloat.h.

const unsigned int m_NumberOfDimensionManaged [protected, inherited]
 

the number of Dimension managed if PackFloat was initialized as a vector

Definition at line 176 of file PackFloat.h.

const char* m_pMemberInfo [protected, inherited]
 

a short string explaining what's the object for in editable mode. OK if NULL (no info).

Definition at line 259 of file BaseType.h.

Referenced by BaseType::GetMemberInfo().

const char* m_pMemberName [protected, inherited]
 

If used as a member in an object, the member name, or NULL (not editable member).

Definition at line 255 of file BaseType.h.

Referenced by BaseType::GetMemberName().

BaseObject* m_pObjectThatManagesThis [protected, inherited]
 

an object can belong (or not) to a BaseObject,( and to a BaseContext through it).

Definition at line 251 of file BaseType.h.

Referenced by BaseType::GetObjectThatManagesThis().

unsigned char* m_pPreviousValueShape [protected, inherited]
 

used as a temp for object change notification in Begin/EndChangeNotification():

Definition at line 269 of file BaseType.h.

PackString* m_pValueString [protected, inherited]
 

a string standing for an expression of the value of the object:

Definition at line 264 of file BaseType.h.

float m_value[vd_XYZD] [protected, inherited]
 

the value of this class:

Definition at line 173 of file PackFloat.h.

Referenced by PackFloat::Get().

float m_ValueToMultiplyFromIntToFloat [protected]
 

the value that give the ratio for serialization:

Definition at line 78 of file PackFloat_FixedPoint.h.


The documentation for this class was generated from the following file:
      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/