Public Types | Public Member Functions | Public Attributes | Protected Member Functions

KFbxLodGroup Class Reference

This reference page is linked to from the following overview topics: FBX SDK 2011, Supported Scene Elements, FBX Node Attributes, List of Python FBX classes.


Search for all occurrences

Detailed Description

Defines a LOD (Level of Detail) group.

This LodGroup node is a group node that can be used to detect how close a group of objects is to a camera. Typically this node is used for controlling "Level of Detail" visibility.

Properties in the class are designed according to Maya implementation. So these properties may be incompatible with other software, like 3ds Max.

In Maya, with "Level of Detail",the visibility of the children of this transform are controlled by the distance of a group to a camera and the threshold values. For example, under a LOD group node, there are three children: ship_detailed, ship_medium, and ship_rough. There are three threshold values: 5, 10 and 15. When the camera is within 5 units of the group bounding box, only ship_detailed is visible. When the view is zoomed out and the camera is 9 units away from the group, only ship_medium is visible. When the view is zoomed out to 30 units away, only ship_rough is visible.

This node attribute contains the properties of a null node.

Example code to create LODGroup:

 KFbxNode *lLodGroup = KFbxNode::Create(pScene, "LODNode");
 KFbxLodGroup *lLodGroupAttr = KFbxLodGroup::Create(pScene, "LODGroup1");
 // Array lChildNodes contains geometries of all LOD levels
 for (int j = 0; j < lChildNodes.GetCount(); j++)
 {
    lLodGroup->AddChild(lChildNodes.GetAt(j));
 }
Examples:

ImportScene/DisplayLodGroup.cxx.

Definition at line 81 of file kfbxlodgroup.h.

#include <kfbxlodgroup.h>

Inheritance diagram for KFbxLodGroup:
Inheritance graph
[legend]

List of all members.

Public Types

enum   EDisplayLevel { eUseLOD, eShow, eHide }
 

types to determine how to display nodes in LODGroup.

More...

Public Member Functions

virtual EAttributeType  GetAttributeType () const
  Return the type of node attribute which is EAttributeType::eLODGROUP.
int  GetNumThresholds () const
  Get the size of the threshold list.
bool  AddThreshold (fbxDistance pThreshValue)
  Add a new threshold value to the current list.
bool  SetThreshold (int pEl, fbxDistance pThreshValue)
  Set the threshold value for the specified object.
bool  GetThreshold (int pEl, fbxDistance &pThreshValue) const
  Get the threshold value for the specified object.
int  GetNumDisplayLevels () const
  Get the size of the displayLevel list.
bool  AddDisplayLevel (KFbxLodGroup::EDisplayLevel pValue)
  Add a new displayLevel value to the current list.
bool  SetDisplayLevel (int pEl, KFbxLodGroup::EDisplayLevel pValue)
  Set the display level value for the specified object.
bool  GetDisplayLevel (int pEl, KFbxLodGroup::EDisplayLevel &pValue) const
  Get the display level value for the specified object.
virtual KFbxObject Copy (const KFbxObject &pObject)
  Copy an object content into this object.
virtual KStringList  GetTypeFlags () const

Public Attributes

KFbxTypedProperty< fbxBool1 MinMaxDistance
  This property handles the use of the Min/Max distances.
KFbxTypedProperty< fbxDouble1 MinDistance
  The minimum distance at which the group is displayed.
KFbxTypedProperty< fbxDouble1 MaxDistance
  The maximum distance at which the group is displayed.
KFbxTypedProperty< fbxBool1 WorldSpace
  Work in world space of transform or local space If true, the camera distance to the LOD group will be computed in world space.

Protected Member Functions

  KFbxLodGroup (KFbxSdkManager &pManager, char const *pName)
virtual bool  ConstructProperties (bool pForceSet)

Member Enumeration Documentation

types to determine how to display nodes in LODGroup.

  • eUseLOD Display the node according LOD threshold
  • eShow Always show this node
  • eHide Always hide this node
Enumerator:
eUseLOD 
eShow 
eHide 

Definition at line 94 of file kfbxlodgroup.h.


Constructor & Destructor Documentation

KFbxLodGroup ( KFbxSdkManager pManager,
char const *  pName 
) [protected]

Member Function Documentation

virtual EAttributeType GetAttributeType ( ) const [virtual]

Return the type of node attribute which is EAttributeType::eLODGROUP.

Reimplemented from KFbxNodeAttribute.

int GetNumThresholds ( ) const

Get the size of the threshold list.

In correct situation, the size is less one than LOD nodes number.

Returns:
The current size of the threshold list.
Examples:
ImportScene/DisplayLodGroup.cxx.
bool AddThreshold ( fbxDistance  pThreshValue )

Add a new threshold value to the current list.

Parameters:
pThreshValue Threshold distance from the previous entry in the threshold list
Remarks:
This list can only expand so the only way to shrink it, is to completely destroy this object.
This method does not check the received values and blindly add them to the list. Therefore duplicated values can exist in different positions in the list.
Returns:
true if successful and false if any error occurred.
bool SetThreshold ( int  pEl,
fbxDistance  pThreshValue 
)

Set the threshold value for the specified object.

Parameters:
pEl The index of the object we want to set the threshold.
pThreshValue Threshold distance from the previous entry in the threshold list
Returns:
true if successful and false if the specified index is invalid.
bool GetThreshold ( int  pEl,
fbxDistance pThreshValue 
) const

Get the threshold value for the specified object.

Parameters:
pEl The index of the object we want to get the threshold.
pThreshValue the current threshold value.
Returns:
true if successful and false if the specified index is invalid.
Remarks:
in case of a failure, the pThreshValue is left unchanged.
Examples:
ImportScene/DisplayLodGroup.cxx.
int GetNumDisplayLevels ( ) const

Get the size of the displayLevel list.

In correct situation, the size is equal to LOD nodes number.

Returns:
The current size of the displayLevel list.
Examples:
ImportScene/DisplayLodGroup.cxx.
bool AddDisplayLevel ( KFbxLodGroup::EDisplayLevel  pValue )

Add a new displayLevel value to the current list.

The value overrides the display of any level and can force it to hide or show the object at that level. For example, if the distance between the group and the camera is smaller than the first threshold, then the object at level 0 is visible. If the display level for the object at level 2 is changed to eShow, ie. if the attribute displayLevel[2] is set to eShow, then the object at level 2 will show, regardless of the current active level.

Parameters:
pValue Display level value
Remarks:
This list can only expand so the only way to shrink it, is to completely destroy this object.
This method does not check the received values and blindly add them to the list. Therefore duplicated values can exist in different positions in the list.
Returns:
true if successful and false if any error occurred.
bool SetDisplayLevel ( int  pEl,
KFbxLodGroup::EDisplayLevel  pValue 
)

Set the display level value for the specified object.

Parameters:
pEl The index of the object we want to set the display level.
pValue New display level value
Returns:
true if successful and false if the specified index is invalid.
bool GetDisplayLevel ( int  pEl,
KFbxLodGroup::EDisplayLevel pValue 
) const

Get the display level value for the specified object.

Parameters:
pEl The index of the object we want to get the display level value.
pValue the current display level value.
Returns:
true if successful and false if the specified index is invalid.
Remarks:
in case of a failure, the pValue is left unchanged.
Examples:
ImportScene/DisplayLodGroup.cxx.
virtual KFbxObject& Copy ( const KFbxObject pObject ) [virtual]

Copy an object content into this object.

Parameters:
pObject The source object to copy data from.
Returns:
Returns the destination object being modified by the source.
Remarks:
This function replace the assignment operator (operator=). It will copy all property values and the name. Connections are NOT copied.

Reimplemented from KFbxObject.

virtual bool ConstructProperties ( bool  pForceSet ) [protected, virtual]
virtual KStringList GetTypeFlags ( ) const [virtual]

Member Data Documentation

This property handles the use of the Min/Max distances.

Enables the minimum and maximum distance to take effect. For example, if the distance between the group and the camera is smaller than the minimum distance, then the whole group disappears.

To access this property do: MinMaxDistance.Get(). To set this property do: MinMaxDistance.Set(bool).

Default value is false.

Examples:
ImportScene/DisplayLodGroup.cxx.

Definition at line 116 of file kfbxlodgroup.h.

The minimum distance at which the group is displayed.

To access this property do: MinDistance.Get(). To set this property do: MinDistance.Set(double).

Default value is -100

Examples:
ImportScene/DisplayLodGroup.cxx.

Definition at line 125 of file kfbxlodgroup.h.

The maximum distance at which the group is displayed.

To access this property do: MaxDistance.Get(). To set this property do: MaxDistance.Set(double).

Default value is 100

Examples:
ImportScene/DisplayLodGroup.cxx.

Definition at line 134 of file kfbxlodgroup.h.

Work in world space of transform or local space If true, the camera distance to the LOD group will be computed in world space.

This means it is possible to parent the LOD transform below other transforms and still have it work as expected. If this attribute is set to false, the distance computation ignores any parent transforms of the LOD transform.

To access this property do: WorldSpace.Get(). To set this property do: WorldSpace.Set(bool).

Default value is false

Examples:
ImportScene/DisplayLodGroup.cxx.

Definition at line 147 of file kfbxlodgroup.h.


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

KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup
KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup KFbxLodGroup