| 74 | // ------------------------------------------------------------------------------------------------ |
| 75 | template <typename T> |
| 76 | inline const T* ProcessSimpleConnection(const Connection& con, |
| 77 | bool is_object_property_conn, |
| 78 | const char* name, |
| 79 | const Element& element, |
| 80 | const char** propNameOut = nullptr) { |
| 81 | if (is_object_property_conn && !con.PropertyName().length()) { |
| 82 | DOMWarning("expected incoming " + std::string(name) + |
| 83 | " link to be an object-object connection, ignoring", |
| 84 | &element |
| 85 | ); |
| 86 | return nullptr; |
| 87 | } |
| 88 | else if (!is_object_property_conn && con.PropertyName().length()) { |
| 89 | DOMWarning("expected incoming " + std::string(name) + |
| 90 | " link to be an object-property connection, ignoring", |
| 91 | &element |
| 92 | ); |
| 93 | return nullptr; |
| 94 | } |
| 95 | |
| 96 | if(is_object_property_conn && propNameOut) { |
| 97 | // note: this is ok, the return value of PropertyValue() is guaranteed to |
| 98 | // remain valid and unchanged as long as the document exists. |
| 99 | *propNameOut = con.PropertyName().c_str(); |
| 100 | } |
| 101 | |
| 102 | const Object* const ob = con.SourceObject(); |
| 103 | if(!ob) { |
| 104 | DOMWarning("failed to read source object for incoming " + std::string(name) + |
| 105 | " link, ignoring", |
| 106 | &element); |
| 107 | return nullptr; |
| 108 | } |
| 109 | |
| 110 | return dynamic_cast<const T*>(ob); |
| 111 | } |
| 112 | |
| 113 | } //!Util |
| 114 | } //!FBX |
nothing calls this directly
no test coverage detected