// a triangle and uv coordinate of its vertexes

class Face {
  public var ids( __getIDs, __setIDs ):TriFaceIDs; // vertex ids
    public function __getIDs():TriFaceIDs { return( ids ); }
    public function __setIDs( i:TriFaceIDs ):TriFaceIDs {
      ids = i.clone();
      return( ids );
    }
  public var uv0( __getUV0, __setUV0 ):UVCoord;
    public function __getUV0():UVCoord { return( uv0 ); }
    public function __setUV0( r:UVCoord ):UVCoord {
      uv0 = r.clone();
      return( uv0 );
    }
  public var uv1( __getUV1, __setUV1 ):UVCoord;
    public function __getUV1():UVCoord { return( uv1 ); }
    public function __setUV1( r:UVCoord ):UVCoord {
      uv1 = r.clone();
      return( uv1 );
    }
  public var uv2( __getUV2, __setUV2 ):UVCoord;
    public function __getUV2():UVCoord { return( uv2 ); }
    public function __setUV2( r:UVCoord ):UVCoord {
      uv2 = r.clone();
      return( uv2 );
    }

  // ##################################################################

  public function new( ?i:UInt,
                       ?j:UInt,
                       ?k:UInt,
                       ?r0:UVCoord,
                       ?r1:UVCoord,
                       ?r2:UVCoord ) {
    if ( i != null && j != null && k != null ) {
      ids = new TriFaceIDs( i, j, k );
    }
    if ( r0 != null ) __setUV0( r0 );
    if ( r1 != null ) __setUV1( r1 );
    if ( r2 != null ) __setUV2( r2 );
  }

  public function setID( i:UInt,
                         j:UInt,
                         k:UInt ):Void {
    ids = new TriFaceIDs( i, j, k );
  }
}
