#ifdef NT_ENV #include "StdAfx.h" #endif // // Class: AmEdge // /* //- // ========================================================================== // Copyright (C) 1995 - 2005 Alias Systems Corp. and/or its licensors. All // rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files are provided by Alias // Systems Corp. ("Alias") and/or its licensors for the exclusive use of the // Customer (as defined in the Alias Software License Agreement that // accompanies this Alias software). Such Customer has the right to use, // modify, and incorporate the Data into other products and to distribute such // products for use by end-users. // // THE DATA IS PROVIDED "AS IS". ALIAS HEREBY DISCLAIMS ALL WARRANTIES // RELATING TO THE DATA, INCLUDING, WITHOUT LIMITATION, ANY AND ALL EXPRESS OR // IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. IN NO EVENT SHALL ALIAS BE LIABLE FOR ANY DAMAGES // WHATSOEVER, WHETHER DIRECT, INDIRECT, SPECIAL, OR PUNITIVE, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, OR IN EQUITY, // ARISING OUT OF ACCESS TO, USE OF, OR RELIANCE UPON THE DATA. // ========================================================================== //+ */ // $Revision: /main/2 $ // $Date: 2000/04/26 16:18:14 $ #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" ); }