Skip to content

Commit

Permalink
remove virtual
Browse files Browse the repository at this point in the history
  • Loading branch information
alexchicn committed Mar 30, 2018
1 parent c017fe5 commit 659742a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 38 deletions.
72 changes: 36 additions & 36 deletions include/libgltf/libgltf.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#define LIBGLTF_MAJOR_VERSION 0
#define LIBGLTF_MINOR_VERSION 1
#define LIBGLTF_PATCH_VERSION 1
#define LIBGLTF_PATCH_VERSION 2

#if defined(UNICODE)
typedef std::wstring GLTFString;
Expand All @@ -35,7 +35,7 @@ namespace libgltf
SGlTFProperty();

// Check valid
virtual operator bool() const;
operator bool() const;

std::shared_ptr<struct SExtras> extras;
std::shared_ptr<struct SExtension> extensions;
Expand All @@ -49,7 +49,7 @@ namespace libgltf
SGlTFChildofRootProperty();

// Check valid
virtual operator bool() const;
operator bool() const;

// The user-defined name of this object.
GLTFString name;
Expand All @@ -64,7 +64,7 @@ namespace libgltf
SMaterial();

// Check valid
virtual operator bool() const;
operator bool() const;

// The alpha cutoff value of the material.
float alphaCutoff;
Expand Down Expand Up @@ -93,7 +93,7 @@ namespace libgltf
SAsset();

// Check valid
virtual operator bool() const;
operator bool() const;

// The minimum glTF version that this asset targets.
GLTFString minVersion;
Expand All @@ -114,7 +114,7 @@ namespace libgltf
SSampler();

// Check valid
virtual operator bool() const;
operator bool() const;

// s wrapping mode.
int32_t wrapS;
Expand All @@ -135,7 +135,7 @@ namespace libgltf
SAnimationSampler();

// Check valid
virtual operator bool() const;
operator bool() const;

// The index of an accessor containing keyframe input values, e.g., time.
std::shared_ptr<struct SGlTFId> input;
Expand All @@ -154,7 +154,7 @@ namespace libgltf
SExtras();

// Check valid
virtual operator bool() const;
operator bool() const;
};

/*!
Expand All @@ -166,7 +166,7 @@ namespace libgltf
SScene();

// Check valid
virtual operator bool() const;
operator bool() const;

// The indices of each root node.
std::vector<std::shared_ptr<struct SGlTFId>> nodes;
Expand All @@ -181,7 +181,7 @@ namespace libgltf
SCameraPerspective();

// Check valid
virtual operator bool() const;
operator bool() const;

// The floating-point aspect ratio of the field of view.
float aspectRatio;
Expand All @@ -202,7 +202,7 @@ namespace libgltf
SBufferView();

// Check valid
virtual operator bool() const;
operator bool() const;

// The length of the bufferView in bytes.
int32_t byteLength;
Expand All @@ -225,7 +225,7 @@ namespace libgltf
STextureInfo();

// Check valid
virtual operator bool() const;
operator bool() const;

// The index of the texture.
std::shared_ptr<struct SGlTFId> index;
Expand All @@ -241,7 +241,7 @@ namespace libgltf
SMaterialNormalTextureInfo();

// Check valid
virtual operator bool() const;
operator bool() const;

// The scalar multiplier applied to each normal vector of the normal texture.
float scale;
Expand All @@ -255,7 +255,7 @@ namespace libgltf
SMaterialOcclusionTextureInfo();

// Check valid
virtual operator bool() const;
operator bool() const;

// A scalar multiplier controlling the amount of occlusion applied.
float strength;
Expand All @@ -270,7 +270,7 @@ namespace libgltf
SAccessorSparseValues();

// Check valid
virtual operator bool() const;
operator bool() const;

// The index of the bufferView with sparse values. Referenced bufferView can't have ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target.
std::shared_ptr<struct SGlTFId> bufferView;
Expand All @@ -287,7 +287,7 @@ namespace libgltf
SAnimationChannelTarget();

// Check valid
virtual operator bool() const;
operator bool() const;

// The index of the node to target.
std::shared_ptr<struct SGlTFId> node;
Expand All @@ -304,7 +304,7 @@ namespace libgltf
SMesh();

// Check valid
virtual operator bool() const;
operator bool() const;

// An array of primitives, each defining geometry to be rendered with a material.
std::vector<std::shared_ptr<struct SMeshPrimitive>> primitives;
Expand All @@ -321,7 +321,7 @@ namespace libgltf
SAccessorSparse();

// Check valid
virtual operator bool() const;
operator bool() const;

// Number of entries stored in the sparse array.
int32_t count;
Expand All @@ -340,7 +340,7 @@ namespace libgltf
SMeshPrimitive();

// Check valid
virtual operator bool() const;
operator bool() const;

// The index of the accessor that contains the indices.
std::shared_ptr<struct SGlTFId> indices;
Expand All @@ -363,7 +363,7 @@ namespace libgltf
SKHR_materials_pbrSpecularGlossinessglTFextension();

// Check valid
virtual operator bool() const;
operator bool() const;

// The specular RGB color of the material.
std::vector<float> specularFactor;
Expand All @@ -386,7 +386,7 @@ namespace libgltf
SExtension();

// Check valid
virtual operator bool() const;
operator bool() const;

// Manual code lines
std::map<GLTFString, std::shared_ptr<struct SObject>> properties;
Expand All @@ -401,7 +401,7 @@ namespace libgltf
SAnimationChannel();

// Check valid
virtual operator bool() const;
operator bool() const;

// The index of the node and TRS property to target.
std::shared_ptr<struct SAnimationChannelTarget> target;
Expand All @@ -417,7 +417,7 @@ namespace libgltf
SGlTFId();

// Check valid
virtual operator bool() const;
operator bool() const;

operator int32_t() const;

Expand All @@ -433,7 +433,7 @@ namespace libgltf
SAccessorSparseIndices();

// Check valid
virtual operator bool() const;
operator bool() const;

// The indices data type.
int32_t componentType;
Expand All @@ -452,7 +452,7 @@ namespace libgltf
SNode();

// Check valid
virtual operator bool() const;
operator bool() const;

// The node's non-uniform scale, given as the scaling factors along the x, y, and z axes.
std::vector<float> scale;
Expand Down Expand Up @@ -483,7 +483,7 @@ namespace libgltf
SAnimation();

// Check valid
virtual operator bool() const;
operator bool() const;

// An array of channels, each of which targets an animation's sampler at a node's property. Different channels of the same animation can't have equal targets.
std::vector<std::shared_ptr<struct SAnimationChannel>> channels;
Expand All @@ -500,7 +500,7 @@ namespace libgltf
SSkin();

// Check valid
virtual operator bool() const;
operator bool() const;

// Indices of skeleton nodes, used as joints in this skin.
std::vector<std::shared_ptr<struct SGlTFId>> joints;
Expand All @@ -519,7 +519,7 @@ namespace libgltf
SMaterialPBRMetallicRoughness();

// Check valid
virtual operator bool() const;
operator bool() const;

// The roughness of the material.
float roughnessFactor;
Expand All @@ -541,7 +541,7 @@ namespace libgltf
SKHR_draco_mesh_compressionextension();

// Check valid
virtual operator bool() const;
operator bool() const;

// A dictionary object, where each key corresponds to an attribute and its unique attribute id stored in the compressed geometry.
std::map<GLTFString, std::shared_ptr<struct SGlTFId>> attributes;
Expand All @@ -558,7 +558,7 @@ namespace libgltf
SCamera();

// Check valid
virtual operator bool() const;
operator bool() const;

// Specifies if the camera uses a perspective or orthographic projection.
GLTFString type;
Expand All @@ -577,7 +577,7 @@ namespace libgltf
SImage();

// Check valid
virtual operator bool() const;
operator bool() const;

// The image's MIME type.
GLTFString mimeType;
Expand All @@ -596,7 +596,7 @@ namespace libgltf
STexture();

// Check valid
virtual operator bool() const;
operator bool() const;

// The index of the image used by this texture.
std::shared_ptr<struct SGlTFId> source;
Expand All @@ -613,7 +613,7 @@ namespace libgltf
SCameraOrthographic();

// Check valid
virtual operator bool() const;
operator bool() const;

// The floating-point horizontal magnification of the view. Must not be zero.
float xmag;
Expand All @@ -634,7 +634,7 @@ namespace libgltf
SBuffer();

// Check valid
virtual operator bool() const;
operator bool() const;

// The length of the buffer in bytes.
int32_t byteLength;
Expand All @@ -651,7 +651,7 @@ namespace libgltf
SAccessor();

// Check valid
virtual operator bool() const;
operator bool() const;

// The number of attributes referenced by this accessor.
int32_t count;
Expand Down Expand Up @@ -682,7 +682,7 @@ namespace libgltf
SGlTF();

// Check valid
virtual operator bool() const;
operator bool() const;

// An array of textures.
std::vector<std::shared_ptr<struct STexture>> textures;
Expand Down
2 changes: 1 addition & 1 deletion tools/batch/glTF_2.0_schema.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extensions_schema_directories=
%(CD)s/../../external/glTF/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/schema
major_version=0
minor_version=1
patch_version=1
patch_version=2

[code.headers]
extension.schema.json=%(CD)s/codes/extension.schema.json.h
Expand Down
2 changes: 1 addition & 1 deletion tools/jsonschematoc11/c11types/c11typestruct.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def codeHeader(self, codeTypeNames):
codeLines.append(u' %s();' % self.codeTypeName())
codeLines.append(u'')
codeLines.append(u' // Check valid')
codeLines.append(u' virtual operator bool() const;')
codeLines.append(u' operator bool() const;')

if self.c11Type != None:
codeLines.append(u'')
Expand Down

0 comments on commit 659742a

Please sign in to comment.