+//
// utils.cpp: Stuff that's useful to have kicking around, in one spot
//
// Part of the Architektonas Project
#include <string.h> // For memcpy()
#include "geometry.h"
-
//
// Copy objects in one vector to another, creating copies and placing them in
// the other vector. Clearing & etc. of vectors is responsibility of the caller!
}
}
-
VPVector CopyObjects(VPVector & src)
{
VPVector copy;
return copy;
}
-
//
// Create a copy of the passed in object.
//
return (Object *)newObject;
}
-
//
// Create a copy of the passed in object. This version calls the second
// version of CopyObjects() (with one parameter and a vector return value).
return (Object *)newObject;
}
-
void MoveSelectedObjectsTo(VPVector & dest, VPVector & from)
{
VPVectorIter i = from.begin();
}
}
-
VPVector MoveSelectedObjectsFrom(VPVector & from)
{
VPVector objects;
return objects;
}
-
//hmm, this won't work, as these are just pointers...
//[should work now]
void CopySelectedObjectsTo(VPVector & dest, VPVector & from)
}
}
-
VPVector CopySelectedObjects(VPVector & src)
{
VPVector copy;
return copy;
}
-
void AddObjectsTo(VPVector & dest, VPVector & from)
{
for(VPVectorIter i=from.begin(); i!=from.end(); i++)
dest.push_back(*i);
}
-
void ClearSelected(VPVector & v)
{
for(VPVectorIter i=v.begin(); i!=v.end(); i++)
((Object *)(*i))->selected = false;
}
-
//
// Select all *visible* objects. If an object's layer is invisible, skip it.
//
}
}
-
//
// Recursively go down thru the Container's vectors, deleting all the objects
// contained therein. Once that is done, the main Container can be deleted.
v.clear();
}
-
void DeleteSelectedObjects(VPVector & v)
{
VPVectorIter i = v.begin();
}
}
-
//
// This is used to remove selected objects from one container in order to move
// them to a different container.
}
}
+//
+// This is used to remove hovered objects from one container in order to delete
+// them from the same container.
+//
+void RemoveHoveredObjects(VPVector & v)
+{
+ VPVectorIter i = v.begin();
+
+ while (i != v.end())
+ {
+ Object * obj = (Object *)(*i);
+
+ if (obj->hovered)
+ v.erase(i);
+ else
+ i++;
+ }
+}
void SavePointsFrom(VPVector & v, std::vector<Object> & save)
{
}
}
-
void RestorePointsTo(VPVector & v, std::vector<Object> & s)
{
std::vector<Object>::iterator i;
}
}
-
void RestorePointsTo(VPVector & v, VPVector & s)
{
for(VPVectorIter i=s.begin(), j=v.begin(); i!=s.end(); i++, j++)
}
}
-
//
// Translate a single object; it it's a Container, translate all its contents,
// including subcontainers.
obj->p[1] += delta;
}
-
/*
So we need to make it so that we pick the container's point clicked on, and translate all the other parts *not* clicked on.
*/
TranslateObject((Object *)c, clickedDelta);
}
-
//
// Translate all objects in the passed in vector, including Containers and all
// the objects they contain.
}
}
-
//
// This does not *copy* the objects, it simply flattens out the pointers in the
// Container and all sub-Containers.
return flat;
}
-
//
// This does not *copy* the objects, it simply flattens out the pointers in the
// vector and all sub-Containers in the vector.
return flat;
}
-