home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16390 < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.6 KB  |  84 lines

  1. Newsgroups: cvnet.c++,comp.lang.c++
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!ads.com!saturn!doug
  3. From: doug@monet.ads.com (Doug Morgan)
  4. Subject: Re: Real life problem: what is the proper way of subclassing this ?
  5. In-Reply-To: rvloon@cv.ruu.nl's message of 16 Nov 92 16:08:06 GMT
  6. Message-ID: <DOUG.92Nov16152429@monet.ads.com>
  7. Sender: usenet@ads.com (USENET News)
  8. Organization: Advanced Decision Systems, Mountain View, CA 94043, +1 (415)
  9.     960-7300
  10. References: <1992Nov16.160806.29351@cv.ruu.nl>
  11. Date: Mon, 16 Nov 1992 23:24:29 GMT
  12. Lines: 70
  13.  
  14. In article <1992Nov16.160806.29351@cv.ruu.nl> rvloon@cv.ruu.nl (Ronald van Loon) writes:
  15.  
  16.    [... two ways of handling point_3d and
  17.     point_3d_with_coordinate_system so that the test for equal
  18.     coordinate system can be bypassed ...]
  19.    -- 
  20.    +--- Ronald van Loon ---+ 
  21.    |  (rvloon@cv.ruu.nl)   | 
  22.    |  3DCV Group, Utrecht  |
  23.    +--- The Netherlands ---+ This part of .signature intentionally left blank.
  24.  
  25. How about just one class with two sets of operations?  One set has the
  26. test for equal coordinate systems.  The other does not.  The functions
  27. in the second set all assume a precondition that the coordinate
  28. systems are be equal.  If coordinate systems are unequal, the results
  29. are undefined (even if something is dutifully computed).
  30.  
  31. Also, here is a discussion of how coordinate system organization.
  32. This is not directly applicable to your question, but pretty much is
  33. the general starting point for deriving more specialized coordinate
  34. system implementations.  A point with coordinate system is
  35. conceptually a pair:
  36.  
  37. [abstract point (p in P), coordinate system (S : P => R^n)].
  38.  
  39. Notice, 
  40.  O a coordinate systems is a mapping
  41.  O there is no explicit vector of coefficients.  However, such a
  42.    vector can still be obtained as S(p) (or S().apply(p) in C++).
  43.  O the coordinate system frame can be obtained from the tuple of
  44.    abstract points:
  45.    [S.inverse().apply([0 0 0])
  46.     S.inverse().apply([1 0 0])
  47.     S.inverse().apply([0 1 0])
  48.     S.inverse().apply([0 0 1))].
  49.  
  50. Other important objects are:
  51.  
  52.  O coordinate transformations, such as
  53.    T = S1.inverse().compose(S2) : R^n1 => R^n2
  54.  O mappings between abstract spaces, such a M : P1 => P2
  55.  O associated coordinate mappings, such as
  56.    T = S1.inverse().compose(M).compose(S2) : R^n1 => R^n2
  57.  O network (or set) of mapping between abstract spaces and coordinate
  58.    transformations/mappings.
  59.  
  60. All operations on points with coordinate systems eventually decompose
  61. into operations on points in R^n which themselves decompose into
  62. operations on things like arrays of floats.  The multitude of design
  63. choices include:
  64.  
  65.  O going straight to representations of things like arrays of floats
  66.    and making all the rest implicit.  Within certain scopes of a
  67.    graphics application (e.g. inside a graphics server, a graphics
  68.    engine, or a third party graphics routine) this can be manditory.
  69.  O disallowing all user access to the abstract point objects or even
  70.    the coordinate system objects, so they needn't be explicit in the
  71.    final software design
  72.  O caching intermediate interesting information.  Caching the
  73.    coordinate tuple (S(p)) or an array of floats on the
  74.    point_3d_with_coordinate_system is the most common type of cache.
  75.    Another type caches composed coordinate transformations on the
  76.    network object or in some local variable.
  77.  
  78. doug
  79. --------------------------------------------------------------------
  80. Doug Morgan, doug@ads.com, (415) 960-7300
  81. Advanced Decision Systems (a division of Booz-Allen & Hamilton Inc.)
  82. 1500 Plymouth St., Mountain View, CA 94043-1230
  83. --------------------------------------------------------------------
  84.