PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: MeshCreator.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLMESH_MESHCREATOR_H__ 00024 #define __PLMESH_MESHCREATOR_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLCore/Base/Object.h> 00032 #include "PLMesh/PLMesh.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLMesh { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Forward declarations ] 00043 //[-------------------------------------------------------] 00044 class Mesh; 00045 00046 00047 //[-------------------------------------------------------] 00048 //[ Classes ] 00049 //[-------------------------------------------------------] 00050 /** 00051 * @brief 00052 * Abstract mesh creator base class 00053 */ 00054 class MeshCreator : public PLCore::Object { 00055 00056 00057 //[-------------------------------------------------------] 00058 //[ Friends ] 00059 //[-------------------------------------------------------] 00060 friend class MeshManager; 00061 00062 00063 //[-------------------------------------------------------] 00064 //[ Public definitions ] 00065 //[-------------------------------------------------------] 00066 public: 00067 /** 00068 * @brief 00069 * Draw style 00070 */ 00071 enum EDrawStyle { 00072 Fill = 0, /**< Fill */ 00073 Line = 1, /**< Line */ 00074 Silhouette = 2, /**< Silhouette */ 00075 Point = 3 /**< Point */ 00076 }; 00077 pl_enum(EDrawStyle) 00078 pl_enum_value(Fill, "Fill") 00079 pl_enum_value(Line, "Line") 00080 pl_enum_value(Silhouette, "Silhouette") 00081 pl_enum_value(Point, "Point") 00082 pl_enum_end 00083 00084 00085 //[-------------------------------------------------------] 00086 //[ RTTI interface ] 00087 //[-------------------------------------------------------] 00088 pl_class(PLMESH_RTTI_EXPORT, MeshCreator, "PLMesh", PLCore::Object, "Abstract mesh creator base class") 00089 // Attributes 00090 pl_attribute(DrawStyle, pl_enum_type(EDrawStyle), Fill, ReadWrite, DirectValue, "Draw style", "") 00091 pl_attribute(Order, bool, 0, ReadWrite, DirectValue, "Geometry order (0=clockwise 1=counterclockwise)", "") 00092 pl_attribute(TexCoords, bool, true, ReadWrite, DirectValue, "Generate texture coordinates?", "") 00093 pl_attribute(Normals, bool, true, ReadWrite, DirectValue, "Generate normals coordinates?", "") 00094 pl_attribute(Material, PLCore::String, "Data/Textures/Default.dds", ReadWrite, DirectValue, "Material to use", "") 00095 pl_class_end 00096 00097 00098 //[-------------------------------------------------------] 00099 //[ Protected functions ] 00100 //[-------------------------------------------------------] 00101 protected: 00102 /** 00103 * @brief 00104 * Default constructor 00105 */ 00106 PLMESH_API MeshCreator(); 00107 00108 /** 00109 * @brief 00110 * Destructor 00111 */ 00112 PLMESH_API virtual ~MeshCreator(); 00113 00114 00115 //[-------------------------------------------------------] 00116 //[ Protected virtual MeshCreator functions ] 00117 //[-------------------------------------------------------] 00118 protected: 00119 /** 00120 * @brief 00121 * Creates a mesh 00122 * 00123 * @param[in] cMesh 00124 * Mesh to manipulate 00125 * @param[in] nLODLevel 00126 * Mesh LOD level to manipulate 00127 * @param[in] bStatic 00128 * Static mesh? 00129 * 00130 * @return 00131 * The created/manipulated mesh, a null pointer on error 00132 * 00133 * @note 00134 * - The default implementation sets the first material 00135 */ 00136 PLMESH_API virtual Mesh *Create(Mesh &cMesh, PLCore::uint32 nLODLevel = 0, bool bStatic = true) const; 00137 00138 00139 }; 00140 00141 00142 //[-------------------------------------------------------] 00143 //[ Namespace ] 00144 //[-------------------------------------------------------] 00145 } // PLMesh 00146 00147 00148 #endif // __PLMESH_MESHCREATOR_H__
|