14,243,097 members

C / C++ / MFC

 Re: triplet or what ? `Randor` 31-Mar-19 8:34 `Randor` 31-Mar-19 8:34
 Re: triplet or what ? k505431-Mar-19 8:45 k5054 31-Mar-19 8:45
 Re: triplet or what ? `Randor` 31-Mar-19 9:04 `Randor` 31-Mar-19 9:04
 Re: triplet or what ? Vaclav_31-Mar-19 16:20 Vaclav_ 31-Mar-19 16:20
 Re: triplet or what ? `Randor` 31-Mar-19 17:21 `Randor` 31-Mar-19 17:21
 Re: triplet or what ? leon de boer1-Apr-19 0:49 leon de boer 1-Apr-19 0:49
 Combination or inheritance 元昊 潘31-Mar-19 5:04 元昊 潘 31-Mar-19 5:04
 Re: Combination or inheritance leon de boer31-Mar-19 6:12 leon de boer 31-Mar-19 6:12
 The question comes down to is distance fundemental to point or is it a function executed and that is up to how you intend to use it. The general rule is function over inheritance and it's clearly covered by wikipedia Composition over inheritance - Wikipedia[^] If point has shapes that derive from it and distance is the closest point between the two shapes then we can provide a clear implementation of how it must work. The only way to reconcile the closest point between two complex shapes will be to run each geometry (line,arc,spline etc) of each shape against the other shape or scanline the two shapes in a minimal box that includes both shapes. Either of those two processes will require these functions 1.) reset or seek so a geometry index will be the next out (seek_geometry(i)) 2.) retrieve the next geometry from the shape (read_geometry(i)) 3.) check if this geometry was last, if not back to 2 we go (check_geometry_end). Essentially the geometry callback function(s) will be inherited from point but the distance will be another object because it will take two objects and run the process. Distance can then evolve to take a list of objects or different sorts of objects. It is easy to see in that situation distance is not really a function of a shape it is a function between two shapes. However it could also be between a shape and something else such as a bounding box or grid or something yet to be thought of. So from a flexibility and reuse point of view you code for functionality and make point and distance two different objects. In the simplest example it would make little difference but the functionality coding would make it easier to extend, reuse and more flexible. Ultimately you are more likely to reuse the more flexible code. In vino veritasmodified 31-Mar-19 12:21pm.
 Re: Combination or inheritance David Crow1-Apr-19 3:31 David Crow 1-Apr-19 3:31
 i really need help with this Member 1420332729-Mar-19 5:13 Member 14203327 29-Mar-19 5:13
 Re: i really need help with this Richard MacCutchan29-Mar-19 5:58 Richard MacCutchan 29-Mar-19 5:58
 Re: i really need help with this Victor Nijegorodov29-Mar-19 6:43 Victor Nijegorodov 29-Mar-19 6:43
 Re: i really need help with this Member 142033272-Apr-19 4:14 Member 14203327 2-Apr-19 4:14
 Re: i really need help with this David Crow29-Mar-19 9:24 David Crow 29-Mar-19 9:24
 Re: i really need help with this Member 1420332730-Mar-19 3:52 Member 14203327 30-Mar-19 3:52
 Re: i really need help with this k505430-Mar-19 4:48 k5054 30-Mar-19 4:48
 Re: i really need help with this Member 142033272-Apr-19 4:13 Member 14203327 2-Apr-19 4:13
 Re: i really need help with this David Crow30-Mar-19 5:33 David Crow 30-Mar-19 5:33
 Re: i really need help with this Gerry Schmitz29-Mar-19 10:40 Gerry Schmitz 29-Mar-19 10:40
 Re: i really need help with this Vaclav_1-Apr-19 15:43 Vaclav_ 1-Apr-19 15:43
 Putting declared const into a print statement SEmmett28-Mar-19 10:45 SEmmett 28-Mar-19 10:45
 Re: Putting declared const into a print statement k505428-Mar-19 11:01 k5054 28-Mar-19 11:01
 Re: Putting declared const into a print statement CPallini28-Mar-19 11:06 CPallini 28-Mar-19 11:06
 Re: Putting declared const into a print statement SEmmett28-Mar-19 11:34 SEmmett 28-Mar-19 11:34
 Re: Putting declared const into a print statement k505428-Mar-19 12:01 k5054 28-Mar-19 12:01
 Last Visit: 22-Jul-19 19:22     Last Update: 22-Jul-19 19:22 Refresh « Prev1...13141516171819202122 Next »