#ifdef NT_ENV #include "StdAfx.h" #endif // // Class: AmEdge // /* //- // ========================================================================== // Copyright (C) 1995 - 2006 Autodesk, Inc. and/or its licensors. All // rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files contain unpublished // information proprietary to Autodesk, Inc. ("Autodesk") and/or its // licensors, which is protected by U.S. and Canadian federal copyright // law and by international treaties. // // The Data is provided for use exclusively by You. You have the right // to use, modify, and incorporate this Data into other products for // purposes authorized by the Autodesk software license agreement, // without fee. // // The copyright notices in the Software and this entire statement, // including the above license grant, this restriction and the // following disclaimer, must be included in all copies of the // Software, in whole or in part, and all derivative works of // the Software, unless such copies or derivative works are solely // in the form of machine-executable object code generated by a // source language processor. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. // AUTODESK DOES NOT MAKE AND HEREBY DISCLAIMS ANY EXPRESS OR IMPLIED // WARRANTIES INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES OF // NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR // PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE, OR // TRADE PRACTICE. IN NO EVENT WILL AUTODESK AND/OR ITS LICENSORS // BE LIABLE FOR ANY LOST REVENUES, DATA, OR PROFITS, OR SPECIAL, // DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES, EVEN IF AUTODESK // AND/OR ITS LICENSORS HAS BEEN ADVISED OF THE POSSIBILITY // OR PROBABILITY OF SUCH DAMAGES. // // ========================================================================== //+ */ #include #ifdef WIN32 #include #endif #include "AmEdge.h" extern FILE *fp; #define kFALSE false #define kTRUE true #ifdef WIN32 #define NULL 0 #endif AmEdge::AmEdge( ) : fEdgeId ( 0 ), fStartIndex ( 0 ), fEndIndex ( 0 ), fHardEdge ( kFALSE ), fNextEdge ( NULL ) { fStartNormal[0] = fStartNormal[1] = fStartNormal[2] = 0.0; fEndNormal[0] = fEndNormal[1] = fEndNormal[2] = 0.0; } AmEdge::~AmEdge( ) { } void AmEdge::setEdge( int edgeId, int startIndex, int endIndex, double *startNormal, double *endNormal ) // // Description: // This function sets the edge id and the indices of // its two vertices. // // Arguments: // edgeId - index to the edge // startIndex - index to the start vertex of the edge // endIndex - index to the end vertex of the edge // { fEdgeId = edgeId; fStartIndex = startIndex; fEndIndex = endIndex; for( int i = 0; i < 3; i++) { fStartNormal[i] = startNormal[i]; fEndNormal[i] = endNormal[i]; } } int AmEdge::edgeId( ) // // Description: // This function returns the edgeId. // { return fEdgeId; } int AmEdge::startIndex( ) // // Description: // This function returns the index to the start vertex. // { return fStartIndex; } int AmEdge::endIndex( ) // // Description: // This function returns the index to the end vertex. // { return fEndIndex; } void AmEdge::hardenEdge( ) // // Description: // This function returns the ... // { fHardEdge = kTRUE; } double * AmEdge::startNormal( ) // // Description: // This function returns the ... // { return fStartNormal; } double * AmEdge::endNormal( ) // // Description: // This function returns the ... // { return fEndNormal; } void AmEdge::setNextEdge( AmEdge *nextEdge ) // // Description: // This function sets the next edge. // // Arguments: // nextEdge - next edge in the edge list // { fNextEdge = nextEdge; } AmEdge * AmEdge::nextEdge( ) // // Description: // This function returns the pointer to the next edge. // { return fNextEdge; } void AmEdge:: printEdge( int counter ) { if( counter == fEdgeId ) if( kTRUE == fHardEdge ) fprintf( fp, "%s%d\t%d\t0\n", "\t\t", fStartIndex-1, fEndIndex-1 ); else fprintf( fp, "%s%d\t%d\t1\n", "\t\t", fStartIndex-1, fEndIndex-1 ); else fprintf( stderr, "Error: edge out of order!\n" ); }