|
@@ -70,13 +70,13 @@ LazyObject::LazyObject(uint64_t id, const Element& element, const Document& doc)
|
|
, id(id)
|
|
, id(id)
|
|
, flags()
|
|
, flags()
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ // empty
|
|
}
|
|
}
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
LazyObject::~LazyObject()
|
|
LazyObject::~LazyObject()
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ // empty
|
|
}
|
|
}
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
@@ -232,16 +232,15 @@ Object::Object(uint64_t id, const Element& element, const std::string& name)
|
|
, name(name)
|
|
, name(name)
|
|
, id(id)
|
|
, id(id)
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ // empty
|
|
}
|
|
}
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
Object::~Object()
|
|
Object::~Object()
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ // empty
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
FileGlobalSettings::FileGlobalSettings(const Document& doc, std::shared_ptr<const PropertyTable> props)
|
|
FileGlobalSettings::FileGlobalSettings(const Document& doc, std::shared_ptr<const PropertyTable> props)
|
|
: props(props)
|
|
: props(props)
|
|
@@ -361,7 +360,6 @@ void Document::ReadGlobalSettings()
|
|
globals.reset(new FileGlobalSettings(*this, props));
|
|
globals.reset(new FileGlobalSettings(*this, props));
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
void Document::ReadObjects()
|
|
void Document::ReadObjects()
|
|
{
|
|
{
|
|
@@ -387,7 +385,6 @@ void Document::ReadObjects()
|
|
}
|
|
}
|
|
|
|
|
|
const char* err;
|
|
const char* err;
|
|
-
|
|
|
|
const uint64_t id = ParseTokenAsID(*tok[0], err);
|
|
const uint64_t id = ParseTokenAsID(*tok[0], err);
|
|
if(err) {
|
|
if(err) {
|
|
DOMError(err,el.second);
|
|
DOMError(err,el.second);
|
|
@@ -469,8 +466,6 @@ void Document::ReadPropertyTemplates()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
void Document::ReadConnections()
|
|
void Document::ReadConnections()
|
|
{
|
|
{
|
|
@@ -482,7 +477,6 @@ void Document::ReadConnections()
|
|
}
|
|
}
|
|
|
|
|
|
uint64_t insertionOrder = 0l;
|
|
uint64_t insertionOrder = 0l;
|
|
-
|
|
|
|
const Scope& sconns = *econns->Compound();
|
|
const Scope& sconns = *econns->Compound();
|
|
const ElementCollection conns = sconns.GetCollection("C");
|
|
const ElementCollection conns = sconns.GetCollection("C");
|
|
for(ElementMap::const_iterator it = conns.first; it != conns.second; ++it) {
|
|
for(ElementMap::const_iterator it = conns.first; it != conns.second; ++it) {
|
|
@@ -491,7 +485,9 @@ void Document::ReadConnections()
|
|
|
|
|
|
// PP = property-property connection, ignored for now
|
|
// PP = property-property connection, ignored for now
|
|
// (tokens: "PP", ID1, "Property1", ID2, "Property2")
|
|
// (tokens: "PP", ID1, "Property1", ID2, "Property2")
|
|
- if(type == "PP") continue;
|
|
|
|
|
|
+ if ( type == "PP" ) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
|
|
const uint64_t src = ParseTokenAsID(GetRequiredToken(el,1));
|
|
const uint64_t src = ParseTokenAsID(GetRequiredToken(el,1));
|
|
const uint64_t dest = ParseTokenAsID(GetRequiredToken(el,2));
|
|
const uint64_t dest = ParseTokenAsID(GetRequiredToken(el,2));
|
|
@@ -518,11 +514,10 @@ void Document::ReadConnections()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
const std::vector<const AnimationStack*>& Document::AnimationStacks() const
|
|
const std::vector<const AnimationStack*>& Document::AnimationStacks() const
|
|
{
|
|
{
|
|
- if (!animationStacksResolved.empty() || !animationStacks.size()) {
|
|
|
|
|
|
+ if (!animationStacksResolved.empty() || animationStacks.empty()) {
|
|
return animationStacksResolved;
|
|
return animationStacksResolved;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -540,7 +535,6 @@ const std::vector<const AnimationStack*>& Document::AnimationStacks() const
|
|
return animationStacksResolved;
|
|
return animationStacksResolved;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
LazyObject* Document::GetObject(uint64_t id) const
|
|
LazyObject* Document::GetObject(uint64_t id) const
|
|
{
|
|
{
|
|
@@ -551,8 +545,7 @@ LazyObject* Document::GetObject(uint64_t id) const
|
|
#define MAX_CLASSNAMES 6
|
|
#define MAX_CLASSNAMES 6
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
-std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id,
|
|
|
|
- const ConnectionMap& conns) const
|
|
|
|
|
|
+std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, const ConnectionMap& conns) const
|
|
{
|
|
{
|
|
std::vector<const Connection*> temp;
|
|
std::vector<const Connection*> temp;
|
|
|
|
|
|
@@ -569,7 +562,6 @@ std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id,
|
|
return temp; // NRVO should handle this
|
|
return temp; // NRVO should handle this
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, bool is_src,
|
|
std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, bool is_src,
|
|
const ConnectionMap& conns,
|
|
const ConnectionMap& conns,
|
|
@@ -578,17 +570,17 @@ std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, bo
|
|
|
|
|
|
{
|
|
{
|
|
ai_assert(classnames);
|
|
ai_assert(classnames);
|
|
- ai_assert(count != 0 && count <= MAX_CLASSNAMES);
|
|
|
|
|
|
+ ai_assert( count != 0 );
|
|
|
|
+ ai_assert( count <= MAX_CLASSNAMES);
|
|
|
|
|
|
size_t lenghts[MAX_CLASSNAMES];
|
|
size_t lenghts[MAX_CLASSNAMES];
|
|
|
|
|
|
const size_t c = count;
|
|
const size_t c = count;
|
|
for (size_t i = 0; i < c; ++i) {
|
|
for (size_t i = 0; i < c; ++i) {
|
|
- lenghts[i] = strlen(classnames[i]);
|
|
|
|
|
|
+ lenghts[ i ] = strlen(classnames[i]);
|
|
}
|
|
}
|
|
|
|
|
|
std::vector<const Connection*> temp;
|
|
std::vector<const Connection*> temp;
|
|
-
|
|
|
|
const std::pair<ConnectionMap::const_iterator,ConnectionMap::const_iterator> range =
|
|
const std::pair<ConnectionMap::const_iterator,ConnectionMap::const_iterator> range =
|
|
conns.equal_range(id);
|
|
conns.equal_range(id);
|
|
|
|
|
|
@@ -620,49 +612,40 @@ std::vector<const Connection*> Document::GetConnectionsSequenced(uint64_t id, bo
|
|
return temp; // NRVO should handle this
|
|
return temp; // NRVO should handle this
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t source) const
|
|
std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t source) const
|
|
{
|
|
{
|
|
return GetConnectionsSequenced(source, ConnectionsBySource());
|
|
return GetConnectionsSequenced(source, ConnectionsBySource());
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
-std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t dest,
|
|
|
|
- const char* classname) const
|
|
|
|
|
|
+std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t dest, const char* classname) const
|
|
{
|
|
{
|
|
const char* arr[] = {classname};
|
|
const char* arr[] = {classname};
|
|
return GetConnectionsBySourceSequenced(dest, arr,1);
|
|
return GetConnectionsBySourceSequenced(dest, arr,1);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
-std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t source,
|
|
|
|
- const char* const* classnames, size_t count) const
|
|
|
|
|
|
+std::vector<const Connection*> Document::GetConnectionsBySourceSequenced(uint64_t source,
|
|
|
|
+ const char* const* classnames, size_t count) const
|
|
{
|
|
{
|
|
return GetConnectionsSequenced(source, true, ConnectionsBySource(),classnames, count);
|
|
return GetConnectionsSequenced(source, true, ConnectionsBySource(),classnames, count);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(uint64_t dest,
|
|
std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(uint64_t dest,
|
|
- const char* classname) const
|
|
|
|
|
|
+ const char* classname) const
|
|
{
|
|
{
|
|
const char* arr[] = {classname};
|
|
const char* arr[] = {classname};
|
|
return GetConnectionsByDestinationSequenced(dest, arr,1);
|
|
return GetConnectionsByDestinationSequenced(dest, arr,1);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(uint64_t dest) const
|
|
std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(uint64_t dest) const
|
|
{
|
|
{
|
|
return GetConnectionsSequenced(dest, ConnectionsByDestination());
|
|
return GetConnectionsSequenced(dest, ConnectionsByDestination());
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(uint64_t dest,
|
|
std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(uint64_t dest,
|
|
const char* const* classnames, size_t count) const
|
|
const char* const* classnames, size_t count) const
|
|
@@ -671,10 +654,9 @@ std::vector<const Connection*> Document::GetConnectionsByDestinationSequenced(ui
|
|
return GetConnectionsSequenced(dest, false, ConnectionsByDestination(),classnames, count);
|
|
return GetConnectionsSequenced(dest, false, ConnectionsByDestination(),classnames, count);
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
Connection::Connection(uint64_t insertionOrder, uint64_t src, uint64_t dest, const std::string& prop,
|
|
Connection::Connection(uint64_t insertionOrder, uint64_t src, uint64_t dest, const std::string& prop,
|
|
- const Document& doc)
|
|
|
|
|
|
+ const Document& doc)
|
|
|
|
|
|
: insertionOrder(insertionOrder)
|
|
: insertionOrder(insertionOrder)
|
|
, prop(prop)
|
|
, prop(prop)
|
|
@@ -687,14 +669,12 @@ Connection::Connection(uint64_t insertionOrder, uint64_t src, uint64_t dest, co
|
|
ai_assert(!dest || doc.Objects().find(dest) != doc.Objects().end());
|
|
ai_assert(!dest || doc.Objects().find(dest) != doc.Objects().end());
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
Connection::~Connection()
|
|
Connection::~Connection()
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ // empty
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
LazyObject& Connection::LazySourceObject() const
|
|
LazyObject& Connection::LazySourceObject() const
|
|
{
|
|
{
|
|
@@ -703,7 +683,6 @@ LazyObject& Connection::LazySourceObject() const
|
|
return *lazy;
|
|
return *lazy;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
LazyObject& Connection::LazyDestinationObject() const
|
|
LazyObject& Connection::LazyDestinationObject() const
|
|
{
|
|
{
|
|
@@ -712,7 +691,6 @@ LazyObject& Connection::LazyDestinationObject() const
|
|
return *lazy;
|
|
return *lazy;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
const Object* Connection::SourceObject() const
|
|
const Object* Connection::SourceObject() const
|
|
{
|
|
{
|
|
@@ -721,7 +699,6 @@ const Object* Connection::SourceObject() const
|
|
return lazy->Get();
|
|
return lazy->Get();
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
const Object* Connection::DestinationObject() const
|
|
const Object* Connection::DestinationObject() const
|
|
{
|
|
{
|
|
@@ -734,4 +711,3 @@ const Object* Connection::DestinationObject() const
|
|
} // !Assimp
|
|
} // !Assimp
|
|
|
|
|
|
#endif
|
|
#endif
|
|
-
|
|
|