Moved definition of struct ShapeDesc into same header file as Shape:

- added definition to regression/common/shape_utils.h
    - removed examples/common/shapeDesc.h and all references to it
    - removed local definitions of ShapeDesc from examples, regressions, etc.
    - overloaded Shape::parseObj() with ShapeDesc
    - updated examples to use Shape::parseObj(ShapeDesc const&);
    - removed axis argument to Shape::ParseObj() and ObjAnim::Create()
This commit is contained in:
barry 2019-04-23 12:05:14 -07:00
parent 1abe8a7087
commit b7470bb26f
34 changed files with 95 additions and 273 deletions

View File

@ -46,7 +46,6 @@ set(EXAMPLES_COMMON_HEADER_FILES
objAnim.h
patchColors.h
shaderCache.h
shapeDesc.h
simple_math.h
stb_image_write.h
stopwatch.h

View File

@ -88,7 +88,7 @@ ObjAnim::InterpolatePositions(float time, float * positions, int stride) const {
}
ObjAnim const *
ObjAnim::Create(std::vector<char const *> objFiles, bool axis, Scheme scheme) {
ObjAnim::Create(std::vector<char const *> objFiles, Scheme scheme, bool isLeftHanded) {
ObjAnim * anim=0;
@ -118,7 +118,7 @@ ObjAnim::Create(std::vector<char const *> objFiles, bool axis, Scheme scheme) {
fflush(stdout);
std::string str = ss.str();
shape = Shape::parseObj(str.c_str(), scheme, false, axis);
shape = Shape::parseObj(str.c_str(), scheme, isLeftHanded);
if (i==0) {

View File

@ -34,8 +34,8 @@ class ObjAnim {
public:
// Factory function
static ObjAnim const * Create(std::vector<char const *> objFiles, bool axis=true,
Scheme scheme=kCatmark);
static ObjAnim const * Create(std::vector<char const *> objFiles,
Scheme scheme, bool isLeftHanded=false);
// Destructor
~ObjAnim();

View File

@ -1,44 +0,0 @@
//
// Copyright 2019 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef SHAPE_DESC_H
#define SHAPE_DESC_H
#include <string>
struct ShapeDesc
{
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme,
bool iIsLeftHanded = false) :
name(iname), data(idata), scheme(ischeme), isLeftHanded(iIsLeftHanded)
{ }
std::string name;
std::string data;
Scheme scheme;
bool isLeftHanded;
};
#endif // SHAPE_DESC_H

View File

@ -25,7 +25,6 @@
#include "../common/viewerArgsUtils.h"
#include "../common/objAnim.h"
#include "../common/shapeDesc.h"
#include <fstream>
#include <sstream>
@ -43,7 +42,7 @@ PopulateAnimShapes(const ArgOptions &args,
return NULL;
const ObjAnim *objAnim = ObjAnim::Create(args.GetObjFiles(), true,
const ObjAnim *objAnim = ObjAnim::Create(args.GetObjFiles(),
args.GetDefaultScheme());
if (objAnim) {

View File

@ -28,7 +28,6 @@
#include "../../regression/common/shape_utils.h"
#include "../common/argOptions.h"
#include "../common/shapeDesc.h"
class ObjAnim;

View File

@ -271,7 +271,7 @@ createOsdMesh(ShapeDesc const & shapeDesc, int level, int kernel, Scheme scheme=
using namespace OpenSubdiv;
typedef Far::ConstIndexArray IndexArray;
Shape * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);
Shape * shape = Shape::parseObj(shapeDesc);
// create Far mesh (topology)
Sdc::SchemeType sdctype = GetSdcType(*shape);

View File

@ -25,7 +25,6 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
#include "../common/shapeDesc.h"
static std::vector<ShapeDesc> g_defaultShapes;

View File

@ -812,7 +812,7 @@ createMeshes(ShapeDesc const & desc, int maxlevel) {
}
g_font->Clear();
Shape * shape = Shape::parseObj(desc.data.c_str(), desc.scheme);
Shape * shape = Shape::parseObj(desc);
createFarGLMesh(shape, maxlevel);
delete shape;

View File

@ -25,15 +25,6 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
struct ShapeDesc {
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme) :
name(iname), data(idata), scheme(ischeme) { }
std::string name,
data;
Scheme scheme;
};
static std::vector<ShapeDesc> g_shapes;

View File

@ -605,7 +605,7 @@ updateGeom() {
static void
createOsdMesh(ShapeDesc const & shapeDesc, int level) {
Shape * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);
Shape * shape = Shape::parseObj(shapeDesc);
// create Far mesh (topology)
Sdc::SchemeType sdctype = GetSdcType(*shape);

View File

@ -25,15 +25,6 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
struct ShapeDesc {
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme) :
name(iname), data(idata), scheme(ischeme) { }
std::string name,
data;
Scheme scheme;
};
static std::vector<ShapeDesc> g_defaultShapes;

View File

@ -414,7 +414,7 @@ rebuildMesh() {
int level = g_level;
Scheme scheme = g_defaultShapes[g_currentShape].scheme;
Shape * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);
Shape * shape = Shape::parseObj(shapeDesc);
if (!shape->HasUV()) {
printf("Error: shape %s does not contain face-varying UVs\n", shapeDesc.name.c_str());

View File

@ -24,7 +24,7 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
#include "../common/shapeDesc.h"
static std::vector<ShapeDesc> g_defaultShapes;

View File

@ -300,8 +300,7 @@ void runTest(ShapeDesc const &shapeDesc, std::string const &kernel,
std::cout << "Testing " << shapeDesc.name << ", kernel = " << kernel << "\n";
Shape const * shape = Shape::parseObj(shapeDesc.data.c_str(),
shapeDesc.scheme);
Shape const * shape = Shape::parseObj(shapeDesc);
// create Far mesh (topology)
Sdc::SchemeType sdctype = GetSdcType(*shape);

View File

@ -25,15 +25,6 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
struct ShapeDesc {
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme) :
name(iname), data(idata), scheme(ischeme) { }
std::string name,
data;
Scheme scheme;
};
static std::vector<ShapeDesc> g_shapes;

View File

@ -197,7 +197,7 @@ createOsdMesh() {
ShapeDesc const & shapeDesc = g_defaultShapes[g_currentShape];
Shape * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);
Shape * shape = Shape::parseObj(shapeDesc);
checkGLErrors("create osd enter");

View File

@ -25,15 +25,6 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
struct ShapeDesc {
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme) :
name(iname), data(idata), scheme(ischeme) { }
std::string name,
data;
Scheme scheme;
};
static std::vector<ShapeDesc> g_defaultShapes;

View File

@ -932,10 +932,7 @@ rebuildTopology() {
}
for (int i = 0; i < (int)g_defaultShapes.size(); ++i) {
Shape const * shape = Shape::parseObj(
g_defaultShapes[i].data.c_str(),
g_defaultShapes[i].scheme,
g_defaultShapes[i].isLeftHanded);
Shape const * shape = Shape::parseObj(g_defaultShapes[i]);
bool varying = (g_displayStyle==kVarying || g_displayStyle==kVaryingInterleaved);
g_scene->AddTopology(shape, g_level, varying);

View File

@ -25,17 +25,6 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
struct ShapeDesc {
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme,
bool iIsLeftHanded=false) :
name(iname), data(idata), scheme(ischeme), isLeftHanded(iIsLeftHanded) { }
std::string name,
data;
Scheme scheme;
bool isLeftHanded;
};
static std::vector<ShapeDesc> g_defaultShapes;

View File

@ -293,7 +293,7 @@ createMesh(ShapeDesc const & shapeDesc, int level) {
typedef Far::LimitStencilTableFactory::LocationArray LocationArray;
Shape const * shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme);
Shape const * shape = Shape::parseObj(shapeDesc);
// create Far mesh (topology)
Sdc::SchemeType sdctype = GetSdcType(*shape);

View File

@ -25,15 +25,6 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
struct ShapeDesc {
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme) :
name(iname), data(idata), scheme(ischeme) { }
std::string name,
data;
Scheme scheme;
};
static std::vector<ShapeDesc> g_defaultShapes;

View File

@ -428,8 +428,7 @@ rebuildMesh() {
if (doAnim) {
shape = g_objAnim->GetShape();
} else {
shape = Shape::parseObj(shapeDesc.data.c_str(), shapeDesc.scheme,
shapeDesc.isLeftHanded);
shape = Shape::parseObj(shapeDesc);
}
// create Far mesh (topology)

View File

@ -25,7 +25,6 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
#include "../common/shapeDesc.h"
static std::vector<ShapeDesc> g_defaultShapes;

View File

@ -25,17 +25,6 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
struct ShapeDesc {
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme,
bool iIsLeftHanded = false) :
name(iname), data(idata), scheme(ischeme), isLeftHanded(iIsLeftHanded) { }
std::string name,
data;
Scheme scheme;
bool isLeftHanded;
};
static std::vector<ShapeDesc> g_defaultShapes;

View File

@ -25,17 +25,6 @@
#include "../../regression/common/shape_utils.h"
#include "../../regression/shapes/all.h"
struct ShapeDesc {
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme,
bool iIsLeftHanded = false) :
name(iname), data(idata), scheme(ischeme), isLeftHanded(iIsLeftHanded) { }
std::string name;
std::string data;
Scheme scheme;
bool isLeftHanded;
};
static std::vector<ShapeDesc> g_defaultShapes;

View File

@ -61,8 +61,8 @@ Shape::~Shape() {
}
//------------------------------------------------------------------------------
Shape * Shape::parseObj(char const * shapestr, Scheme shapescheme,
bool isLeftHanded, int axis, bool parsemtl) {
Shape * Shape::parseObj(char const * shapestr, Scheme shapescheme, bool isLeftHanded,
bool parsemtl) {
Shape * s = new Shape;
@ -82,12 +82,8 @@ Shape * Shape::parseObj(char const * shapestr, Scheme shapescheme,
case 'v': switch (line[1]) {
case ' ': if (sscanf(line, "v %f %f %f", &x, &y, &z) == 3) {
s->verts.push_back(x);
switch( axis ) {
case 0 : s->verts.push_back(-z);
s->verts.push_back(y); break;
case 1 : s->verts.push_back(y);
s->verts.push_back(z); break;
}
s->verts.push_back(y);
s->verts.push_back(z);
} break;
case 't': if (sscanf(line, "vt %f %f", &u, &v) == 2) {
s->uvs.push_back(u);
@ -141,6 +137,12 @@ Shape * Shape::parseObj(char const * shapestr, Scheme shapescheme,
return s;
}
//------------------------------------------------------------------------------
Shape * Shape::parseObj(ShapeDesc const & shapeDesc, bool parsemtl) {
return parseObj(shapeDesc.data.c_str(), shapeDesc.scheme, shapeDesc.isLeftHanded,
parsemtl);
}
//------------------------------------------------------------------------------
Shape::tag * Shape::tag::parseTag(char const * line) {
tag * t = 0;

View File

@ -30,12 +30,26 @@
#include <map>
//------------------------------------------------------------------------------
enum Scheme {
kBilinear=0,
kCatmark,
kLoop
};
struct ShapeDesc
{
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme,
bool iIsLeftHanded = false) :
name(iname), data(idata), scheme(ischeme), isLeftHanded(iIsLeftHanded)
{ }
std::string name;
std::string data;
Scheme scheme;
bool isLeftHanded;
};
//------------------------------------------------------------------------------
struct Shape {
@ -70,8 +84,9 @@ struct Shape {
std::vector<std::string> stringargs;
};
static Shape * parseObj(char const * Shapestr, Scheme schme,
bool isLeftHanded=false, int axis=1, bool parsemtl=false);
static Shape * parseObj(ShapeDesc const & shapeDesc, bool parsemtl=false);
static Shape * parseObj(char const * shapeString, Scheme shapeScheme,
bool isLeftHanded=false, bool parsemtl=false);
void parseMtllib(char const * stream);

View File

@ -165,10 +165,7 @@ int main(int argc, char **argv)
}
for (int i = 0; i < (int)g_shapes.size(); ++i) {
Shape const * shape = Shape::parseObj(
g_shapes[i].data.c_str(),
g_shapes[i].scheme,
g_shapes[i].isLeftHanded);
Shape const * shape = Shape::parseObj(g_shapes[i]);
for (int lv = 1; lv <= maxlevel; ++lv) {
printf("---- %s, level %d ----\n", g_shapes[i].name.c_str(), lv);

View File

@ -23,23 +23,11 @@
//
#include "../common/shape_utils.h"
#include "../shapes/all.h"
struct ShapeDesc {
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme,
bool iisLeftHanded=false) :
name(iname), data(idata), scheme(ischeme), isLeftHanded(iisLeftHanded) { }
std::string name,
data;
Scheme scheme;
bool isLeftHanded;
};
static std::vector<ShapeDesc> g_shapes;
#include "../shapes/all.h"
//------------------------------------------------------------------------------
static void initShapes() {
g_shapes.push_back( ShapeDesc("catmark_car", catmark_car, kCatmark ) );

View File

@ -297,6 +297,12 @@ areVerticesCompatibleWithHbr(Shape const & shape, FarTopologyRefiner const & ref
}
return false;
}
if (shape.isLeftHanded) {
if (incompatibleString) {
*incompatibleString = std::string("mesh is left-handed");
}
return false;
}
if (shapeHasHierarchicalEditTags(shape)) {
if (incompatibleString) {
*incompatibleString = std::string("hierarchical edits no longer supported");
@ -347,7 +353,7 @@ int main(int /* argc */, char ** /* argv */) {
for (int i=0; i<(int)g_shapes.size(); ++i) {
ShapeDesc const & desc = g_shapes[i];
Shape * shape = Shape::parseObj(desc.data.c_str(), desc.scheme);
Shape * shape = Shape::parseObj(desc);
if (shape) {
// May want to inspect and/or modify the shape before proceeding...

View File

@ -25,17 +25,6 @@
#include "../common/shape_utils.h"
#include "../shapes/all.h"
struct ShapeDesc {
ShapeDesc(char const * iname, std::string const & idata, Scheme ischeme,
bool iisLeftHanded=false) :
name(iname), data(idata), scheme(ischeme), isLeftHanded(iisLeftHanded) { }
std::string name,
data;
Scheme scheme;
bool isLeftHanded;
};
static std::vector<ShapeDesc> g_shapes;

View File

@ -23,95 +23,52 @@
//
#include "../common/shape_utils.h"
#include "../shapes/all.h"
struct shaperec {
shaperec(char const * iname, std::string const & idata, Scheme ischeme) :
name(iname), data(idata), scheme(ischeme) { }
std::string name,
data;
Scheme scheme;
};
static std::vector<shaperec> g_shapes;
#include "../shapes/bilinear_cube.h"
#include "../shapes/catmark_chaikin0.h"
#include "../shapes/catmark_chaikin1.h"
#include "../shapes/catmark_cube_corner0.h"
#include "../shapes/catmark_cube_corner1.h"
#include "../shapes/catmark_cube_corner2.h"
#include "../shapes/catmark_cube_corner3.h"
#include "../shapes/catmark_cube_corner4.h"
#include "../shapes/catmark_cube_creases0.h"
#include "../shapes/catmark_cube_creases1.h"
#include "../shapes/catmark_cube.h"
#include "../shapes/catmark_dart_edgecorner.h"
#include "../shapes/catmark_dart_edgeonly.h"
#include "../shapes/catmark_edgecorner.h"
#include "../shapes/catmark_edgeonly.h"
#include "../shapes/catmark_flap.h"
#include "../shapes/catmark_flap2.h"
#include "../shapes/catmark_pyramid_creases0.h"
#include "../shapes/catmark_pyramid_creases1.h"
#include "../shapes/catmark_pyramid.h"
#include "../shapes/catmark_square_hedit0.h"
#include "../shapes/catmark_square_hedit1.h"
#include "../shapes/catmark_square_hedit2.h"
#include "../shapes/catmark_square_hedit3.h"
#include "../shapes/catmark_tent_creases0.h"
#include "../shapes/catmark_tent_creases1.h"
#include "../shapes/catmark_tent.h"
#include "../shapes/loop_cube_creases0.h"
#include "../shapes/loop_cube_creases1.h"
#include "../shapes/loop_cube.h"
#include "../shapes/loop_icosahedron.h"
#include "../shapes/loop_saddle_edgecorner.h"
#include "../shapes/loop_saddle_edgeonly.h"
#include "../shapes/loop_triangle_edgecorner.h"
#include "../shapes/loop_triangle_edgeonly.h"
#include "../shapes/loop_chaikin0.h"
#include "../shapes/loop_chaikin1.h"
static std::vector<ShapeDesc> g_shapes;
//------------------------------------------------------------------------------
//
// Shapes commented out below have been modified since baseline data was generated:
//
static void initShapes() {
g_shapes.push_back( shaperec("bilinear_cube", bilinear_cube, kBilinear) );
g_shapes.push_back( shaperec("catmark_chaikin0", catmark_chaikin0, kCatmark ) );
g_shapes.push_back( shaperec("catmark_chaikin1", catmark_chaikin1, kCatmark ) );
g_shapes.push_back( shaperec("catmark_cube_corner0", catmark_cube_corner0, kCatmark ) );
g_shapes.push_back( shaperec("catmark_cube_corner1", catmark_cube_corner1, kCatmark ) );
g_shapes.push_back( shaperec("catmark_cube_corner2", catmark_cube_corner2, kCatmark ) );
g_shapes.push_back( shaperec("catmark_cube_corner3", catmark_cube_corner3, kCatmark ) );
g_shapes.push_back( shaperec("catmark_cube_corner4", catmark_cube_corner4, kCatmark ) );
g_shapes.push_back( shaperec("catmark_cube_creases0", catmark_cube_creases0, kCatmark ) );
g_shapes.push_back( shaperec("catmark_cube_creases1", catmark_cube_creases1, kCatmark ) );
g_shapes.push_back( shaperec("catmark_cube", catmark_cube, kCatmark ) );
g_shapes.push_back( shaperec("catmark_dart_edgecorner", catmark_dart_edgecorner, kCatmark ) );
g_shapes.push_back( shaperec("catmark_dart_edgeonly", catmark_dart_edgeonly, kCatmark ) );
g_shapes.push_back( shaperec("catmark_edgecorner", catmark_edgecorner, kCatmark ) );
g_shapes.push_back( shaperec("catmark_edgeonly", catmark_edgeonly, kCatmark ) );
g_shapes.push_back( shaperec("catmark_flap", catmark_flap, kCatmark ) );
g_shapes.push_back( shaperec("catmark_flap2", catmark_flap2, kCatmark ) );
g_shapes.push_back( shaperec("catmark_pyramid_creases0", catmark_pyramid_creases0, kCatmark ) );
g_shapes.push_back( shaperec("catmark_pyramid_creases1", catmark_pyramid_creases1, kCatmark ) );
g_shapes.push_back( shaperec("catmark_pyramid", catmark_pyramid, kCatmark ) );
g_shapes.push_back( shaperec("catmark_square_hedit0", catmark_square_hedit0, kCatmark ) );
g_shapes.push_back( shaperec("catmark_square_hedit1", catmark_square_hedit1, kCatmark ) );
g_shapes.push_back( shaperec("catmark_square_hedit2", catmark_square_hedit2, kCatmark ) );
g_shapes.push_back( shaperec("catmark_square_hedit3", catmark_square_hedit3, kCatmark ) );
g_shapes.push_back( shaperec("catmark_tent_creases0", catmark_tent_creases0, kCatmark ) );
g_shapes.push_back( shaperec("catmark_tent_creases1", catmark_tent_creases1 , kCatmark ) );
g_shapes.push_back( shaperec("catmark_tent", catmark_tent, kCatmark ) );
g_shapes.push_back( shaperec("loop_cube_creases0", loop_cube_creases0, kLoop ) );
g_shapes.push_back( shaperec("loop_cube_creases1", loop_cube_creases1, kLoop ) );
g_shapes.push_back( shaperec("loop_cube", loop_cube, kLoop ) );
g_shapes.push_back( shaperec("loop_icosahedron", loop_icosahedron, kLoop ) );
g_shapes.push_back( shaperec("loop_saddle_edgecorner", loop_saddle_edgecorner, kLoop ) );
g_shapes.push_back( shaperec("loop_saddle_edgeonly", loop_saddle_edgeonly, kLoop ) );
g_shapes.push_back( shaperec("loop_triangle_edgecorner", loop_triangle_edgecorner, kLoop ) );
g_shapes.push_back( shaperec("loop_triangle_edgeonly", loop_triangle_edgeonly, kLoop ) );
g_shapes.push_back( shaperec("loop_chaikin0", loop_chaikin0, kLoop ) );
g_shapes.push_back( shaperec("loop_chaikin1", loop_chaikin1, kLoop ) );
g_shapes.push_back( ShapeDesc("bilinear_cube", bilinear_cube, kBilinear) );
g_shapes.push_back( ShapeDesc("catmark_chaikin0", catmark_chaikin0, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_chaikin1", catmark_chaikin1, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_cube_corner0", catmark_cube_corner0, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_cube_corner1", catmark_cube_corner1, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_cube_corner2", catmark_cube_corner2, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_cube_corner3", catmark_cube_corner3, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_cube_corner4", catmark_cube_corner4, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_cube_creases0", catmark_cube_creases0, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_cube_creases1", catmark_cube_creases1, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_cube", catmark_cube, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_dart_edgecorner", catmark_dart_edgecorner, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_dart_edgeonly", catmark_dart_edgeonly, kCatmark ) );
// g_shapes.push_back( ShapeDesc("catmark_edgecorner", catmark_edgecorner, kCatmark ) );
// g_shapes.push_back( ShapeDesc("catmark_edgeonly", catmark_edgeonly, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_flap", catmark_flap, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_flap2", catmark_flap2, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_pyramid_creases0", catmark_pyramid_creases0, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_pyramid_creases1", catmark_pyramid_creases1, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_pyramid", catmark_pyramid, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_square_hedit0", catmark_square_hedit0, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_square_hedit1", catmark_square_hedit1, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_square_hedit2", catmark_square_hedit2, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_square_hedit3", catmark_square_hedit3, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_tent_creases0", catmark_tent_creases0, kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_tent_creases1", catmark_tent_creases1 , kCatmark ) );
g_shapes.push_back( ShapeDesc("catmark_tent", catmark_tent, kCatmark ) );
g_shapes.push_back( ShapeDesc("loop_cube_creases0", loop_cube_creases0, kLoop ) );
g_shapes.push_back( ShapeDesc("loop_cube_creases1", loop_cube_creases1, kLoop ) );
// g_shapes.push_back( ShapeDesc("loop_cube", loop_cube, kLoop ) );
g_shapes.push_back( ShapeDesc("loop_icosahedron", loop_icosahedron, kLoop ) );
g_shapes.push_back( ShapeDesc("loop_saddle_edgecorner", loop_saddle_edgecorner, kLoop ) );
g_shapes.push_back( ShapeDesc("loop_saddle_edgeonly", loop_saddle_edgeonly, kLoop ) );
// g_shapes.push_back( ShapeDesc("loop_triangle_edgecorner", loop_triangle_edgecorner, kLoop ) );
// g_shapes.push_back( ShapeDesc("loop_triangle_edgeonly", loop_triangle_edgeonly, kLoop ) );
g_shapes.push_back( ShapeDesc("loop_chaikin0", loop_chaikin0, kLoop ) );
g_shapes.push_back( ShapeDesc("loop_chaikin1", loop_chaikin1, kLoop ) );
}
//------------------------------------------------------------------------------

View File

@ -129,7 +129,7 @@ static Shape * readShape( char const * fname, Scheme scheme ) {
shapeStr[size]='\0';
return Shape::parseObj( shapeStr, scheme, false /*isLeftHanded*/, 1 );
return Shape::parseObj( shapeStr, scheme );
}
#define STR(x) x
@ -179,7 +179,7 @@ static void writeObj( const char * fname, xyzmesh const * mesh,
}
//------------------------------------------------------------------------------
static int checkMesh( shaperec const & r, int levels ) {
static int checkMesh( ShapeDesc const & r, int levels ) {
int count=0;