This class keeps loading attributes for each apf file.
It is managed by ModelImportManager that decides when to request the load of the file, when to merge it, etc. It is created everytime we need to load another apf file from disk. NOTE: If this record is not created and added to the ModelImportManager, the file will never be loaded.
#include <ModelImport.h>
Public Types |
|
enum |
Property { kLoadOnDemand, kPersistent, kLoadSymmetry, kCollapseGroups, kGroupBasedNames, kIgnoreNewGeometry, kIsInactive, kLoadOnce, kCollapseLeafXforms, kObjectBased, kIsAPFZUp, kIsUpAxisFlipped, kMonitorLoadProgress, kIsModified } |
enum |
ImportState { kNotReady, kOffline, kLoading, kWaiting, kLoaded, kFailed, kNotFound } |
enum |
Content { kGeometry, kAnimation, kAlternatives, kShots, kSlides } |
enum |
ImportMode { kNormal, kInitial, kReplacing, kRetessellating, kNeedsConversion } |
Public Member Functions |
|
ModelImport () | |
void | setId (const awSupport::Id &id) |
const awSupport::Id & | getId () const |
void | getFilename (awString::IString &) const |
const awString::IString & | getFilename () const |
void | setFilename (const awString::IString &) |
const awString::IString & | getOriginalFilename () const |
void | setOriginalFilename (const awString::IString &) |
double | getOriginalFileTimestamp () const |
void | setOriginalFileTimestamp (double) |
double | getOriginalImportTimestamp () const |
void | setOriginalImportTimestamp (double) |
const awString::IString & | getLabel () const |
void | setLabel (const awString::IString &) |
bool | isZUp () const |
bool | getFlipUp () const |
void | setFlipUp (bool flip) |
void | setOriginalLayers (const LayerListRef &layers) |
awString::IString | getLayer (const awString::IString &nodeId) |
void | setMaterials (const awScene::MaterialTableRef &materials) |
awScene::MaterialTableRef | getMaterials () const |
const awString::IString & | getLengthUnits () const |
void | setLengthUnits (const awString::IString &) |
const awString::IString & | getTempLengthUnits () const |
void | setTempLengthUnits (const awString::IString &) |
const awString::IString & | getOriginalApfLengthUnits () const |
void | setOriginalApfLengthUnits (const awString::IString &) |
const awString::IString & | getOriginalLengthUnits () const |
void | setOriginalLengthUnits (const awString::IString &) |
void | setMirrorMatrix (const awLinear::AffineMatrix &) |
void | getMirrorMatrix (awLinear::AffineMatrix &) const |
awScene::ImportRef | getParent () const |
void | setModelRootId (const awString::IString &id) |
const awSupport::Id & | getModelRootId () const |
awScene::NodeRef | getModelRoot () const |
bool | getIsDeleted () const |
ImportState | getState () const |
Thread-safe. |
|
void | setState (ImportState state) |
ImportMode | getMode () const |
void | setMode (ImportMode mode) |
bool | addNodeId (const awSupport::Id &id) |
These are not thread-safe. |
|
bool | removeNodeId (const awSupport::Id &id) |
void | clearNodeIds () |
const awSupport::IdSet & | getNodeIds () const |
bool | addDeletedNodeId (const awSupport::Id &id, bool force) |
bool | removeDeletedNodeId (const awSupport::Id &id, bool force=false) |
void | clearDeletedNodeIds () |
const awSupport::IdSet & | getDeletedNodeIds () const |
bool | hasNodeId (const awSupport::Id &id) const |
Returns true if a node with this id is part
of this model (deleted or not). |
|
void | setContentFile (Content content, const awString::IString &file) |
const awString::IString & | getContentFile (Content content) const |
awSupport::GeometryDataLoaderRef | getLoader () |
void | setLoader (awSupport::GeometryDataLoaderRef loader) |
const awSupport::IdSet & | getOrphanedNodeIds () const |
bool | needsMerge () const |
Static Public Attributes |
|
static
awRTB::SignalArg < ModelImport * > |
sigStateChanged |
Protected Member Functions |
|
~ModelImport () | |
Friends |
|
class | ObjectMerger |
enum Property |
{ kLoadOnDemand // If true, the file will load asynchronously. , kPersistent // If a model import is set to persistent, // it's designed to persist through the life // of the application. Because of this, even // on clear, load requests for persistent // objects should not prune out such requests , kLoadSymmetry // If set, then symmetry is read from file , kCollapseGroups // If set, groups that are below transforms // that represent the same entity will be // collapsed to one node. , kGroupBasedNames // If set, the naming is based on groups , kIgnoreNewGeometry // If set, new geometry for this // model import record will not be added // to the scene. Typically this property // is set on nodes that are created as a , kIsInactive // If set, the import has been deleted and // should never be loaded. , kLoadOnce // If set, the model will only be loaded once, // the model import record will not be added into GeometryDataManager , kCollapseLeafXforms // If set, the leaf transforms will be collapsed to mesh geometries. , kObjectBased // If set, the model will have an APF per object // rather than an APF for the whole model. , kIsAPFZUp // The original up-axis from the APF: true for Z and false for Y. , kIsUpAxisFlipped // If set, the user has flipped this model in Showcase. , kMonitorLoadProgress // If set, this model need to monitor the loading progress of model files. , kIsModified // If set, this model has been structually modified, so that it's a3g file // needs to be regenerated the next time the scene is saved. } Property;
enum ImportState |
enum Content |
{ kGeometry , kAnimation , kAlternatives , kShots , kSlides } Content;
enum ImportMode |
{ kNormal // The default value. , kInitial // The model is being imported for the first time. , kReplacing // The model is being replaced. , kRetessellating // The model is being retessellated. , kNeedsConversion // The model is being conversion. } ImportMode;
ModelImport | ( | ) |
~ModelImport | ( | ) | [protected] |
void setId | ( | const awSupport::Id & | id | ) |
const awSupport::Id& getId | ( | ) | const |
void getFilename | ( | awString::IString & | ) | const |
const awString::IString& getFilename | ( | ) | const |
void setFilename | ( | const awString::IString & | ) |
const awString::IString& getOriginalFilename | ( | ) | const |
void setOriginalFilename | ( | const awString::IString & | ) |
double getOriginalFileTimestamp | ( | ) | const |
void setOriginalFileTimestamp | ( | double | ) |
double getOriginalImportTimestamp | ( | ) | const |
void setOriginalImportTimestamp | ( | double | ) |
const awString::IString& getLabel | ( | ) | const |
void setLabel | ( | const awString::IString & | ) |
bool isZUp | ( | ) | const |
bool getFlipUp | ( | ) | const |
void setFlipUp | ( | bool | flip | ) |
void setOriginalLayers | ( | const LayerListRef & | layers | ) |
awString::IString getLayer | ( | const awString::IString & | nodeId | ) |
void setMaterials | ( | const awScene::MaterialTableRef & | materials | ) |
awScene::MaterialTableRef getMaterials | ( | ) | const |
const awString::IString& getLengthUnits | ( | ) | const |
void setLengthUnits | ( | const awString::IString & | ) |
const awString::IString& getTempLengthUnits | ( | ) | const |
void setTempLengthUnits | ( | const awString::IString & | ) |
const awString::IString& getOriginalApfLengthUnits | ( | ) | const |
void setOriginalApfLengthUnits | ( | const awString::IString & | ) |
const awString::IString& getOriginalLengthUnits | ( | ) | const |
void setOriginalLengthUnits | ( | const awString::IString & | ) |
void setMirrorMatrix | ( | const awLinear::AffineMatrix & | ) |
void getMirrorMatrix | ( | awLinear::AffineMatrix & | ) | const |
awScene::ImportRef getParent | ( | ) | const |
void setModelRootId | ( | const awString::IString & | id | ) |
const awSupport::Id& getModelRootId | ( | ) | const |
awScene::NodeRef getModelRoot | ( | ) | const |
bool getIsDeleted | ( | ) | const |
ImportState getState | ( | ) | const |
Thread-safe.
void setState | ( | ImportState | state | ) |
ImportMode getMode | ( | ) | const |
void setMode | ( | ImportMode | mode | ) |
bool addNodeId | ( | const awSupport::Id & | id | ) |
bool removeNodeId | ( | const awSupport::Id & | id | ) |
void clearNodeIds | ( | ) |
const awSupport::IdSet& getNodeIds | ( | ) | const |
bool addDeletedNodeId | ( | const awSupport::Id & | id, |
bool | force | ||
) |
bool removeDeletedNodeId | ( | const awSupport::Id & | id, |
bool | force =
false |
||
) |
void clearDeletedNodeIds | ( | ) |
const awSupport::IdSet& getDeletedNodeIds | ( | ) | const |
bool hasNodeId | ( | const awSupport::Id & | id | ) | const |
Returns true if a node with this id is part of this model (deleted or not).
void setContentFile | ( | Content | content, |
const awString::IString & | file | ||
) |
const awString::IString& getContentFile | ( | Content | content | ) | const |
awSupport::GeometryDataLoaderRef getLoader | ( | ) |
void setLoader | ( | awSupport::GeometryDataLoaderRef | loader | ) |
const awSupport::IdSet& getOrphanedNodeIds | ( | ) | const |
bool needsMerge | ( | ) | const |
friend class ObjectMerger
[friend] |
awRTB::SignalArg<ModelImport
*>
sigStateChanged [static] |