aboutsummaryrefslogtreecommitdiff
path: root/tool_src/BspLib/Mapping.cpp
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-08-24 11:16:07 +0200
commitc068f22329d5cc722622a2183bbb22eef2093df7 (patch)
tree12d56c1aede67988a55e241364606bfbb4dba933 /tool_src/BspLib/Mapping.cpp
downloadopenparsec-main.tar.xz
openparsec-main.zip
initial importHEADmain
Diffstat (limited to 'tool_src/BspLib/Mapping.cpp')
-rw-r--r--tool_src/BspLib/Mapping.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/tool_src/BspLib/Mapping.cpp b/tool_src/BspLib/Mapping.cpp
new file mode 100644
index 0000000..956d66c
--- /dev/null
+++ b/tool_src/BspLib/Mapping.cpp
@@ -0,0 +1,63 @@
+//-----------------------------------------------------------------------------
+// BSPLIB MODULE: Mapping.cpp
+//
+// Copyright (c) 1996-1998 by Markus Hadwiger
+// All Rights Reserved.
+//-----------------------------------------------------------------------------
+
+// bsplib headers
+#include "Mapping.h"
+#include "Chunk.h"
+
+
+BSPLIB_NAMESPACE_BEGIN
+
+
+// write mapping info in vertexindexes with mappings format -------------------
+//
+void Mapping::WriteMappingInfo( FILE *fp ) const
+{
+ // write list of vertex indexes
+ int i = 0;
+ for ( i = 0; i < numvertexindxs; i++ ) {
+ fprintf( fp, ( i == numvertexindxs - 1 ) ?
+ "%d\n" : "%d, ", facevertexindxs[ i ] + 1 );
+ }
+
+ // write (u,v) coordinates
+ for ( i = 0; i < numvertexindxs; i++ ) {
+ fprintf( fp, "%f, \t%f\n",
+ mappingcoordinates[ i ].getX(),
+ mappingcoordinates[ i ].getY() );
+ }
+
+ fprintf( fp, "\n" );
+}
+
+
+// error in search of vertices ------------------------------------------------
+//
+void Mapping::Error( int vertindx )
+{
+ char *line = new char[ 1024 ];
+// fprintf( stderr, "***ERROR*** Correspondence not found (%d)!\n", corrno + 1 );
+ sprintf( line, "***ERROR*** Correspondence not found!\nsought vertex %d", vertindx + 1 );
+ ErrorMessage( line );
+ delete line;
+/*
+ fprintf( stderr, "list of vertices:\n" );
+ for ( int i = 0; i < numvertexindxs; i++ )
+ fprintf( stderr, "vertex %d\n", facevertexindxs[ i ] + 1 );
+*/
+ HandleCriticalError();
+}
+
+
+// size of mapping chunk ------------------------------------------------------
+//
+template <> const int ChunkRep<Mapping>::CHUNK_SIZE = 256;
+
+
+BSPLIB_NAMESPACE_END
+
+//-----------------------------------------------------------------------------