Changeset 2877 for trunk/packages/vizservers/nanovis/ConvexPolygon.cpp
- Timestamp:
- Mar 23, 2012, 1:31:05 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/ConvexPolygon.cpp
r2870 r2877 100 100 101 101 void 102 ConvexPolygon::clip(Plane& clipPlane, bool copy _to_texcoord)102 ConvexPolygon::clip(Plane& clipPlane, bool copyToTexcoord) 103 103 { 104 104 if (vertices.size() == 0) { … … 123 123 Vector4 plane = clipPlane.get_coeffs(); 124 124 125 bool prevRetained = is _retained(vertices[0], plane);125 bool prevRetained = isRetained(vertices[0], plane); 126 126 if (prevRetained) 127 127 clippedVerts.push_back(vertices[0]); 128 128 129 129 for (unsigned int i = 1; i < vertices.size(); i++) { 130 bool retained = is _retained(vertices[i], plane);130 bool retained = isRetained(vertices[i], plane); 131 131 if (retained != prevRetained) { 132 132 bool found = findIntersection(vertices[i - 1], vertices[i], … … 141 141 } 142 142 143 bool retained = is _retained(vertices[0], plane);143 bool retained = isRetained(vertices[0], plane); 144 144 if (retained != prevRetained) { 145 145 bool found = findIntersection(vertices[vertices.size() - 1], … … 154 154 clippedVerts.end()); 155 155 156 if (copy _to_texcoord)157 copy _vertices_to_texcoords();158 } 159 160 void 161 ConvexPolygon::copy _vertices_to_texcoords()156 if (copyToTexcoord) 157 copyVerticesToTexcoords(); 158 } 159 160 void 161 ConvexPolygon::copyVerticesToTexcoords() 162 162 { 163 163 if (texcoords.size() > 0) … … 170 170 171 171 void 172 ConvexPolygon:: Emit(bool use_texture)172 ConvexPolygon::emit(bool useTexture) 173 173 { 174 174 if (vertices.size() >= 3) { 175 175 for (unsigned int i = 0; i < vertices.size(); i++) { 176 if (use _texture) {176 if (useTexture) { 177 177 glTexCoord4fv((float *)&(texcoords[i])); 178 178 //glTexCoord4fv((float *)&(vertices[i])); … … 184 184 185 185 void 186 ConvexPolygon:: Emit(bool use_texture, const Vector3& shift, const Vector3& scale)186 ConvexPolygon::emit(bool useTexture, const Vector3& shift, const Vector3& scale) 187 187 { 188 188 if (vertices.size() >= 3) { 189 189 for (unsigned int i = 0; i < vertices.size(); i++) { 190 if (use _texture) {190 if (useTexture) { 191 191 glTexCoord4fv((float *)&(vertices[i])); 192 192 }
Note: See TracChangeset
for help on using the changeset viewer.