00001 /* $NoKeywords: $ */ 00002 /* 00003 // 00004 // Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved. 00005 // OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert 00006 // McNeel & Associates. 00007 // 00008 // THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. 00009 // ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF 00010 // MERCHANTABILITY ARE HEREBY DISCLAIMED. 00011 // 00012 // For complete openNURBS copyright information see <http://www.opennurbs.org>. 00013 // 00015 */ 00016 00018 // 00019 // defines ON_TextureMapping 00020 // 00022 00023 #if !defined(OPENNURBS_TEXTURE_MAPPING_INC_) 00024 #define OPENNURBS_TEXTURE_MAPPING_INC_ 00025 00027 // 00028 // Class ON_TextureMapping 00029 // 00030 class ON_Line; 00031 class ON_BrepFace; 00032 class ON_3dPoint; 00033 00034 typedef int ( *TEXMAP_INTERSECT_LINE_SURFACE )( const ON_Line*, const ON_BrepFace*, ON_SimpleArray<ON_X_EVENT>& ); 00035 typedef bool ( *TEXMAP_BREP_FACE_CLOSEST_POINT )( const ON_BrepFace*, const ON_3dPoint*, ON_3dPoint& ); 00036 00037 class ON_CLASS ON_TextureMapping : public ON_Object 00038 { 00039 public: 00040 ON_OBJECT_DECLARE(ON_TextureMapping); 00041 00042 ON_TextureMapping(); 00043 ~ON_TextureMapping(); 00044 00045 // The copy constructor and operator= overrides are needed 00046 // to ensure m_geometry is properly copied. 00047 ON_TextureMapping(const ON_TextureMapping& src); 00048 ON_TextureMapping& operator=(const ON_TextureMapping& src); 00049 00050 // overrides virtual ON_Object::IsValid 00051 ON_BOOL32 IsValid( ON_TextLog* text_log = NULL ) const; 00052 00053 // overrides virtual ON_Object::Dump 00054 void Dump( ON_TextLog& ) const; 00055 00056 // overrides virtual ON_Object::SizeOf 00057 unsigned int SizeOf() const; 00058 00059 // overrides virtual ON_Object::Write 00060 ON_BOOL32 Write( 00061 ON_BinaryArchive& binary_archive 00062 ) const; 00063 00064 // overrides virtual ON_Object::Read 00065 ON_BOOL32 Read( 00066 ON_BinaryArchive& binary_archive 00067 ); 00068 00069 void Default(); 00070 00071 virtual 00072 ON_UUID ModelObjectId() const; 00073 00074 /* 00075 Determines whether the mapping, as currently set up, requires vertex normals to be present on the 00076 mesh in order to evaluate the mapping correctly. 00077 */ 00078 bool RequiresVertexNormals() const; 00079 bool IsPeriodic(void) const; 00080 00081 /* 00082 Description: 00083 Create a mapping that will convert surface parameters into 00084 normalized (0,1)x(0,1) texture coordinates. 00085 */ 00086 bool SetSurfaceParameterMapping(void); 00087 00088 /* 00089 Description: 00090 Create a planar projection texture mapping. 00091 Parameters: 00092 plane - [in] 00093 dx - [in] portion of the plane's x axis that is mapped to [0,1] 00094 (can be a decreasing interval) 00095 dy - [in] portion of the plane's x axis that is mapped to [0,1] 00096 (can be a decreasing interval) 00097 dz - [in] portion of the plane's x axis that is mapped to [0,1] 00098 (can be a decreasing interval) 00099 projection_method - [in] 00100 1: Closest point mapping. 00101 A target point P is mapped to the point on the plane 00102 that is closest to P. The target normal is ignored. 00103 2: Target line mapping. A target point-vector pair 00104 (P, N), are mapped to the point on the plane 00105 where the line through P, parallel to N, intersects 00106 the plane. If the line is parallel to the plane, 00107 the closest point mapping is used. 00108 Example: 00109 Create a mapping that maps the world axis aligned rectangle in 00110 the world yz plane with corners at (0,3,5) and (0,7,19) to the 00111 texture coordinate unit square. 00112 00113 ON_3dVector plane_xaxis(0.0,1.0,0.0); 00114 ON_3dVector plane_yaxis(0.0,0,0,1.0); 00115 ON_3dPoint plane_origin(0.0,2.0,4.0); 00116 ON_Plane plane(plane_origin,plane_xaxis,plane_yaxis); 00117 ON_Interval dx( 0.0, 7.0 - 3.0); 00118 ON_Interval dy( 0.0, 19.0 - 5.0); 00119 ON_Interval dz( 0.0, 1.0 ); 00120 ON_TextureMapping mapping; 00121 mapping.CreatePlaneMapping(plane,dx,dy,dz); 00122 00123 Returns: 00124 True if input is valid. 00125 */ 00126 bool SetPlaneMapping( 00127 const ON_Plane& plane, 00128 const ON_Interval& dx, 00129 const ON_Interval& dy, 00130 const ON_Interval& dz 00131 ); 00132 00133 /* 00134 Description: 00135 Create a cylindrical projection texture mapping. 00136 Parameters: 00137 cylinder - [in] 00138 cylinder in world space used to define a cylindrical 00139 coordinate system. The angular parameter maps (0,2pi) 00140 to texture "u" (0,1), The height parameter maps 00141 (height[0],height[1]) to texture "v" (0,1), and 00142 the radial parameter maps (0,r) to texture "w" (0,1). 00143 bIsCapped - [in] 00144 If true, the cylinder is treated as a finite 00145 capped cylinder. 00146 Returns: 00147 True if input is valid. 00148 Remarks: 00149 When the cylinder is capped and m_texture_space = divided, 00150 the cylinder is mapped to texture space as follows: 00151 The side is mapped to 0 <= "u" <= 2/3. 00152 The bottom is mapped to 2/3 <= "u" <= 5/6. 00153 The top is mapped to 5/6 <= "u" <= 5/6. 00154 This is the same convention box mapping uses. 00155 */ 00156 bool SetCylinderMapping( 00157 const ON_Cylinder& cylinder, 00158 bool bIsCapped 00159 ); 00160 00161 /* 00162 Description: 00163 Create a spherical projection texture mapping. 00164 Parameters: 00165 sphere - [in] 00166 sphere in world space used to define a spherical 00167 coordinate system. The longitude parameter maps 00168 (0,2pi) to texture "u" (0,1). The latitude paramter 00169 maps (-pi/2,+pi/2) to texture "v" (0,1). 00170 The radial parameter maps (0,r) to texture "w" (0,1). 00171 Returns: 00172 True if input is valid. 00173 */ 00174 bool SetSphereMapping( 00175 const ON_Sphere& sphere 00176 ); 00177 00178 /* 00179 Description: 00180 Create a box projection texture mapping. 00181 Parameters: 00182 plane - [in] 00183 The sides of the box the box are parallel to the 00184 plane's coordinate planes. The dx, dy, dz intervals 00185 determine the location of the sides. 00186 dx - [in] 00187 Determines the location of the front and back planes. 00188 The vector plane.xaxis is perpendicular to these planes 00189 and they pass through plane.PointAt(dx[0],0,0) and 00190 plane.PointAt(dx[1],0,0), respectivly. 00191 dy - [in] 00192 Determines the location of the left and right planes. 00193 The vector plane.yaxis is perpendicular to these planes 00194 and they pass through plane.PointAt(0,dy[0],0) and 00195 plane.PointAt(0,dy[1],0), respectivly. 00196 dz - [in] 00197 Determines the location of the top and bottom planes. 00198 The vector plane.zaxis is perpendicular to these planes 00199 and they pass through plane.PointAt(0,0,dz[0]) and 00200 plane.PointAt(0,0,dz[1]), respectivly. 00201 bIsCapped - [in] 00202 If true, the box is treated as a finite 00203 capped box. 00204 Returns: 00205 True if input is valid. 00206 Remarks: 00207 When m_texture_space = divided, the box is mapped to texture 00208 space as follows: 00209 00210 If the box is not capped, then each side maps to 1/4 of the texture map. 00211 00212 v=1+---------+---------+---------+---------+ 00213 | x=dx[1] | y=dy[1] | x=dx[0] | y=dy[0] | 00214 | Front | Right | Back | Left | 00215 | --y-> | <-x-- | <-y-- | --x-> | 00216 v=0+---------+---------+---------+---------+ 00217 0/4 <=u<= 1/4 <=u<= 2/4 <=u<= 3/4 <=u<= 4/4 00218 00219 If the box is capped, then each side and cap gets 1/6 of the texture map. 00220 00221 v=1+---------+---------+---------+---------+---------+---------+ 00222 | x=dx[1] | y=dy[1] | x=dx[0] | y=dy[0] | z=dx[1] | z=dz[0] | 00223 | Front | Right | Back | Left | Top | Bottom | 00224 | --y-> | <-x-- | <-y-- | --x-> | --x-> | --x-> | 00225 v=0+---------+---------+---------+---------+---------+---------+ 00226 0/6 <=u<= 1/6 <=u<= 2/6 <=u<= 3/6 <=u<= 4/6 <=u<= 5/6 <=u<= 6/6 00227 */ 00228 bool SetBoxMapping( 00229 const ON_Plane& plane, 00230 ON_Interval dx, 00231 ON_Interval dy, 00232 ON_Interval dz, 00233 bool bIsCapped 00234 ); 00235 00236 /* 00237 Description: 00238 Get plane mapping parameters from this texture mapping. 00239 Parameters: 00240 plane - [out] 00241 dx - [out] 00242 Portion of the plane's x axis that is mapped to [0,1] 00243 dy - [out] 00244 Portion of the plane's y axis that is mapped to [0,1] 00245 dz - [out] 00246 Portion of the plane's z axis that is mapped to [0,1] 00247 Returns: 00248 True if valid plane mapping parameters were returned. 00249 Remarks: 00250 NOTE WELL: 00251 Generally, GetMappingPlane will not return the same 00252 parameters passed to SetPlaneMapping. However, the 00253 location of the plane will be the same. 00254 */ 00255 bool GetMappingPlane( 00256 ON_Plane& plane, 00257 ON_Interval& dx, 00258 ON_Interval& dy, 00259 ON_Interval& dz 00260 ) const; 00261 00262 /* 00263 Description: 00264 Get a cylindrical projection parameters from this texture mapping. 00265 Parameters: 00266 cylinder - [out] 00267 Returns: 00268 True if a valid cylinder is returned. 00269 Remarks: 00270 Generally, GetMappingCylinder will not return the same 00271 parameters passed to SetCylinderMapping. However, the 00272 location of the cylinder will be the same. 00273 If this mapping is not cylindrical, the cylinder will 00274 approximate the actual mapping primitive. 00275 */ 00276 bool GetMappingCylinder( 00277 ON_Cylinder& cylinder 00278 ) const; 00279 00280 /* 00281 Description: 00282 Get a spherical projection parameters from this texture mapping. 00283 Parameters: 00284 sphere - [out] 00285 Returns: 00286 True if a valid sphere is returned. 00287 Remarks: 00288 Generally, GetMappingShere will not return the same 00289 parameters passed to SetSphereMapping. However, the 00290 location of the sphere will be the same. 00291 If this mapping is not cylindrical, the cylinder will 00292 approximate the actual mapping primitive. 00293 */ 00294 bool GetMappingSphere( 00295 ON_Sphere& sphere 00296 ) const; 00297 00298 /* 00299 Get a box projection from the texture mapping. 00300 Parameters: 00301 plane - [out] 00302 The center of the box is at plane.origin and the sides 00303 of the box are parallel to the plane's coordinate planes. 00304 dx - [out] 00305 The "front" and "back" sides of the box are in spanned 00306 by the vectors plane.yaxis and plane.zaxis. The back 00307 plane contains the point plane.PointAt(dx[0],0,0) and 00308 the front plane contains the point plane.PointAt(dx[1],0,0). 00309 dy - [out] 00310 The "left" and "right" sides of the box are in spanned 00311 by the vectors plane.zaxis and plane.xaxis. The left 00312 plane contains the point plane.PointAt(0,dx[0],0) and 00313 the back plane contains the point plane.PointAt(0,dy[1],0). 00314 dz - [out] 00315 The "top" and "bottom" sides of the box are in spanned 00316 by the vectors plane.xaxis and plane.yaxis. The bottom 00317 plane contains the point plane.PointAt(0,0,dz[0]) and 00318 the top plane contains the point plane.PointAt(0,0,dz[1]). 00319 Returns: 00320 True if a valid box is returned. 00321 Remarks: 00322 Generally, GetMappingBox will not return the same 00323 parameters passed to SetBoxMapping. However, the 00324 location of the box will be the same. 00325 */ 00326 bool GetMappingBox( 00327 ON_Plane& plane, 00328 ON_Interval& dx, 00329 ON_Interval& dy, 00330 ON_Interval& dz 00331 ) const; 00332 00333 00334 /* 00335 Description: 00336 Reverses the texture in the specified direction. 00337 Parameters: 00338 dir - [in] 0 = reverse "u", 1 = reverse "v", 2 = reverse "w". 00339 Remarks: 00340 Modies m_uvw so that the spedified direction transforms 00341 the texture coordinate t to 1-t. 00342 Returns: 00343 True if input is valid. 00344 */ 00345 bool ReverseTextureCoordinate( int dir ); 00346 00347 /* 00348 Description: 00349 Swaps the specified texture coordinates. 00350 Parameters: 00351 i - [in] 00352 j - [in] 00353 Remarks: 00354 Modifies m_uvw so that the specified texture coordinates are swapped. 00355 Returns: 00356 True if input is valid. 00357 */ 00358 bool SwapTextureCoordinate( int i, int j ); 00359 00360 /* 00361 Description: 00362 Tiles the specified texture coordinates. 00363 Parameters: 00364 dir - [in] 0 = "u", 1 = "v", 2 = "w". 00365 count - [in] number of tiles 00366 offset - [in] offset of the tile 00367 Remarks: 00368 Modies m_uvw so that the specified texture coordinate is 00369 tiled. 00370 Returns: 00371 True if input is valid. 00372 */ 00373 bool TileTextureCoordinate( int dir, double count, double offset ); 00374 00375 /* 00376 Description: 00377 Evaluate the mapping to get a texture coordinate. 00378 Parameters: 00379 P - [in] Vertex location 00380 N - [in] If the mapping projection is ray_projection, 00381 then this is the vertex unit normal. Otherwise 00382 N is ignored. 00383 T - [out] Texture coordinate (u,v,w) 00384 00385 P_xform -[in] 00386 Transformation to be applied to P before performing 00387 the mapping calculation. 00388 N_xform - [in] 00389 Transformation to be applied to N before performing 00390 the mapping calculation. One way to calculate N_xform 00391 is to use the call P_xform::GetVectorTransform(N_xform). 00392 00393 Returns: 00394 Nonzero if evaluation is successful. When the mapping 00395 is a box or capped cylinder mapping, the value indicates 00396 which side was evaluated. 00397 00398 Cylinder mapping: 00399 1 = cylinder wall, 2 = bottom cap, 3 = top cap 00400 Box mapping: 00401 1 = front 00402 2 = right 00403 3 = back 00404 4 = left 00405 5 = bottom 00406 6 = top 00407 00408 See Also: 00409 ON_TextureMapping::GetTextureCoordinates 00410 ON_Mesh::SetTextureCoordinates 00411 */ 00412 virtual 00413 int Evaluate( 00414 const ON_3dPoint& P, 00415 const ON_3dVector& N, 00416 ON_3dPoint* T 00417 ) const; 00418 00419 virtual 00420 int Evaluate( 00421 const ON_3dPoint& P, 00422 const ON_3dVector& N, 00423 ON_3dPoint* T, 00424 const ON_Xform& P_xform, 00425 const ON_Xform& N_xform 00426 ) const; 00427 00428 int EvaluatePlaneMapping( 00429 const ON_3dPoint& P, 00430 const ON_3dVector& N, 00431 ON_3dPoint* T 00432 ) const; 00433 00434 int EvaluateSphereMapping( 00435 const ON_3dPoint& P, 00436 const ON_3dVector& N, 00437 ON_3dPoint* T 00438 ) const; 00439 00440 int EvaluateCylinderMapping( 00441 const ON_3dPoint& P, 00442 const ON_3dVector& N, 00443 ON_3dPoint* T 00444 ) const; 00445 00446 int EvaluateBoxMapping( 00447 const ON_3dPoint& P, 00448 const ON_3dVector& N, 00449 ON_3dPoint* T 00450 ) const; 00451 00452 /* 00453 Description: 00454 Quickly check to see if a mesh or tag has texture coordinates 00455 set by this mapping. 00456 Parameters: 00457 mesh - [in] 00458 tag - [in] 00459 object_xform - [in] (optional) 00460 If this transform is not NULL, then true will be 00461 returned only if the mapping function is the same and 00462 the tag's m_mesh_xform field is the same as mesh_xform. 00463 This parameter is typically NULL or the value of 00464 ON_MappingRef::m_object_xform. 00465 Returns: 00466 True if the meshes texture coordinates were set by this 00467 mapping. 00468 */ 00469 bool HasMatchingTextureCoordinates( 00470 const ON_Mesh& mesh, 00471 const ON_Xform* object_xform = 0 00472 ) const; 00473 bool HasMatchingTextureCoordinates( 00474 const class ON_MappingTag& tag, 00475 const ON_Xform* object_xform = 0 00476 ) const; 00477 00478 /* 00479 Description: 00480 Get texture coordinates. This calculation is 00481 expensive. When possible, use a MappingMatch() 00482 query to avoid unnecessary calculations. 00483 Parameters: 00484 mesh - [in] 00485 T - [out] Texture coordinates returned here. 00486 mesh_xform - [in] (optional) 00487 If the mesh has been transformed since the texture mapping was set 00488 up, pass the transformation here. Typically this is the value 00489 of ON_Mesh::m_mapping_xform or ON_MappingRef::m_object_xform 00490 bLazy - [in] 00491 If true and the mesh.m_T[] values were calculated using 00492 this mapping, they are simply copied to the T[] array 00493 and no calculations are performed. If you are calling 00494 the 3d point version and you care about the z-coordinate, 00495 then do not use the lazy option (meshes only store 00496 2d texture coordinates). 00497 Tside - [out] 00498 In the case of divided textures, side information is returned 00499 here if a lazy mapping is not done. Otherwise Tside->Count() 00500 will be zero. 00501 Cylinder mapping: 00502 1 = cylinder wall, 2 = bottom cap, 3 = top cap 00503 Box mapping: 00504 1 = front 00505 2 = right 00506 3 = back 00507 4 = left 00508 5 = bottom 00509 6 = top 00510 Example: 00511 00512 ON_TextureMapping mapping = ...; 00513 const ON_Mesh* mesh = ...; 00514 bool bLazy = true; 00515 ON_SimpleArray<ON_3dPoint> T(mesh->VertexCount()); 00516 T.SetCount(mesh->m_VertexCount()); 00517 if ( !mapping.GetTextureCoordinates(mesh,3,3,&T[0].x,bLazy) ) 00518 T.SetCount(0). 00519 00520 Returns: 00521 True if successful. 00522 */ 00523 bool GetTextureCoordinates( 00524 const ON_Mesh& mesh, 00525 ON_SimpleArray<ON_3fPoint>& T, 00526 const ON_Xform* mesh_xform = 0, 00527 bool bLazy = false, 00528 ON_SimpleArray<int>* Tside = 0 00529 ) const; 00530 00531 bool GetTextureCoordinates( 00532 const ON_Mesh& mesh, 00533 ON_SimpleArray<ON_2fPoint>& T, 00534 const ON_Xform* mesh_xform = 0, 00535 bool bLazy = false, 00536 ON_SimpleArray<int>* Tside = 0 00537 ) const; 00538 00539 public: 00540 // The only reliable and persistent way to reference texture 00541 // mappings is by the mapping_id. If the mapping id is 00542 // set to m_srfp_mapping_id, then all other mapping settings 00543 // are ignored. 00544 ON_UUID m_mapping_id; 00545 00546 // Runtime texture mapping table index. 00547 // This value is NOT SAVED IN 3DM FILES. 00548 // This value is constant for each runtime instance of Rhino, 00549 // but can change each time a model is loaded or saved. 00550 // Once a texture mapping is in the CRhinoDoc material table, 00551 // its id and index never change in that instance of Rhino. 00552 int m_mapping_index; 00553 00554 // The texture mapping name is for UI and user comfort. 00555 // Duplicates are permitted. 00556 ON_wString m_mapping_name; 00557 00559 // 00560 // Mapping types: 00561 // 00562 // You can either calculate texture coordinates based on 00563 // the parameterization of the surface used to create a mesh, 00564 // or project the natural parameterization from a mapping 00565 // primitive, like a plane, sphere, box, or cylinder. 00566 // 00567 // Do not change TYPE enum values - they are saved in 3dm files. 00568 // 00569 enum TYPE 00570 { 00571 no_mapping = 0, 00572 00573 srfp_mapping = 1, // u,v = linear transform of surface params,w = 0 00574 plane_mapping = 2, // u,v,w = 3d coordinates wrt frame 00575 cylinder_mapping = 3, // u,v,w = logitude, height, radius 00576 sphere_mapping = 4, // (u,v,w) = longitude,latitude,radius 00577 box_mapping = 5, 00578 mesh_mapping_primitive = 6, // m_mapping_primitive is an ON_Mesh 00579 srf_mapping_primitive = 7, // m_mapping_primitive is an ON_Surface 00580 brep_mapping_primitive = 8, // m_mapping_primitive is an ON_Brep 00581 00582 force_32bit_mapping_type = 0xFFFFFFFF 00583 }; 00584 00585 TYPE m_type; 00586 00588 // 00589 // Projection: 00590 // 00591 // When a mapping primitive, like a plane, sphere, box, 00592 // or cylinder, is used, there are two projection options. 00593 // 00594 // clspt_projection: world xyz maps to the point on the 00595 // mapping primitive that is closest to xyz. 00596 // In this case, ON_TextureMapping::Evaluate 00597 // ignores the vector argument. 00598 // 00599 // ray_projection: world xyz + world vector defines a world line. 00600 // The world line is intersected with the mapping 00601 // primitive and the intersection point that is 00602 // closest to the world xyz point is used to 00603 // calculate the mapping parameters. 00604 // 00605 // The value of m_projection can be changed as needed. 00606 // 00607 // If m_type = srfp_mapping, then m_projection is ignored. 00608 // 00609 enum PROJECTION 00610 { 00611 no_projection = 0, 00612 clspt_projection = 1, 00613 ray_projection = 2, 00614 force_32bit_mapping_projection = 0xFFFFFFFF 00615 }; 00616 00617 PROJECTION m_projection; 00618 00620 // 00621 // Texture space 00622 // 00623 // When a mapping primitive is a box or a capped cylinder, 00624 // there are two options for the mapping. Either the sides 00625 // all map to (0,1)x(0,1) (so the either texture map appears 00626 // on each side, or the sides map to distinct regions of the 00627 // texture space. 00628 // 00629 enum TEXTURE_SPACE 00630 { 00631 single = 0, // sides and caps map to same texture space 00632 divided = 1, // sides and caps map to distinct vertical 00633 // regions of texture space. 00634 // (0, 1/4, 2/4, 3/4, 1) for uncapped boxes. 00635 // (0, 1/6, 2/6, 3/6, 4/6, 5/6, 1) for capped boxes. 00636 // (0, 4/6, 5/6, 1) for capped cylinders. 00637 force_32bit_texture_space = 0xFFFFFFFF 00638 }; 00639 00640 TEXTURE_SPACE m_texture_space; 00641 00642 // The m_bCapped applies to planar, cylinder and box mappings. 00643 // If m_bCapped is false, the cylinder or box is "infinite", if m_bCapped is true, they are finite. 00644 // In planar mappings, m_bCapped=false means "the Z texture coordinate will always be 0.0" 00645 // this is now the default behaviour in Rhino 5.0 - it's what users expect apparently. 00646 bool m_bCapped; 00647 00649 // 00650 // For primitive based mappings, these transformations are 00651 // used to map the world coordinate (x,y,z) point P and 00652 // surface normal N before it is projected to the normalized 00653 // mapping primitive. The surface normal transformation, 00654 // m_Nxyz, is always calculated from m_Pxyz. It is a 00655 // runtime setting that is not saved in 3dm files. 00656 // If m_type is srfp_mapping, then m_Pxyz and m_Nxyz are 00657 // ignored. 00658 ON_Xform m_Pxyz; 00659 ON_Xform m_Nxyz; 00660 00661 // Transform applied to mapping coordinate (u,v,w) to 00662 // convert it into a texture coordinate. 00663 ON_Xform m_uvw; 00664 00665 // Custom mapping primitive. 00666 ON_Object* m_mapping_primitive; 00667 00668 static TYPE TypeFromInt( int i ); 00669 static PROJECTION ProjectionFromInt( int i ); 00670 static TEXTURE_SPACE TextureSpaceFromInt( int i); 00671 00672 ON__UINT32 MappingCRC() const; 00673 }; 00674 00675 #if defined(ON_DLL_TEMPLATE) 00676 // This stuff is here because of a limitation in the way Microsoft 00677 // handles templates and DLLs. See Microsoft's knowledge base 00678 // article ID Q168958 for details. 00679 #pragma warning( push ) 00680 #pragma warning( disable : 4231 ) 00681 ON_DLL_TEMPLATE template class ON_CLASS ON_ClassArray<ON_TextureMapping>; 00682 ON_DLL_TEMPLATE template class ON_CLASS ON_ObjectArray<ON_TextureMapping>; 00683 #pragma warning( pop ) 00684 #endif 00685 00686 00687 #endif 00688