Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 15 Jun 2008
Offline Last Active Today, 02:25 AM

Posts I've Made

In Topic: the role of the controller in the mvc

20 March 2014 - 04:21 PM


View and controller commonly become mixed up in the real world. In a GUI for example, a tree view widget is both a view and a controller.


Strict MVC would have the view do nothing but display data in response to data changes and controller would provide input from the user but it is a stretch to make this strict approach apply in real world. Qt for example has models and views but no controllers - the views take care of those roles themselves.


What is your tree view widget doing that it is bleeding over to being a controller?  Any modification of data should just be the view calling the controller.  (ie someone goes and hits the delete key on a treeview node, the widget shouldn't be performing any direct operations on the data itself, but something like controller.Delete(treeviewNode.Data)


Basically, one should be able to do all the data operations without the view being involved in anyway, it makes unit testing and debugging easier, and you can re-use the controller logic in multiple views.  You can have a tree view, a gantt chart, etc, all using the same controller, doing all the same logic without any duplication.


and if i move the controller.Delete(treeviewNode.Data) in the model and becomes model::instance.Delete(treviewNode.Data) is not the same?

In Topic: the role of the controller in the mvc

20 March 2014 - 01:11 PM

1)Is a good thing to make the model a singleton?
So i have always one instance and i don't fall in possible errors
2)Is a good thing create in the model all the logic with functions and call these functions from the view? or is better to create many models and share some logics with the controller
3)there are some already made mvc framework for winform .net?


In Topic: extrusion and dir

05 October 2013 - 12:50 PM

very tanks.


In Topic: extrusion and dir

05 October 2013 - 10:52 AM

hello eppo i find now your solution, is the :
Q39. How do I generate a rotation matrix to map one vector onto another?

then i can find the rotation axis(with the cross product) and the angle(with dot product) and use the generic formula for rotate around an arbitrary axis?
is correct?
and, in base at my last post i can rotate also the 2d shape in 3d with the same process?

thanks, now i try

In Topic: extrusion and dir

05 October 2013 - 09:40 AM

thanks guys, very kind of you for your help.
now i wish express better my problem:
1)i have a 2d shape that i must extrude
2)i have an extrude direction that can be any normalized dir.
3)the 2d shape in 3d is flat, i must rotate it before extrude it and i must rotate ortogonal at the extrusion direction but how?

in the first 2 topics i would rotate the extrusion of a flat 2d shape in the z axis, but i understand haegarr and i would rotate the 2d shape before extrude the solid.
is correct?
But i not understand haegarr about the inverse matrix, can you explain me better this trick?

1)is better do the extrusion of the 2d shape on the z axis then rotate the solid by the direction of the extrusion?
2)or is better rotate the 2d shape in 3d then do the extrusion by the extrusion direction?

these are the questions, how i can do that?
eppo i don't find your advice in your link.


sorry, the image :