Daniel said:
First solution... Note that the code I wrote above has no destructor,
so what happens to the graphic passed in when the RotaeableGraphic
object is destroyed? That is a clue. The object that passes in the
Graphic still has it and can call any functions it wants on it. So,
for example, an object can create an Image and pass it to a
RotateableGraphic object, then call the additional Image methods on it
anytime he wants. In the mean time, he can pass the RotateableGraphic
to any generic Graphic containers and they will ultimately modify the
state of the Image contained.
The problem is that in the cases I have its the reading code that has
created the objects, and built up topologies of different types of
surfaces, stitched together by shared edge curves and faces. So the
application sees
Topology->Face[]->Surface->Edges[]->Curve
But ignore most of that and just consider the Curve types
Curve -
| TransformedCurve
| Bezier
| Nurb
| Arc
| Polyline
| CompositeCurve
| ProjectedCurve
| SurfaceCurve
| ReversedCurve
CompositeCurve(Curve[])
TransformedCurve(Curve, Xform)
ProjectedCurve(Curve, Plane)
SurfaceCurve(Surface)
Lets say I want to extract all the edge curves from a topology and
perform some analysis on them. Because certain types of geometric
analysis can be performed more quickly if one knows what the type is,
for example arc-line intersection, or arc-arc intersection, one also
wants to avoid wrapping if possible.
So whilst a method that involved transforming all the input may just
wrap the input curves in a TransformCurve as that wouldn't require a
deep copy of the curves (you wouldn't simple physically transform the
curves themselves because that would require transforming the topology).
it may well decide to retain any Arcs or Polylines in the input, so one
may well dynamically cast for those type, and deep copy and physically
transform just those types.
I was hoping your solution would help in situations like that, but
thanks anyway.