ReactOS  0.4.11-dev-195-gef016bf
directedLine.h File Reference
#include "sampledLine.h"
Include dependency graph for directedLine.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  directedLine
 

Enumerations

enum  { INCREASING, DECREASING }
 

Functions

directedLinereadAllPolygons (char *filename)
 
Int compV2InY (Real A[2], Real B[2])
 
Int compV2InX (Real A[2], Real B[2])
 

Enumeration Type Documentation

anonymous enum
Enumerator
INCREASING 
DECREASING 

Definition at line 39 of file directedLine.h.

Function Documentation

Int compV2InX ( Real  A[2],
Real  B[2] 
)

Definition at line 407 of file directedLine.cc.

Referenced by DBG_is_U_monotone(), findDiagonal_singleCuspX(), is_u_maximal(), is_u_minimal(), isCuspX(), monoTriangulationOpt(), monoTriangulationRecGenOpt(), and sampleMonoPoly().

408 {
409  if(A[0] < B[0]) return -1;
410  if(A[0] == B[0] && A[1] < B[1]) return -1;
411  if(A[0] == B[0] && A[1] == B[1]) return 0;
412  return 1;
413 }
#define B(row, col)
Definition: m_matrix.c:146
Definition: ttei1.cpp:12
Int compV2InY ( Real  A[2],
Real  B[2] 
)

Definition at line 399 of file directedLine.cc.

Referenced by compChainHeadInY(), findTopAndBot(), monoPolyPart(), monoTriangulation(), monoTriangulationOpt(), monoTriangulationRec(), monoTriangulationRecGen(), sampleMonoPoly(), Slicer::slice_new(), and triangulateConvexPoly().

400 {
401  if(A[1] < B[1]) return -1;
402  if(A[1] == B[1] && A[0] < B[0]) return -1;
403  if(A[1] == B[1] && A[0] == B[0]) return 0;
404  return 1;
405 }
#define B(row, col)
Definition: m_matrix.c:146
Definition: ttei1.cpp:12
directedLine* readAllPolygons ( char filename)

Definition at line 792 of file directedLine.cc.

793 {
794  Int i,j;
795  FILE* fp = fopen(filename, "r");
796  Int nPolygons;
797  int result;
798 
799  assert(fp);
800  result = fscanf(fp, "%i", &nPolygons);
801  assert(result != EOF);
802  directedLine *ret = NULL;
803 
804  for(i=0; i<nPolygons; i++)
805  {
806  Int nEdges;
807  result = fscanf(fp, "%i", &nEdges);
808  assert(result != EOF);
809  Real vert[2][2] = { { 0 } };
810  Real VV[2][2];
811  /*the first two vertices*/
812  result = fscanf(fp, "%f", &(vert[0][0]));
813  assert(result != EOF);
814  result = fscanf(fp, "%f", &(vert[0][1]));
815  assert(result != EOF);
816  result = fscanf(fp, "%f", &(vert[1][0]));
817  assert(result != EOF);
818  result = fscanf(fp, "%f", &(vert[1][1]));
819  assert(result != EOF);
820  VV[1][0] = vert[0][0];
821  VV[1][1] = vert[0][1];
822  sampledLine *sLine = new sampledLine(2, vert);
823  directedLine *thisPoly = new directedLine(INCREASING, sLine);
824 thisPoly->rootLinkSet(NULL);
825 
826  directedLine *dLine;
827  for(j=2; j<nEdges; j++)
828  {
829  vert[0][0]=vert[1][0];
830  vert[0][1]=vert[1][1];
831  result = fscanf(fp, "%f", &(vert[1][0]));
832  assert(result != EOF);
833  result = fscanf(fp, "%f", &(vert[1][1]));
834  assert(result != EOF);
835  sLine = new sampledLine(2,vert);
836  dLine = new directedLine(INCREASING, sLine);
837 dLine->rootLinkSet(thisPoly);
838  thisPoly->insert(dLine);
839  }
840 
841  VV[0][0]=vert[1][0];
842  VV[0][1]=vert[1][1];
843  sLine = new sampledLine(2,VV);
844  dLine = new directedLine(INCREASING, sLine);
845 dLine->rootLinkSet(thisPoly);
846  thisPoly->insert(dLine);
847 
848  ret = thisPoly->insertPolygon(ret);
849  }
850  fclose(fp);
851  return ret;
852 }
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
void rootLinkSet(directedLine *r)
Definition: directedLine.h:155
_Check_return_ _CRTIMP int __cdecl fscanf(_Inout_ FILE *_File, _In_z_ _Scanf_format_string_ const char *_Format,...)
#define assert(x)
Definition: debug.h:53
const char * filename
Definition: ioapi.h:135
GLenum GLclampf GLint i
Definition: glfuncs.h:14
directedLine * insertPolygon(directedLine *newpolygon)
smooth NULL
Definition: ftsmooth.c:416
int ret
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
float Real
Definition: definitions.h:36
#define EOF
Definition: stdio.h:24
GLuint64EXT * result
Definition: glext.h:11304
void insert(directedLine *nl)
int Int
Definition: definitions.h:37