Ignore:
Timestamp:
Mar 23, 2012, 1:31:05 AM (12 years ago)
Author:
ldelgass
Message:

Some minor refactoring, also add some more fine grained config.h defines
(e.g. replace NV40 define with feature defines). Add tests for some required
OpenGL extensions (should always check for extensions or base version before
calling entry points from the extension). Also, clamp diffuse and specular
values on input and warn when they are out of range.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/ConvexPolygon.cpp

    r2870 r2877  
    100100
    101101void
    102 ConvexPolygon::clip(Plane& clipPlane, bool copy_to_texcoord)
     102ConvexPolygon::clip(Plane& clipPlane, bool copyToTexcoord)
    103103{
    104104    if (vertices.size() == 0) {
     
    123123    Vector4 plane = clipPlane.get_coeffs();
    124124
    125     bool prevRetained = is_retained(vertices[0], plane);
     125    bool prevRetained = isRetained(vertices[0], plane);
    126126    if (prevRetained)
    127127        clippedVerts.push_back(vertices[0]);
    128128
    129129    for (unsigned int i = 1; i < vertices.size(); i++) {
    130         bool retained = is_retained(vertices[i], plane);
     130        bool retained = isRetained(vertices[i], plane);
    131131        if (retained != prevRetained) {
    132132            bool found = findIntersection(vertices[i - 1], vertices[i],
     
    141141    }
    142142
    143     bool retained = is_retained(vertices[0], plane);
     143    bool retained = isRetained(vertices[0], plane);
    144144    if (retained != prevRetained) {
    145145        bool found = findIntersection(vertices[vertices.size() - 1],
     
    154154                    clippedVerts.end());
    155155
    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
     160void
     161ConvexPolygon::copyVerticesToTexcoords()
    162162{
    163163    if (texcoords.size() > 0)
     
    170170
    171171void
    172 ConvexPolygon::Emit(bool use_texture)
     172ConvexPolygon::emit(bool useTexture)
    173173{
    174174    if (vertices.size() >= 3) {
    175175        for (unsigned int i = 0; i < vertices.size(); i++) {
    176             if (use_texture) {
     176            if (useTexture) {
    177177                glTexCoord4fv((float *)&(texcoords[i]));
    178178                //glTexCoord4fv((float *)&(vertices[i]));
     
    184184
    185185void
    186 ConvexPolygon::Emit(bool use_texture, const Vector3& shift, const Vector3& scale)
     186ConvexPolygon::emit(bool useTexture, const Vector3& shift, const Vector3& scale)
    187187{
    188188    if (vertices.size() >= 3) {
    189189        for (unsigned int i = 0; i < vertices.size(); i++) {
    190             if (use_texture) {
     190            if (useTexture) {
    191191                glTexCoord4fv((float *)&(vertices[i]));
    192192            }
Note: See TracChangeset for help on using the changeset viewer.