rtVTK  0.6.0
RayRecord.h
00001 
00002 /******************************************************************************
00003  * Copyright (c) 2012, Grove City College
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are
00008  * met:
00009  * 
00010  *  * Redistributions of source code must retain the above copyright
00011  *    notice, this list of conditions and the following disclaimer.
00012  *
00013  *  * Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in
00015  *    the documentation and/or other materials provided with the
00016  *    distribution.
00017  *
00018  *  * Neither the name of Grove City College nor the names of its
00019  *    contributors may be used to endorse or promote products derived
00020  *    from this software without specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00025  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00026  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00027  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00028  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00029  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00030  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00031  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00032  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033  *
00034  */
00035 
00036 
00037 #ifndef RL_RayRecord_h
00038 #define RL_RayRecord_h
00039 
00040 #include <cstdlib>
00041 #include <cstring>
00042 
00043 #include <ostream>
00044 using std::ostream;
00045 using std::endl;
00046 
00047 #include <Math/Math.h>
00048 
00049 #include <RL/rl.h>
00050 
00051 
00052 namespace rl
00053 {
00054 
00056   // Using declarations
00057 
00058   using MathF::Point;
00059   using MathF::Vector;
00060 
00061 
00063   // Structure definitions
00064 
00068   struct RayRecord
00069   {
00071     RayRecord();
00073     RayRecord(const Point&  origin,
00074               const Vector& dir,
00075                     RayType type,
00076               const void*   data   = NULL,
00077                     size_t  nbytes = 0);
00078 
00080     RayRecord(const RayRecord& r);
00081 
00083     ~RayRecord();
00084 
00086     RayRecord& operator=(const RayRecord&);
00087 
00088     void changeData(const void*, size_t);
00089 
00091 
00092     Point   origin;
00099     Vector  distance;
00100 
00102     RayType type;
00103 
00105     void*  data;
00106 
00108     size_t nbytes;
00109 
00111     uint depth;
00112 
00114     uint parent;
00115 
00117     uint child;
00118 
00120     uint next;
00121 
00123     uint prev;
00124 
00125   };
00126 
00128   ostream& operator<<(ostream&, const RayRecord&);
00129 
00130 } // namespace rl
00131 
00132 #endif // RL_RayRecord_h
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends