Rev | Line | |
---|
[964] | 1 | /*
|
---|
| 2 | Copyright (C) 2005-2006 Feeling Software Inc.
|
---|
| 3 | MIT License: http://www.opensource.org/licenses/mit-license.php
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | #include "StdAfx.h"
|
---|
| 7 | #include "FCDocument/FCDocument.h"
|
---|
| 8 | #include "FUtils/FUDaeWriter.h"
|
---|
| 9 | using namespace FUDaeWriter;
|
---|
| 10 |
|
---|
| 11 | template <class T>
|
---|
| 12 | FCDPhysicsParameter<T>::FCDPhysicsParameter(FCDocument* document, const string& ref) : FCDPhysicsParameterGeneric(document, ref)
|
---|
| 13 | {
|
---|
| 14 | value = NULL;
|
---|
| 15 | }
|
---|
| 16 |
|
---|
| 17 | template <class T>
|
---|
| 18 | FCDPhysicsParameter<T>::~FCDPhysicsParameter()
|
---|
| 19 | {
|
---|
| 20 | SAFE_DELETE(value);
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | // Clone
|
---|
| 24 | template <class T>
|
---|
| 25 | FCDPhysicsParameterGeneric* FCDPhysicsParameter<T>::Clone()
|
---|
| 26 | {
|
---|
| 27 | FCDPhysicsParameterGeneric *clone = new FCDPhysicsParameter<T>(GetDocument(), reference);
|
---|
| 28 | ((FCDPhysicsParameter<T>*)clone)->value = new T(*value);
|
---|
| 29 | return clone;
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | template <class T>
|
---|
| 33 | void FCDPhysicsParameter<T>::SetValue(T val)
|
---|
| 34 | {
|
---|
| 35 | if(value)
|
---|
| 36 | {
|
---|
| 37 | SAFE_DELETE(value);
|
---|
| 38 | }
|
---|
| 39 | value = new T();
|
---|
| 40 | *value = val;
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 | template <class T>
|
---|
| 45 | void FCDPhysicsParameter<T>::SetValue(T* val)
|
---|
| 46 | {
|
---|
| 47 | if(value)
|
---|
| 48 | {
|
---|
| 49 | SAFE_DELETE(value);
|
---|
| 50 | }
|
---|
| 51 | value = val;
|
---|
| 52 | }
|
---|
| 53 |
|
---|
| 54 | // Flattening: overwrite the target parameter with this parameter
|
---|
| 55 | template <class T>
|
---|
| 56 | void FCDPhysicsParameter<T>::Overwrite(FCDPhysicsParameterGeneric* target)
|
---|
| 57 | {
|
---|
| 58 | ((FCDPhysicsParameter<T>*) target)->SetValue(value);
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | /*
|
---|
| 62 | // Parse in this Collada parameter from the xml node tree
|
---|
| 63 | template <class T>
|
---|
| 64 | FUStatus FCDPhysicsParameter<T>::LoadFromXML(xmlNode* parameterNode)
|
---|
| 65 | {
|
---|
| 66 | FUStatus status;
|
---|
| 67 | return status;
|
---|
| 68 | }
|
---|
| 69 | */
|
---|
| 70 | // Write out this ColladaFX parameter to the xml node tree
|
---|
| 71 | template <class T>
|
---|
| 72 | xmlNode* FCDPhysicsParameter<T>::WriteToXML(xmlNode* parentNode) const
|
---|
| 73 | {
|
---|
| 74 | xmlNode* parameterNode = FUXmlWriter::AddChild(parentNode, reference.c_str());
|
---|
| 75 | //TODO: complete
|
---|
| 76 | return parameterNode;
|
---|
| 77 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.