- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# FCDocument/FCDAsset.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2005-2007 Feeling Software Inc.
    00003     Portions of the code are:
    00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
    00005
    00006     MIT License: http://www.opensource.org/licenses/mit-license.php
    00007 */
    00013 #ifndef _FCD_ASSET_H_
    00014 #define _FCD_ASSET_H_
    00015
    00016 #ifndef __FCD_OBJECT_H_
    00017 #include "FCDocument/FCDObject.h"
    00018 #endif // __FCD_OBJECT_H_
    00019 #ifndef _FU_DATETIME_H_
    00020 #include "FUtils/FUDateTime.h"
    00021 #endif // _FU_DATETIME_H_
    00022 #ifndef _FU_PARAMETER_H_
    00023 #include "FUtils/FUParameter.h"
    00024 #endif // _FU_PARAMETER_H_
    00025
    00026 class FCDAssetContributor;
    00027
    00048 class FCOLLADA_EXPORT FCDAsset : public FCDObject
    00049 {
    00050 private:
    00051     DeclareObjectType(FCDObject);
    00052
    00053     DeclareParameterContainer(FCDAssetContributor, contributors, FC("Contributors"));
    00054     FUDateTime creationDateTime;
    00055     FUDateTime modifiedDateTime;
    00056     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, keywords, FC("Keywords"));
    00057     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, revision, FC("Revision"));
    00058     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, subject, FC("Subject"));
    00059     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, title, FC("Title"));
    00060     FMVector3 upAxis;
    00061
    00062     // <unit> information
    00063     fstring unitName;
    00064     float unitConversionFactor;
    00065
    00066 public:
    00070     DeclareFlag(HasUpAxis, 0);
    00071
    00075     DeclareFlag(HasUnits, 1);
    00076
    00078     DeclareFlagCount(2);
    00079
    00080 public:
    00083     FCDAsset(FCDocument* document);
    00084
    00086     virtual ~FCDAsset();
    00087
    00090     inline const FCDAssetContributor** GetContributors() const { return contributors.begin(); }
    00094     inline size_t GetContributorCount() const { return contributors.size(); }
    00095
    00099     inline FCDAssetContributor* GetContributor(size_t index) { FUAssert(index < GetContributorCount(), return NULL); return contributors.at(index); }
    00100     inline const FCDAssetContributor* GetContributor(size_t index) const { FUAssert(index < GetContributorCount(), return NULL); return contributors.at(index); }
    00104     FCDAssetContributor* AddContributor();
    00105
    00112     inline const FUDateTime& GetCreationDateTime() const { return creationDateTime; }
    00113
    00116     inline FUDateTime& GetCreationDateTime() { return creationDateTime; }
    00117
    00125     inline const FUDateTime& GetModifiedDateTime() const { return modifiedDateTime; }
    00126
    00130     inline FUDateTime& GetModifiedDateTime() { return modifiedDateTime; }
    00131
    00134     inline const fstring& GetKeywords() const { return keywords; }
    00135
    00138     inline void SetKeywords(const fstring& _keywords) { keywords = _keywords; SetDirtyFlag(); }
    00139
    00143     inline const fstring& GetRevision() const { return revision; }
    00144
    00148     inline void SetRevision(const fstring& _revision) { revision = _revision; SetDirtyFlag(); }
    00149
    00152     inline const fstring& GetSubject() const { return subject; }
    00153
    00156     inline void SetSubject(const fstring& _subject) { subject = _subject; SetDirtyFlag(); }
    00157
    00160     inline const fstring& GetTitle() const { return title; }
    00161
    00164     inline void SetTitle(const fstring& _title) { title = _title; SetDirtyFlag(); }
    00165
    00171     inline const FMVector3& GetUpAxis() const { return upAxis; }
    00172
    00176     inline void SetUpAxis(const FMVector3& _upAxis) { upAxis = _upAxis; SetHasUpAxisFlag(); SetDirtyFlag(); }
    00177
    00180     inline const fstring& GetUnitName() const { return unitName; }
    00181
    00184     inline void SetUnitName(const fstring& _unitName) { unitName = _unitName; SetDirtyFlag(); }
    00185
    00191     inline float GetUnitConversionFactor() const { return unitConversionFactor; }
    00192
    00197     inline void SetUnitConversionFactor(float factor) { unitConversionFactor = factor; SetHasUnitsFlag(); SetDirtyFlag(); }
    00198
    00203     DEPRECATED(3.05A, GetHasUpAxisFlag) inline bool HasUpAxis() const { return GetHasUpAxisFlag(); }
    00204
    00209     DEPRECATED(3.05A, GetHasUnitsFlag) inline bool HasUnits() const { return GetHasUnitsFlag(); }
    00210
    00214     DEPRECATED(3.05A, ResetHasUpAxisFlag) inline void ResetUpAxis() { ResetHasUpAxisFlag(); }
    00215
    00219     DEPRECATED(3.05A, ResetHasUnitsFlag) inline void ResetUnits() { ResetHasUnitsFlag(); }
    00220
    00227     FCDAsset* Clone(FCDAsset* clone = NULL, bool cloneAllContributors = true) const;
    00228
    00229
    00230 };
    00231
    00245 class FCOLLADA_EXPORT FCDAssetContributor : public FCDObject
    00246 {
    00247 private:
    00248     DeclareObjectType(FCDObject);
    00249
    00250     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, author, FC("Author"));
    00251     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, authoringTool, FC("Authoring Tool"));
    00252     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, comments, FC("Comments"));
    00253     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, copyright, FC("Copyright"));
    00254     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, sourceData, FC("Source Data"));
    00255
    00256 public:
    00259     FCDAssetContributor(FCDocument* document);
    00260
    00262     virtual ~FCDAssetContributor();
    00263
    00266     inline const fstring& GetAuthor() const { return author; }
    00267
    00274     inline void SetAuthor(const fstring& _author) { author = _author; SetDirtyFlag(); }
    00275
    00278     inline const fstring& GetAuthoringTool() const { return authoringTool; }
    00279
    00284     inline void SetAuthoringTool(const fstring& _authoringTool) { authoringTool = _authoringTool; SetDirtyFlag(); }
    00285
    00288     inline const fstring& GetComments() const { return comments; }
    00289
    00295     inline void SetComments(const fstring& _comments) { comments = _comments; SetDirtyFlag(); }
    00296
    00299     inline const fstring& GetCopyright() const { return copyright; }
    00300
    00303     inline void SetCopyright(const fstring& _copyright) { copyright = _copyright; SetDirtyFlag(); }
    00304
    00308     inline const fstring& GetSourceData() const { return sourceData; }
    00309
    00313     inline void SetSourceData(const fstring& _sourceData) { sourceData = _sourceData; SetDirtyFlag(); }
    00314
    00318     bool IsEmpty() const;
    00319
    00325     FCDAssetContributor* Clone(FCDAssetContributor* clone = NULL) const;
    00326 };
    00327
    00328 #endif // _FCD_ASSET_H_