- Timestamp:
- 07/05/06 10:43:45 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/TestPreprocessor.vcproj
r1011 r1076 73 73 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" 74 74 RuntimeLibrary="2" 75 RuntimeTypeInfo="TRUE" 75 76 UsePrecompiledHeader="0" 76 77 WarningLevel="3" … … 85 86 LinkIncremental="1" 86 87 AdditionalLibraryDirectories="..\support\xercesc\lib\;..\support\zlib\lib\;..\support\devil\lib;"$(QTDIR)\lib";..\include;..\src\GL;"$(CG_LIB_PATH)";"$(GTPDIR)\NonGTP\Xerces";"$(GTPDIR)\NonGTP\Xerces\xercesc\lib";"$(GTPDIR)\NonGTP\zlib\lib";"$(GTPDIR)\NonGTP\Devil\lib";..\lib\release;..\..\Preprocessing\lib\release" 87 GenerateDebugInformation=" FALSE"88 GenerateDebugInformation="TRUE" 88 89 SubSystem="1" 89 90 OptimizeReferences="2" 90 91 EnableCOMDATFolding="2" 91 TargetMachine="1"/> 92 TargetMachine="1" 93 FixedBaseAddress="1"/> 92 94 <Tool 93 95 Name="VCMIDLTool"/> … … 133 135 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"> 134 136 </Filter> 137 <File 138 RelativePath=".\VTune\TestPreprocessor.vpj"> 139 </File> 135 140 </Files> 136 141 <Globals> -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r1074 r1076 74 74 KdTree::Construct() 75 75 { 76 76 77 if (!splitCandidates) 77 78 splitCandidates = new vector<SortableEntry>; -
GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp
r1020 r1076 72 72 { 73 73 Cleanup(); 74 74 75 75 ComputeBoundingBox(); 76 76 77 77 /** true if it is a watertight convex mesh 78 78 */ … … 88 88 89 89 cout<<"KD"; 90 90 91 mKdTree->Construct(); 91 92 … … 480 481 481 482 Plane3 plane = Plane3(mVertices[face->mVertexIndices[0]], 482 483 483 mVertices[face->mVertexIndices[1]], 484 mVertices[face->mVertexIndices[2]]); 484 485 485 486 if (!eq(Magnitude(plane.mNormal), 1.0f)) -
GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.cpp
r863 r1076 4 4 5 5 namespace GtpVisibilityPreprocessor { 6 7 8 Plane3::Plane3(const Vector3 &a, 9 const Vector3 &b, 10 const Vector3 &c) 11 { 12 Vector3 v1=a-b, v2=c-b; 13 mNormal = Normalize(CrossProd(v2,v1)); 14 mD = -DotProd(b, mNormal); 15 } 16 17 Plane3::Plane3(const Vector3 &normal, 18 const Vector3 &point): 19 mNormal(normal) 20 { 21 mD = -DotProd(normal, point); 22 } 6 23 7 24 -
GTP/trunk/Lib/Vis/Preprocessing/src/Plane3.h
r1047 r1076 19 19 const Vector3 &b, 20 20 const Vector3 &c 21 ) { 22 Vector3 v1=a-b, v2=c-b; 23 mNormal = Normalize(CrossProd(v2,v1)); 24 mD = -DotProd(b, mNormal); 25 } 21 ); 26 22 27 23 Plane3(const Vector3 &normal, 28 24 const Vector3 &point 29 ):mNormal(normal) 30 { 31 mD = -DotProd(normal, point); 32 } 25 ); 33 26 34 27 void ReverseOrientation() -
GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.cpp
r863 r1076 11 11 Polygon3::Polygon3(): 12 12 mMaterial(NULL), mParent(NULL), mPiercingRays(0) 13 , mPlane(NULL) 13 14 { 14 15 // mostly there will be triangles … … 18 19 Polygon3::Polygon3(const VertexContainer &vertices): 19 20 mMaterial(NULL), mParent(NULL), mPiercingRays(0) 21 , mPlane(NULL) 20 22 { 21 23 mVertices.reserve(vertices.size()); … … 26 28 Polygon3::Polygon3(MeshInstance *parent): 27 29 mMaterial(NULL), mParent(parent), mPiercingRays(0) 30 , mPlane(NULL) 28 31 {} 29 32 … … 31 34 Polygon3::Polygon3(Face *face, Mesh *parentMesh): 32 35 mMaterial(NULL), mParent(NULL), mPiercingRays(0) 36 , mPlane(NULL) 33 37 { 34 38 mVertices.reserve(face->mVertexIndices.size()); … … 44 48 45 49 46 Plane3 Polygon3::GetSupportingPlane() const 47 { 50 Plane3 Polygon3::GetSupportingPlane()// const 51 { 52 #if 0 48 53 return Plane3(mVertices[0], mVertices[1], mVertices[2]); 54 #else 55 if (!mPlane) 56 mPlane = new Plane3(mVertices[0], mVertices[1], mVertices[2]); 57 return *mPlane; 58 #endif 49 59 } 50 60 -
GTP/trunk/Lib/Vis/Preprocessing/src/Polygon3.h
r860 r1076 46 46 /** Returns supporting plane of this polygon. 47 47 */ 48 Plane3 GetSupportingPlane() 48 Plane3 GetSupportingPlane(); //const; 49 49 50 50 /** Splits polygon. … … 156 156 RayContainer mPiercingRays; 157 157 158 ~Polygon3() {DEL_PTR(mPlane);} 159 Plane3 *mPlane; 160 158 161 }; 159 162 -
GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp
r1004 r1076 46 46 const bool loadPolygonsAsMeshese) 47 47 { 48 49 48 map<string, Vector3, ltstr> vht; // hash table for vectors 50 49 map<string, Vector3, ltstr> cht; // hash table for colors … … 139 138 vertexIndices.push_back(index); 140 139 } 141 140 142 141 face = new Face(vertexIndices); 143 142 144 143 fscanf(file,"%s",str); // get the next vertex label 145 144 146 145 if (str[0]!=';') { 147 146 c = cht.find(str); -
GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp
r1074 r1076 629 629 630 630 631 // first node is kd node, i.e. an axis aligned box 632 if (1) 633 tData.mIsKdNode = true; 634 else 635 tData.mIsKdNode = false; 636 631 637 // compute first split candidate 632 638 VspBspSplitCandidate splitCandidate; … … 793 799 // if it was a kd node (i.e., a box) and the split axis is axis aligned, it is still a kd node 794 800 tFrontData.mIsKdNode = tBackData.mIsKdNode = (tData.mIsKdNode && (splitAxis < 3)); 801 795 802 tFrontData.mAxis = tBackData.mAxis = splitAxis; 796 803 … … 1539 1546 //Debug << "use special axis: " << useSpecialAxis << endl; 1540 1547 //Debug << "axis: " << sAxis << " drivingaxis: " << box.Size().DrivingAxis(); 1541 1548 1542 1549 for (axis = 0; axis < 3 ; ++ axis) 1543 1550 { … … 1560 1567 nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f; 1561 1568 Vector3 normal(0,0,0); normal[axis] = 1.0f; 1562 1569 1563 1570 // allows faster split because we have axis aligned kd tree boxes 1564 1571 if (isKdNode) … … 2262 2269 2263 2270 2264 void VspBspTree::AddObjToPvs(Intersectable *obj,2265 const int cf,2266 float &frontPvs,2267 float &backPvs,2268 float &totalPvs) const2271 inline void VspBspTree::AddObjToPvs(Intersectable *obj, 2272 const int cf, 2273 float &frontPvs, 2274 float &backPvs, 2275 float &totalPvs) const 2269 2276 { 2270 2277 if (!obj) 2271 2278 return; 2272 2279 #if 0 2273 2280 const float renderCost = mViewCellsManager->EvalRenderCost(obj); 2274 2281 #else 2282 const int renderCost = 1; 2283 #endif 2275 2284 // new object 2276 2285 if ((obj->mMailbox != sFrontId) && -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
r1074 r1076 377 377 //-- debug output 378 378 379 Debug << "******* VSP BSPoptions ******** " << endl;379 Debug << "******* VSP options ******** " << endl; 380 380 Debug << "max depth: " << mTermMaxDepth << endl; 381 381 Debug << "min PVS: " << mTermMinPvs << endl; … … 1641 1641 return; 1642 1642 1643 const float renderCost = mViewCellsManager->EvalRenderCost(obj); 1643 //const float renderCost = mViewCellsManager->EvalRenderCost(obj); 1644 const int renderCost = 1; 1644 1645 1645 1646 // new object … … 2735 2736 //-- debug output 2736 2737 2737 Debug << "******* VSP BSP options ******** " << endl;2738 Debug << "******* OSP options ******** " << endl; 2738 2739 Debug << "max depth: " << mTermMaxDepth << endl; 2739 2740 Debug << "min PVS: " << mTermMinPvs << endl; -
GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
r1074 r1076 566 566 cout << "use view space box=" << mUseViewSpaceBox<<endl; 567 567 568 568 569 569 if (mUseViewSpaceBox) 570 570 { -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1005 r1076 90 90 } 91 91 92 93 92 QApplication *app = NULL; 94 93 … … 110 109 Environment::GetSingleton()->GetStringValue("Scene.filename", buff); 111 110 string filename(buff); 111 112 112 p->LoadScene(filename); 113 113
Note: See TracChangeset
for help on using the changeset viewer.