Sorry, I write trash code in five minutes only for this post to
explain what would like do.
Yes I think it's a correct behavior, I can't define two points with
the same name.
No the user create with gui a new point or a new matrix (or delete it)
and then through the gui can select a
alrealdy defined object as a matrix or point and at this point came
into the findPoint (after user click on the object name)
I call FindPoint or FindMatrix to get the object instance. The problem
matrix or point could have the same name with this implementation.
Then be sure to enforce such things in your code, intercept the special
cases and prompt the user for decision, instead of directly overwriting
existing names or creating objects by default in a "find" function.
I need a class operation to add a type information to object.
I think you should simply add the appropriate information to each
appropriate object, but if you prefer decoupling such things it's up to you.
I need to do some things as M1*M2*M3*p where M1,M2,M3 are matrix and p
is a point3d and defined new type as line, plane and so on.
I need to check some control on the operation I will do, because user
should not select a matrix and a line and call the operation
LinePlaneIntersection.
As I see it, users should not be able to select a matrix at all. I
wonder what you're using them for.
An expectable structure could be:
- point3: three scalars
- edge: references or pointers to two point3
- face: references or pointers to three edges
- mesh: references or pointers to many faces
- group/object: references or pointers to many meshes
Any of the above can be implemented as a separate class and can have
additional properties, for example, faces can have different textures
and edges can have different creasing angles.
Matrices come into play when you have to store positions and
orientations of one or more of the above, but I'm not able to see them
as separate objects that the user can select.
As for what concerns the expression "M1*M2*M3*p", you can take advantage
of closure objects in order to avoid copying lot of data around. The C++
Programming Language by B. Stroustrup gives an example of such a closure
object, you can also look up that technique on a search engine and find
some examples.
Hope that helps improve your design.