file_path
stringlengths 21
202
| content
stringlengths 13
1.02M
| size
int64 13
1.02M
| lang
stringclasses 9
values | avg_line_length
float64 5.43
98.5
| max_line_length
int64 12
993
| alphanum_fraction
float64 0.27
0.91
|
---|---|---|---|---|---|---|
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/SetDefaultTokenResult.h | #pragma once
#include <string>
namespace cesium::omniverse {
enum SetDefaultTokenResultCode {
NOT_SET_IN_SESSION = -1,
OK = 0,
NOT_CONNECTED_TO_ION = 1,
CREATE_FAILED = 2,
};
namespace SetDefaultTokenResultMessages {
inline const std::string_view NOT_SET_IN_SESSION_MESSAGE = "Default token has not been set this session.";
inline const std::string_view OK_MESSAGE = "OK";
inline const std::string_view NOT_CONNECTED_TO_ION_MESSAGE = "Not connected to ion.";
inline const std::string_view CREATE_FAILED_MESSAGE_BASE = "Create failed: {1} ({2})";
} // namespace SetDefaultTokenResultMessages
/**
* Stores information about the last action to set the default token. A code and a relevant user
* friendly message are stored.
*/
struct SetDefaultTokenResult {
int code{SetDefaultTokenResultCode::NOT_SET_IN_SESSION};
std::string message{SetDefaultTokenResultMessages::NOT_SET_IN_SESSION_MESSAGE};
};
} // namespace cesium::omniverse
| 961 | C | 31.066666 | 106 | 0.738814 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricUtil.h | #pragma once
#include <glm/fwd.hpp>
#include <pxr/usd/usd/common.h>
#include <string>
namespace omni::fabric {
class StageReaderWriter;
class Path;
class Token;
struct Type;
} // namespace omni::fabric
namespace cesium::omniverse {
enum class DataType;
enum class MdlExternalPropertyType;
enum class MdlInternalPropertyType;
struct FabricStatistics;
} // namespace cesium::omniverse
namespace cesium::omniverse::FabricUtil {
// -1 means the prim is not associated with a tileset yet
const int64_t NO_TILESET_ID{-1};
std::string printFabricStage(omni::fabric::StageReaderWriter& fabricStage);
FabricStatistics getStatistics(omni::fabric::StageReaderWriter& fabricStage);
void destroyPrim(omni::fabric::StageReaderWriter& fabricStage, const omni::fabric::Path& path);
void setTilesetTransform(
omni::fabric::StageReaderWriter& fabricStage,
int64_t tilesetId,
const glm::dmat4& ecefToPrimWorldTransform);
omni::fabric::Path toFabricPath(const pxr::SdfPath& path);
omni::fabric::Token toFabricToken(const pxr::TfToken& token);
omni::fabric::Path joinPaths(const omni::fabric::Path& absolutePath, const omni::fabric::Token& relativePath);
omni::fabric::Path getCopiedShaderPath(const omni::fabric::Path& materialPath, const omni::fabric::Path& shaderPath);
std::vector<omni::fabric::Path> copyMaterial(
omni::fabric::StageReaderWriter& fabricStage,
const omni::fabric::Path& srcMaterialPath,
const omni::fabric::Path& dstMaterialPath);
bool materialHasCesiumNodes(omni::fabric::StageReaderWriter& fabricStage, const omni::fabric::Path& materialPath);
bool isCesiumNode(const omni::fabric::Token& mdlIdentifier);
bool isCesiumPropertyNode(const omni::fabric::Token& mdlIdentifier);
bool isShaderConnectedToMaterial(
omni::fabric::StageReaderWriter& fabricStage,
const omni::fabric::Path& materialPath,
const omni::fabric::Path& shaderPath);
omni::fabric::Token getMdlIdentifier(omni::fabric::StageReaderWriter& fabricStage, const omni::fabric::Path& path);
omni::fabric::Type getPrimvarType(DataType type);
MdlExternalPropertyType getMdlExternalPropertyType(const omni::fabric::Token& mdlIdentifier);
bool typesCompatible(MdlExternalPropertyType externalType, MdlInternalPropertyType internalType);
} // namespace cesium::omniverse::FabricUtil
| 2,284 | C | 39.087719 | 117 | 0.788529 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FilesystemUtil.h | #pragma once
#include <filesystem>
namespace cesium::omniverse::FilesystemUtil {
std::filesystem::path getCesiumCacheDirectory();
std::filesystem::path getUserHomeDirectory();
} // namespace cesium::omniverse::FilesystemUtil
| 227 | C | 24.333331 | 48 | 0.792952 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/UsdTokens.h | #pragma once
#include <omni/fabric/FabricUSD.h>
#include <pxr/base/tf/staticTokens.h>
// clang-format off
PXR_NAMESPACE_OPEN_SCOPE
#ifdef CESIUM_OMNI_MSVC
__pragma(warning(push)) __pragma(warning(disable : 4003))
#endif
// Note: variable names should match the USD token names as closely as possible, with special characters converted to underscores
#define USD_TOKENS \
(base_color_texture) \
(cesium_base_color_texture_float4) \
(cesium_feature_id_int) \
(cesium_raster_overlay_float4) \
(cesium_internal_clipping_raster_overlay_resolver) \
(cesium_internal_feature_id_attribute_lookup) \
(cesium_internal_feature_id_texture_lookup) \
(cesium_internal_raster_overlay_lookup) \
(cesium_internal_raster_overlay_resolver) \
(cesium_internal_material) \
(cesium_internal_property_attribute_float_lookup) \
(cesium_internal_property_attribute_float2_lookup) \
(cesium_internal_property_attribute_float3_lookup) \
(cesium_internal_property_attribute_float4_lookup) \
(cesium_internal_property_attribute_int_lookup) \
(cesium_internal_property_attribute_int2_lookup) \
(cesium_internal_property_attribute_int3_lookup) \
(cesium_internal_property_attribute_int4_lookup) \
(cesium_internal_property_attribute_normalized_int_lookup) \
(cesium_internal_property_attribute_normalized_int2_lookup) \
(cesium_internal_property_attribute_normalized_int3_lookup) \
(cesium_internal_property_attribute_normalized_int4_lookup) \
(cesium_internal_property_table_float_lookup) \
(cesium_internal_property_table_float2_lookup) \
(cesium_internal_property_table_float3_lookup) \
(cesium_internal_property_table_float4_lookup) \
(cesium_internal_property_table_int_lookup) \
(cesium_internal_property_table_int2_lookup) \
(cesium_internal_property_table_int3_lookup) \
(cesium_internal_property_table_int4_lookup) \
(cesium_internal_property_table_normalized_int_lookup) \
(cesium_internal_property_table_normalized_int2_lookup) \
(cesium_internal_property_table_normalized_int3_lookup) \
(cesium_internal_property_table_normalized_int4_lookup) \
(cesium_internal_property_texture_int_lookup) \
(cesium_internal_property_texture_int2_lookup) \
(cesium_internal_property_texture_int3_lookup) \
(cesium_internal_property_texture_int4_lookup) \
(cesium_internal_property_texture_normalized_int_lookup) \
(cesium_internal_property_texture_normalized_int2_lookup) \
(cesium_internal_property_texture_normalized_int3_lookup) \
(cesium_internal_property_texture_normalized_int4_lookup) \
(cesium_internal_texture_lookup) \
(cesium_property_float) \
(cesium_property_float2) \
(cesium_property_float3) \
(cesium_property_float4) \
(cesium_property_int) \
(cesium_property_int2) \
(cesium_property_int3) \
(cesium_property_int4) \
(clipping_raster_overlay_resolver) \
(doubleSided) \
(extent) \
(faceVertexCounts) \
(faceVertexIndices) \
(raster_overlay) \
(raster_overlay_resolver) \
(Material) \
(Mesh) \
(none) \
(points) \
(primvarInterpolations) \
(primvars) \
(Shader) \
(sourceAsset) \
(subdivisionScheme) \
(vertex) \
(vertexId) \
(_cesium_gltfLocalToEcefTransform) \
(_cesium_tilesetId) \
(_deletedPrims) \
(_materialSource) \
(_paramColorSpace) \
(_sdrMetadata) \
(_worldExtent) \
(_worldOrientation) \
(_worldPosition) \
(_worldScale) \
(_worldVisibility) \
((info_implementationSource, "info:implementationSource")) \
((info_mdl_sourceAsset, "info:mdl:sourceAsset")) \
((info_mdl_sourceAsset_subIdentifier, "info:mdl:sourceAsset:subIdentifier")) \
((inputs_alpha, "inputs:alpha")) \
((inputs_alpha_clip, "inputs:alpha_clip")) \
((inputs_alpha_cutoff, "inputs:alpha_cutoff")) \
((inputs_alpha_mode, "inputs:alpha_mode")) \
((inputs_base_alpha, "inputs:base_alpha")) \
((inputs_base_color_factor, "inputs:base_color_factor")) \
((inputs_base_color_texture, "inputs:base_color_texture")) \
((inputs_channels, "inputs:channels")) \
((inputs_channel_count, "inputs:channel_count")) \
((inputs_default_value, "inputs:default_value")) \
((inputs_emissive_factor, "inputs:emissive_factor")) \
((inputs_excludeFromWhiteMode, "inputs:excludeFromWhiteMode")) \
((inputs_feature_id, "inputs:feature_id")) \
((inputs_feature_id_set_index, "inputs:feature_id_set_index")) \
((inputs_has_no_data, "inputs:has_no_data")) \
((inputs_raster_overlay, "inputs:raster_overlay")) \
((inputs_raster_overlay_count, "inputs:raster_overlay_count")) \
((inputs_raster_overlay_index, "inputs:raster_overlay_index")) \
((inputs_maximum_value, "inputs:maximum_value")) \
((inputs_metallic_factor, "inputs:metallic_factor")) \
((inputs_no_data, "inputs:no_data")) \
((inputs_null_feature_id, "inputs:null_feature_id")) \
((inputs_offset, "inputs:offset")) \
((inputs_primvar_name, "inputs:primvar_name")) \
((inputs_property_id, "inputs:property_id")) \
((inputs_property_table_texture, "inputs:property_table_texture")) \
((inputs_property_value, "inputs:property_value")) \
((inputs_roughness_factor, "inputs:roughness_factor")) \
((inputs_scale, "inputs:scale")) \
((inputs_texture, "inputs:texture")) \
((inputs_tex_coord_index, "inputs:tex_coord_index")) \
((inputs_tex_coord_offset, "inputs:tex_coord_offset")) \
((inputs_tex_coord_rotation, "inputs:tex_coord_rotation")) \
((inputs_tex_coord_scale, "inputs:tex_coord_scale")) \
((inputs_tile_color, "inputs:tile_color")) \
((inputs_wrap_s, "inputs:wrap_s")) \
((inputs_wrap_t, "inputs:wrap_t")) \
((material_binding, "material:binding")) \
((outputs_mdl_displacement, "outputs:mdl:displacement")) \
((outputs_mdl_surface, "outputs:mdl:surface")) \
((outputs_mdl_volume, "outputs:mdl:volume")) \
((outputs_out, "outputs:out")) \
((primvars_COLOR_0, "primvars:COLOR_0")) \
((primvars_displayColor, "primvars:displayColor")) \
((primvars_displayOpacity, "primvars:displayOpacity")) \
((primvars_normals, "primvars:normals")) \
((primvars_vertexId, "primvars:vertexId")) \
((xformOp_orient, "xformOp:orient")) \
((xformOp_rotateXYZ, "xformOp:rotateXYZ")) \
((xformOp_rotateXZY, "xformOp:rotateXZY")) \
((xformOp_rotateYXZ, "xformOp:rotateYXZ")) \
((xformOp_rotateYZX, "xformOp:rotateYZX")) \
((xformOp_rotateZXY, "xformOp:rotateZXY")) \
((xformOp_rotateZYX, "xformOp:rotateZYX")) \
((xformOp_scale, "xformOp:scale")) \
((xformOp_translate, "xformOp:translate")) \
((_auto, "auto"))
#ifdef CESIUM_OMNI_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
TF_DECLARE_PUBLIC_TOKENS(UsdTokens, USD_TOKENS);
#ifdef CESIUM_OMNI_CLANG
#pragma clang diagnostic pop
#endif
#define FABRIC_DEFINE_TOKEN_ELEM(elem) const omni::fabric::TokenC elem = omni::fabric::asInt(pxr::UsdTokens->elem);
#define FABRIC_DEFINE_TOKEN(r, data, elem) \
BOOST_PP_TUPLE_ELEM(1, 0, BOOST_PP_IIF(TF_PP_IS_TUPLE(elem), \
(FABRIC_DEFINE_TOKEN_ELEM(BOOST_PP_TUPLE_ELEM(2, 0, elem))), \
(FABRIC_DEFINE_TOKEN_ELEM(elem))))
#define FABRIC_DEFINE_TOKENS(seq) BOOST_PP_SEQ_FOR_EACH(FABRIC_DEFINE_TOKEN, ~, seq)
#define FABRIC_DECLARE_TOKEN_ELEM(elem) extern const omni::fabric::TokenC elem;
#define FABRIC_DECLARE_TOKEN(r, data, elem) \
BOOST_PP_TUPLE_ELEM(1, 0, BOOST_PP_IIF(TF_PP_IS_TUPLE(elem), \
(FABRIC_DECLARE_TOKEN_ELEM(BOOST_PP_TUPLE_ELEM(2, 0, elem))), \
(FABRIC_DECLARE_TOKEN_ELEM(elem))))
#define FABRIC_DECLARE_TOKENS(seq) BOOST_PP_SEQ_FOR_EACH(FABRIC_DECLARE_TOKEN, ~, seq)
#ifdef CESIUM_OMNI_MSVC
__pragma(warning(pop))
#endif
PXR_NAMESPACE_CLOSE_SCOPE
namespace cesium::omniverse::FabricTokens {
FABRIC_DECLARE_TOKENS(USD_TOKENS);
const omni::fabric::TokenC feature_id_n(uint64_t index);
const omni::fabric::TokenC raster_overlay_n(uint64_t index);
const omni::fabric::TokenC inputs_raster_overlay_n(uint64_t index);
const omni::fabric::TokenC primvars_st_n(uint64_t index);
const omni::fabric::TokenC property_n(uint64_t index);
}
namespace cesium::omniverse::FabricTypes {
// Due to legacy support the eRelationship type is defined as a scalar value but is secretly an array
const omni::fabric::Type doubleSided(omni::fabric::BaseDataType::eBool, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type extent(omni::fabric::BaseDataType::eDouble, 6, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type faceVertexCounts(omni::fabric::BaseDataType::eInt, 1, 1, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type faceVertexIndices(omni::fabric::BaseDataType::eInt, 1, 1, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type info_implementationSource(omni::fabric::BaseDataType::eToken, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type info_mdl_sourceAsset(omni::fabric::BaseDataType::eAsset, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type info_mdl_sourceAsset_subIdentifier(omni::fabric::BaseDataType::eToken, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_alpha(omni::fabric::BaseDataType::eFloat, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_alpha_cutoff(omni::fabric::BaseDataType::eFloat, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_alpha_mode(omni::fabric::BaseDataType::eInt, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_base_alpha(omni::fabric::BaseDataType::eFloat, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_base_color_factor(omni::fabric::BaseDataType::eFloat, 3, 0, omni::fabric::AttributeRole::eColor);
const omni::fabric::Type inputs_channels(omni::fabric::BaseDataType::eInt, 4, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_channel_count(omni::fabric::BaseDataType::eInt, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_default_value_float(omni::fabric::BaseDataType::eFloat, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_default_value_float2(omni::fabric::BaseDataType::eFloat, 2, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_default_value_float3(omni::fabric::BaseDataType::eFloat, 3, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_default_value_float4(omni::fabric::BaseDataType::eFloat, 4, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_default_value_int(omni::fabric::BaseDataType::eInt, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_default_value_int2(omni::fabric::BaseDataType::eInt, 2, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_default_value_int3(omni::fabric::BaseDataType::eInt, 3, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_default_value_int4(omni::fabric::BaseDataType::eInt, 4, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_emissive_factor(omni::fabric::BaseDataType::eFloat, 3, 0, omni::fabric::AttributeRole::eColor);
const omni::fabric::Type inputs_excludeFromWhiteMode(omni::fabric::BaseDataType::eBool, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_has_no_data(omni::fabric::BaseDataType::eBool, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_raster_overlay_count(omni::fabric::BaseDataType::eInt, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_maximum_value_int(omni::fabric::BaseDataType::eInt, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_maximum_value_int2(omni::fabric::BaseDataType::eInt, 2, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_maximum_value_int3(omni::fabric::BaseDataType::eInt, 3, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_maximum_value_int4(omni::fabric::BaseDataType::eInt, 4, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_metallic_factor(omni::fabric::BaseDataType::eFloat, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_no_data_float(omni::fabric::BaseDataType::eFloat, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_no_data_float2(omni::fabric::BaseDataType::eFloat, 2, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_no_data_float3(omni::fabric::BaseDataType::eFloat, 3, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_no_data_float4(omni::fabric::BaseDataType::eFloat, 4, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_no_data_int(omni::fabric::BaseDataType::eInt, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_no_data_int2(omni::fabric::BaseDataType::eInt, 2, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_no_data_int3(omni::fabric::BaseDataType::eInt, 3, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_no_data_int4(omni::fabric::BaseDataType::eInt, 4, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_null_feature_id(omni::fabric::BaseDataType::eInt, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_offset_float(omni::fabric::BaseDataType::eFloat, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_offset_float2(omni::fabric::BaseDataType::eFloat, 2, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_offset_float3(omni::fabric::BaseDataType::eFloat, 3, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_offset_float4(omni::fabric::BaseDataType::eFloat, 4, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_primvar_name(omni::fabric::BaseDataType::eUChar, 1, 1, omni::fabric::AttributeRole::eText);
const omni::fabric::Type inputs_property_table_texture(omni::fabric::BaseDataType::eAsset, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_roughness_factor(omni::fabric::BaseDataType::eFloat, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_scale_float(omni::fabric::BaseDataType::eFloat, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_scale_float2(omni::fabric::BaseDataType::eFloat, 2, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_scale_float3(omni::fabric::BaseDataType::eFloat, 3, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_scale_float4(omni::fabric::BaseDataType::eFloat, 4, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_texture(omni::fabric::BaseDataType::eAsset, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_tex_coord_index(omni::fabric::BaseDataType::eInt, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_tex_coord_offset(omni::fabric::BaseDataType::eFloat, 2, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_tex_coord_rotation(omni::fabric::BaseDataType::eFloat, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_tex_coord_scale(omni::fabric::BaseDataType::eFloat, 2, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_tile_color(omni::fabric::BaseDataType::eFloat, 4, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_wrap_s(omni::fabric::BaseDataType::eInt, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type inputs_wrap_t(omni::fabric::BaseDataType::eInt, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type Material(omni::fabric::BaseDataType::eTag, 1, 0, omni::fabric::AttributeRole::ePrimTypeName);
const omni::fabric::Type material_binding(omni::fabric::BaseDataType::eRelationship, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type Mesh(omni::fabric::BaseDataType::eTag, 1, 0, omni::fabric::AttributeRole::ePrimTypeName);
const omni::fabric::Type outputs_out(omni::fabric::BaseDataType::eToken, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type points(omni::fabric::BaseDataType::eFloat, 3, 1, omni::fabric::AttributeRole::ePosition);
const omni::fabric::Type primvarInterpolations(omni::fabric::BaseDataType::eToken, 1, 1, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type primvars(omni::fabric::BaseDataType::eToken, 1, 1, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type primvars_COLOR_0(omni::fabric::BaseDataType::eFloat, 4, 1, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type primvars_normals(omni::fabric::BaseDataType::eFloat, 3, 1, omni::fabric::AttributeRole::eNormal);
const omni::fabric::Type primvars_st(omni::fabric::BaseDataType::eFloat, 2, 1, omni::fabric::AttributeRole::eTexCoord);
const omni::fabric::Type primvars_vertexId(omni::fabric::BaseDataType::eFloat, 1, 1, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type Shader(omni::fabric::BaseDataType::eTag, 1, 0, omni::fabric::AttributeRole::ePrimTypeName);
const omni::fabric::Type subdivisionScheme(omni::fabric::BaseDataType::eToken, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type _cesium_gltfLocalToEcefTransform(omni::fabric::BaseDataType::eDouble, 16, 0, omni::fabric::AttributeRole::eMatrix);
const omni::fabric::Type _cesium_tilesetId(omni::fabric::BaseDataType::eInt64, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type _materialSource(omni::fabric::BaseDataType::eRelationship, 1, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type _paramColorSpace(omni::fabric::BaseDataType::eToken, 1, 1, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type _sdrMetadata(omni::fabric::BaseDataType::eToken, 1, 1, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type _worldExtent(omni::fabric::BaseDataType::eDouble, 6, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type _worldOrientation(omni::fabric::BaseDataType::eFloat, 4, 0, omni::fabric::AttributeRole::eQuaternion);
const omni::fabric::Type _worldPosition(omni::fabric::BaseDataType::eDouble, 3, 0, omni::fabric::AttributeRole::eNone);
const omni::fabric::Type _worldScale(omni::fabric::BaseDataType::eFloat, 3, 0, omni::fabric::AttributeRole::eVector);
const omni::fabric::Type _worldVisibility(omni::fabric::BaseDataType::eBool, 1, 0, omni::fabric::AttributeRole::eNone);
}
// clang-format on
| 18,626 | C | 63.453287 | 140 | 0.727102 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/CesiumIonServerManager.h | #pragma once
#include "cesium/omniverse/AssetTroubleshootingDetails.h"
#include "cesium/omniverse/SetDefaultTokenResult.h"
#include "cesium/omniverse/TokenTroubleshootingDetails.h"
#include <pxr/usd/sdf/path.h>
#include <memory>
namespace CesiumIonClient {
struct Token;
}
namespace cesium::omniverse {
class CesiumIonSession;
class Context;
class OmniIonServer;
class CesiumIonServerManager {
public:
CesiumIonServerManager(Context* pContext);
~CesiumIonServerManager() = default;
CesiumIonServerManager(const CesiumIonServerManager&) = delete;
CesiumIonServerManager& operator=(const CesiumIonServerManager&) = delete;
CesiumIonServerManager(CesiumIonServerManager&&) noexcept = delete;
CesiumIonServerManager& operator=(CesiumIonServerManager&&) noexcept = delete;
void onUpdateFrame();
void setProjectDefaultToken(const CesiumIonClient::Token& token);
void connectToIon();
[[nodiscard]] OmniIonServer* getCurrentIonServer() const;
[[nodiscard]] std::shared_ptr<CesiumIonSession> getCurrentIonSession() const;
[[nodiscard]] std::optional<CesiumIonClient::Token> getDefaultToken() const;
[[nodiscard]] SetDefaultTokenResult getSetDefaultTokenResult() const;
[[nodiscard]] bool isDefaultTokenSet() const;
void createToken(const std::string& name);
void selectToken(const CesiumIonClient::Token& token);
void specifyToken(const std::string& token);
[[nodiscard]] std::optional<AssetTroubleshootingDetails> getAssetTroubleshootingDetails() const;
[[nodiscard]] std::optional<TokenTroubleshootingDetails> getAssetTokenTroubleshootingDetails() const;
[[nodiscard]] std::optional<TokenTroubleshootingDetails> getDefaultTokenTroubleshootingDetails() const;
void updateTroubleshootingDetails(
const pxr::SdfPath& tilesetPath,
int64_t tilesetIonAssetId,
uint64_t tokenEventId,
uint64_t assetEventId);
void updateTroubleshootingDetails(
const pxr::SdfPath& tilesetPath,
[[maybe_unused]] int64_t tilesetIonAssetId,
int64_t rasterOverlayIonAssetId,
uint64_t tokenEventId,
uint64_t assetEventId);
void updateTokenTroubleshootingDetails(
int64_t assetId,
const std::string& token,
uint64_t eventId,
TokenTroubleshootingDetails& details);
void updateAssetTroubleshootingDetails(int64_t assetId, uint64_t eventId, AssetTroubleshootingDetails& details);
private:
Context* _pContext;
SetDefaultTokenResult _lastSetTokenResult;
std::optional<AssetTroubleshootingDetails> _assetTroubleshootingDetails;
std::optional<TokenTroubleshootingDetails> _assetTokenTroubleshootingDetails;
std::optional<TokenTroubleshootingDetails> _defaultTokenTroubleshootingDetails;
};
} // namespace cesium::omniverse
| 2,814 | C | 37.561643 | 116 | 0.762615 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricStatistics.h | #pragma once
#include <cstdint>
namespace cesium::omniverse {
struct FabricStatistics {
uint64_t materialsCapacity{0};
uint64_t materialsLoaded{0};
uint64_t geometriesCapacity{0};
uint64_t geometriesLoaded{0};
uint64_t geometriesRendered{0};
uint64_t trianglesLoaded{0};
uint64_t trianglesRendered{0};
};
} // namespace cesium::omniverse
| 370 | C | 19.61111 | 35 | 0.718919 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniRasterOverlay.h | #pragma once
#include "cesium/omniverse/OmniTileset.h"
#include <CesiumRasterOverlays/RasterOverlay.h>
#include <pxr/usd/sdf/path.h>
namespace CesiumRasterOverlays {
class RasterOverlay;
}
namespace cesium::omniverse {
class Context;
class OmniTileset;
enum class FabricOverlayRenderMethod;
class OmniRasterOverlay {
friend void OmniTileset::addRasterOverlayIfExists(const OmniRasterOverlay* pOverlay);
friend pxr::SdfPath
OmniTileset::getRasterOverlayPathIfExists(const CesiumRasterOverlays::RasterOverlay& rasterOverlay);
public:
OmniRasterOverlay(Context* pContext, const pxr::SdfPath& path);
virtual ~OmniRasterOverlay() = default;
OmniRasterOverlay(const OmniRasterOverlay&) = delete;
OmniRasterOverlay& operator=(const OmniRasterOverlay&) = delete;
OmniRasterOverlay(OmniRasterOverlay&&) noexcept = default;
OmniRasterOverlay& operator=(OmniRasterOverlay&&) noexcept = default;
[[nodiscard]] const pxr::SdfPath& getPath() const;
[[nodiscard]] bool getShowCreditsOnScreen() const;
[[nodiscard]] double getAlpha() const;
[[nodiscard]] FabricOverlayRenderMethod getOverlayRenderMethod() const;
[[nodiscard]] float getMaximumScreenSpaceError() const;
[[nodiscard]] int getMaximumTextureSize() const;
[[nodiscard]] int getMaximumSimultaneousTileLoads() const;
[[nodiscard]] int getSubTileCacheBytes() const;
[[nodiscard]] CesiumRasterOverlays::RasterOverlayOptions createRasterOverlayOptions() const;
void updateRasterOverlayOptions() const;
virtual void reload() = 0;
protected:
[[nodiscard]] virtual CesiumRasterOverlays::RasterOverlay* getRasterOverlay() const = 0;
Context* _pContext;
pxr::SdfPath _path;
private:
void setRasterOverlayOptionsFromUsd(CesiumRasterOverlays::RasterOverlayOptions& options) const;
};
} // namespace cesium::omniverse
| 1,865 | C | 33.555555 | 104 | 0.764611 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniIonRasterOverlay.h | #pragma once
#include "cesium/omniverse/OmniRasterOverlay.h"
#include <CesiumRasterOverlays/IonRasterOverlay.h>
#include <CesiumUtility/IntrusivePointer.h>
namespace CesiumIonClient {
struct Token;
}
namespace cesium::omniverse {
class OmniIonRasterOverlay final : public OmniRasterOverlay {
public:
OmniIonRasterOverlay(Context* pContext, const pxr::SdfPath& path);
~OmniIonRasterOverlay() override = default;
OmniIonRasterOverlay(const OmniIonRasterOverlay&) = delete;
OmniIonRasterOverlay& operator=(const OmniIonRasterOverlay&) = delete;
OmniIonRasterOverlay(OmniIonRasterOverlay&&) noexcept = default;
OmniIonRasterOverlay& operator=(OmniIonRasterOverlay&&) noexcept = default;
[[nodiscard]] int64_t getIonAssetId() const;
[[nodiscard]] CesiumIonClient::Token getIonAccessToken() const;
[[nodiscard]] std::string getIonApiUrl() const;
[[nodiscard]] pxr::SdfPath getResolvedIonServerPath() const;
[[nodiscard]] CesiumRasterOverlays::RasterOverlay* getRasterOverlay() const override;
void reload() override;
private:
CesiumUtility::IntrusivePointer<CesiumRasterOverlays::IonRasterOverlay> _pIonRasterOverlay;
};
} // namespace cesium::omniverse
| 1,212 | C | 33.657142 | 95 | 0.771452 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/AssetRegistry.h | #pragma once
#include <pxr/usd/usd/common.h>
#include <vector>
#include <gsl/span>
namespace cesium::omniverse {
class Context;
class OmniCartographicPolygon;
class OmniData;
class OmniGeoreference;
class OmniGlobeAnchor;
class OmniRasterOverlay;
class OmniIonRasterOverlay;
class OmniIonServer;
class OmniPolygonRasterOverlay;
class OmniTileset;
class OmniWebMapServiceRasterOverlay;
class OmniTileMapServiceRasterOverlay;
class OmniWebMapTileServiceRasterOverlay;
struct Viewport;
enum AssetType {
DATA,
TILESET,
ION_RASTER_OVERLAY,
POLYGON_RASTER_OVERLAY,
WEB_MAP_SERVICE_RASTER_OVERLAY,
TILE_MAP_SERVICE_RASTER_OVERLAY,
WEB_MAP_TILE_SERVICE_RASTER_OVERLAY,
GEOREFERENCE,
GLOBE_ANCHOR,
ION_SERVER,
CARTOGRAPHIC_POLYGON,
OTHER,
};
class AssetRegistry {
public:
AssetRegistry(Context* pContext);
~AssetRegistry();
AssetRegistry(const AssetRegistry&) = delete;
AssetRegistry& operator=(const AssetRegistry&) = delete;
AssetRegistry(AssetRegistry&&) noexcept = delete;
AssetRegistry& operator=(AssetRegistry&&) noexcept = delete;
void onUpdateFrame(const gsl::span<const Viewport>& viewports, bool waitForLoadingTiles);
OmniData& addData(const pxr::SdfPath& path);
void removeData(const pxr::SdfPath& path);
[[nodiscard]] OmniData* getData(const pxr::SdfPath& path) const;
[[nodiscard]] OmniData* getFirstData() const;
OmniTileset& addTileset(const pxr::SdfPath& path);
void removeTileset(const pxr::SdfPath& path);
[[nodiscard]] OmniTileset* getTileset(const pxr::SdfPath& path) const;
[[nodiscard]] const std::vector<std::unique_ptr<OmniTileset>>& getTilesets() const;
OmniIonRasterOverlay& addIonRasterOverlay(const pxr::SdfPath& path);
void removeIonRasterOverlay(const pxr::SdfPath& path);
[[nodiscard]] OmniIonRasterOverlay* getIonRasterOverlay(const pxr::SdfPath& path) const;
[[nodiscard]] OmniIonRasterOverlay* getIonRasterOverlayByIonAssetId(int64_t ionAssetId) const;
[[nodiscard]] const std::vector<std::unique_ptr<OmniIonRasterOverlay>>& getIonRasterOverlays() const;
OmniPolygonRasterOverlay& addPolygonRasterOverlay(const pxr::SdfPath& path);
void removePolygonRasterOverlay(const pxr::SdfPath& path);
[[nodiscard]] OmniPolygonRasterOverlay* getPolygonRasterOverlay(const pxr::SdfPath& path) const;
[[nodiscard]] const std::vector<std::unique_ptr<OmniPolygonRasterOverlay>>& getPolygonRasterOverlays() const;
OmniWebMapServiceRasterOverlay& addWebMapServiceRasterOverlay(const pxr::SdfPath& path);
void removeWebMapServiceRasterOverlay(const pxr::SdfPath& path);
[[nodiscard]] OmniWebMapServiceRasterOverlay* getWebMapServiceRasterOverlay(const pxr::SdfPath& path) const;
OmniTileMapServiceRasterOverlay& addTileMapServiceRasterOverlay(const pxr::SdfPath& path);
void removeTileMapServiceRasterOverlay(const pxr::SdfPath& path);
[[nodiscard]] OmniTileMapServiceRasterOverlay* getTileMapServiceRasterOverlay(const pxr::SdfPath& path) const;
OmniWebMapTileServiceRasterOverlay& addWebMapTileServiceRasterOverlay(const pxr::SdfPath& path);
void removeWebMapTileServiceRasterOverlay(const pxr::SdfPath& path);
[[nodiscard]] OmniWebMapTileServiceRasterOverlay* getWebMapTileServiceRasterOverlay(const pxr::SdfPath& path) const;
[[nodiscard]] OmniRasterOverlay* getRasterOverlay(const pxr::SdfPath& path) const;
OmniGeoreference& addGeoreference(const pxr::SdfPath& path);
void removeGeoreference(const pxr::SdfPath& path);
[[nodiscard]] OmniGeoreference* getGeoreference(const pxr::SdfPath& path) const;
[[nodiscard]] const std::vector<std::unique_ptr<OmniGeoreference>>& getGeoreferences() const;
[[nodiscard]] OmniGeoreference* getFirstGeoreference() const;
OmniGlobeAnchor& addGlobeAnchor(const pxr::SdfPath& path);
void removeGlobeAnchor(const pxr::SdfPath& path);
[[nodiscard]] OmniGlobeAnchor* getGlobeAnchor(const pxr::SdfPath& path) const;
[[nodiscard]] const std::vector<std::unique_ptr<OmniGlobeAnchor>>& getGlobeAnchors() const;
OmniIonServer& addIonServer(const pxr::SdfPath& path);
void removeIonServer(const pxr::SdfPath& path);
[[nodiscard]] OmniIonServer* getIonServer(const pxr::SdfPath& path) const;
[[nodiscard]] const std::vector<std::unique_ptr<OmniIonServer>>& getIonServers() const;
[[nodiscard]] OmniIonServer* getFirstIonServer() const;
OmniCartographicPolygon& addCartographicPolygon(const pxr::SdfPath& path);
void removeCartographicPolygon(const pxr::SdfPath& path);
[[nodiscard]] OmniCartographicPolygon* getCartographicPolygon(const pxr::SdfPath& path) const;
[[nodiscard]] const std::vector<std::unique_ptr<OmniCartographicPolygon>>& getCartographicPolygons() const;
[[nodiscard]] AssetType getAssetType(const pxr::SdfPath& path) const;
[[nodiscard]] bool hasAsset(const pxr::SdfPath& path) const;
void clear();
private:
Context* _pContext;
std::vector<std::unique_ptr<OmniData>> _datas;
std::vector<std::unique_ptr<OmniTileset>> _tilesets;
std::vector<std::unique_ptr<OmniIonRasterOverlay>> _ionRasterOverlays;
std::vector<std::unique_ptr<OmniPolygonRasterOverlay>> _polygonRasterOverlays;
std::vector<std::unique_ptr<OmniWebMapServiceRasterOverlay>> _webMapServiceRasterOverlays;
std::vector<std::unique_ptr<OmniTileMapServiceRasterOverlay>> _tileMapServiceRasterOverlays;
std::vector<std::unique_ptr<OmniWebMapTileServiceRasterOverlay>> _webMapTileServiceRasterOverlays;
std::vector<std::unique_ptr<OmniGeoreference>> _georeferences;
std::vector<std::unique_ptr<OmniGlobeAnchor>> _globeAnchors;
std::vector<std::unique_ptr<OmniIonServer>> _ionServers;
std::vector<std::unique_ptr<OmniCartographicPolygon>> _cartographicPolygons;
int64_t _tilesetId{0};
};
} // namespace cesium::omniverse
| 5,880 | C | 43.55303 | 120 | 0.763095 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/MetadataUtil.h | #pragma once
#include "cesium/omniverse/Context.h"
#include "cesium/omniverse/DataType.h"
#include "cesium/omniverse/FabricPropertyInfo.h"
#include "cesium/omniverse/GltfUtil.h"
#include "cesium/omniverse/Logger.h"
#include <CesiumGltf/ExtensionExtMeshFeatures.h>
#include <CesiumGltf/ExtensionMeshPrimitiveExtStructuralMetadata.h>
#include <CesiumGltf/ExtensionModelExtStructuralMetadata.h>
#include <CesiumGltf/PropertyAttribute.h>
#include <CesiumGltf/PropertyAttributeView.h>
#include <CesiumGltf/PropertyTableView.h>
#include <CesiumGltf/PropertyTexture.h>
#include <CesiumGltf/PropertyTextureView.h>
namespace cesium::omniverse {
struct FabricPropertyDescriptor;
struct FabricTextureData;
} // namespace cesium::omniverse
namespace cesium::omniverse::MetadataUtil {
template <typename Callback, typename UnsupportedCallback>
void forEachPropertyAttributeProperty(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
Callback&& callback,
const UnsupportedCallback& unsupportedCallback) {
const auto pStructuralMetadataModel = model.getExtension<CesiumGltf::ExtensionModelExtStructuralMetadata>();
if (!pStructuralMetadataModel) {
return;
}
const auto pStructuralMetadataPrimitive =
primitive.getExtension<CesiumGltf::ExtensionMeshPrimitiveExtStructuralMetadata>();
if (!pStructuralMetadataPrimitive) {
return;
}
for (const auto& propertyAttributeIndex : pStructuralMetadataPrimitive->propertyAttributes) {
const auto pPropertyAttribute =
model.getSafe(&pStructuralMetadataModel->propertyAttributes, static_cast<int32_t>(propertyAttributeIndex));
if (!pPropertyAttribute) {
context.getLogger()->warn("Property attribute index {} is out of range.", propertyAttributeIndex);
continue;
}
const auto propertyAttributeView = CesiumGltf::PropertyAttributeView(model, *pPropertyAttribute);
if (propertyAttributeView.status() != CesiumGltf::PropertyAttributeViewStatus::Valid) {
context.getLogger()->warn(
"Property attribute is invalid and will be ignored. Status code: {}",
static_cast<int>(propertyAttributeView.status()));
continue;
}
propertyAttributeView.forEachProperty(
primitive,
[&context,
callback = std::forward<Callback>(callback),
&unsupportedCallback,
&propertyAttributeView,
&pStructuralMetadataModel,
&pPropertyAttribute](const std::string& propertyId, const auto& propertyAttributePropertyView) {
if (propertyAttributePropertyView.status() != CesiumGltf::PropertyAttributePropertyViewStatus::Valid) {
unsupportedCallback(
propertyId,
fmt::format(
"Property \"{}\" is invalid and will be ignored. Status code: {}",
propertyId,
static_cast<int>(propertyAttributePropertyView.status())));
return;
}
const auto& schema = pStructuralMetadataModel->schema;
if (!schema.has_value()) {
unsupportedCallback(
propertyId, fmt::format("No schema found. Property \"{}\" will be ignored.", propertyId));
return;
}
const auto pClassDefinition = propertyAttributeView.getClass();
if (!pClassDefinition) {
unsupportedCallback(
propertyId, fmt::format("No class found. Property \"{}\" will be ignored.", propertyId));
return;
}
const auto pClassProperty = propertyAttributeView.getClassProperty(propertyId);
if (!pClassProperty) {
unsupportedCallback(
propertyId,
fmt::format("No class property found. Property \"{}\" will be ignored.", propertyId));
return;
}
const auto& propertyAttributeProperty = pPropertyAttribute->properties.at(propertyId);
callback(
propertyId,
schema.value(),
*pClassDefinition,
*pClassProperty,
*pPropertyAttribute,
propertyAttributeProperty,
propertyAttributeView,
propertyAttributePropertyView);
});
}
}
template <typename Callback, typename UnsupportedCallback>
void forEachPropertyTextureProperty(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
Callback&& callback,
const UnsupportedCallback& unsupportedCallback) {
const auto pStructuralMetadataModel = model.getExtension<CesiumGltf::ExtensionModelExtStructuralMetadata>();
if (!pStructuralMetadataModel) {
return;
}
const auto pStructuralMetadataPrimitive =
primitive.getExtension<CesiumGltf::ExtensionMeshPrimitiveExtStructuralMetadata>();
if (!pStructuralMetadataPrimitive) {
return;
}
for (const auto& propertyTextureIndex : pStructuralMetadataPrimitive->propertyTextures) {
const auto pPropertyTexture =
model.getSafe(&pStructuralMetadataModel->propertyTextures, static_cast<int32_t>(propertyTextureIndex));
if (!pPropertyTexture) {
context.getLogger()->warn(fmt::format("Property texture index {} is out of range.", propertyTextureIndex));
continue;
}
const auto propertyTextureView = CesiumGltf::PropertyTextureView(model, *pPropertyTexture);
if (propertyTextureView.status() != CesiumGltf::PropertyTextureViewStatus::Valid) {
context.getLogger()->warn(
"Property texture is invalid and will be ignored. Status code: {}",
static_cast<int>(propertyTextureView.status()));
continue;
}
propertyTextureView.forEachProperty(
[&context,
callback = std::forward<Callback>(callback),
&unsupportedCallback,
&propertyTextureView,
&pStructuralMetadataModel,
&pPropertyTexture](const std::string& propertyId, const auto& propertyTexturePropertyView) {
if (propertyTexturePropertyView.status() != CesiumGltf::PropertyTexturePropertyViewStatus::Valid) {
unsupportedCallback(
propertyId,
fmt::format(
"Property \"{}\" is invalid and will be ignored. Status code: {}",
propertyId,
static_cast<int>(propertyTexturePropertyView.status())));
return;
}
const auto& schema = pStructuralMetadataModel->schema;
if (!schema.has_value()) {
unsupportedCallback(
propertyId, fmt::format("No schema found. Property \"{}\" will be ignored.", propertyId));
return;
}
const auto pClassDefinition = propertyTextureView.getClass();
if (!pClassDefinition) {
unsupportedCallback(
propertyId, fmt::format("No class found. Property \"{}\" will be ignored.", propertyId));
return;
}
const auto pClassProperty = propertyTextureView.getClassProperty(propertyId);
if (!pClassProperty) {
unsupportedCallback(
propertyId,
fmt::format("No class property found. Property \"{}\" will be ignored.", propertyId));
return;
}
if (!propertyTexturePropertyView.getImage()) {
unsupportedCallback(
propertyId, fmt::format("No image found. Property \"{}\" will be ignored.", propertyId));
return;
}
const auto& propertyTextureProperty = pPropertyTexture->properties.at(propertyId);
callback(
propertyId,
schema.value(),
*pClassDefinition,
*pClassProperty,
*pPropertyTexture,
propertyTextureProperty,
propertyTextureView,
propertyTexturePropertyView);
});
}
}
template <typename Callback, typename UnsupportedCallback>
void forEachPropertyTableProperty(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
Callback&& callback,
const UnsupportedCallback& unsupportedCallback) {
const auto pStructuralMetadataModel = model.getExtension<CesiumGltf::ExtensionModelExtStructuralMetadata>();
if (!pStructuralMetadataModel) {
return;
}
const auto pMeshFeatures = primitive.getExtension<CesiumGltf::ExtensionExtMeshFeatures>();
if (!pMeshFeatures) {
return;
}
for (uint64_t i = 0; i < pMeshFeatures->featureIds.size(); ++i) {
const auto featureIdSetIndex = i;
const auto& featureId = pMeshFeatures->featureIds[featureIdSetIndex];
if (featureId.propertyTable.has_value()) {
const auto pPropertyTable = model.getSafe(
&pStructuralMetadataModel->propertyTables, static_cast<int32_t>(featureId.propertyTable.value()));
if (!pPropertyTable) {
context.getLogger()->warn(
fmt::format("Property table index {} is out of range.", featureId.propertyTable.value()));
continue;
}
const auto propertyTableView = CesiumGltf::PropertyTableView(model, *pPropertyTable);
if (propertyTableView.status() != CesiumGltf::PropertyTableViewStatus::Valid) {
context.getLogger()->warn(
"Property table is invalid and will be ignored. Status code: {}",
static_cast<int>(propertyTableView.status()));
continue;
}
propertyTableView.forEachProperty(
[&context,
callback = std::forward<Callback>(callback),
&unsupportedCallback,
&propertyTableView,
&pStructuralMetadataModel,
&pPropertyTable,
featureIdSetIndex](const std::string& propertyId, const auto& propertyTablePropertyView) {
if (propertyTablePropertyView.status() != CesiumGltf::PropertyTablePropertyViewStatus::Valid) {
unsupportedCallback(
propertyId,
fmt::format(
"Property \"{}\" is invalid and will be ignored. Status code: {}",
propertyId,
static_cast<int>(propertyTablePropertyView.status())));
return;
}
const auto& schema = pStructuralMetadataModel->schema;
if (!schema.has_value()) {
unsupportedCallback(
propertyId, fmt::format("No schema found. Property \"{}\" will be ignored.", propertyId));
return;
}
const auto pClassDefinition = propertyTableView.getClass();
if (!pClassDefinition) {
unsupportedCallback(
propertyId, fmt::format("No class found. Property \"{}\" will be ignored.", propertyId));
return;
}
const auto pClassProperty = propertyTableView.getClassProperty(propertyId);
if (!pClassProperty) {
unsupportedCallback(
propertyId,
fmt::format("No class property found. Property \"{}\" will be ignored.", propertyId));
return;
}
const auto& propertyTableProperty = pPropertyTable->properties.at(propertyId);
callback(
propertyId,
schema.value(),
*pClassDefinition,
*pClassProperty,
*pPropertyTable,
propertyTableProperty,
propertyTableView,
propertyTablePropertyView,
featureIdSetIndex);
});
}
}
}
template <typename Callback, typename UnsupportedCallback>
void forEachStyleablePropertyAttributeProperty(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
Callback&& callback,
const UnsupportedCallback& unsupportedCallback) {
forEachPropertyAttributeProperty(
context,
model,
primitive,
[&context, callback = std::forward<Callback>(callback), &unsupportedCallback](
const std::string& propertyId,
[[maybe_unused]] const CesiumGltf::Schema& schema,
[[maybe_unused]] const CesiumGltf::Class& classDefinition,
[[maybe_unused]] const CesiumGltf::ClassProperty& classProperty,
[[maybe_unused]] const CesiumGltf::PropertyAttribute& propertyAttribute,
const CesiumGltf::PropertyAttributeProperty& propertyAttributeProperty,
[[maybe_unused]] const CesiumGltf::PropertyAttributeView& propertyAttributeView,
const auto& propertyAttributePropertyView) {
using RawType = decltype(propertyAttributePropertyView.getRaw(0));
using TransformedType = typename std::decay_t<decltype(propertyAttributePropertyView.get(0))>::value_type;
constexpr auto type = DataTypeUtil::getTypeReverse<RawType, TransformedType>();
if constexpr (DataTypeUtil::isMatrix<type>()) {
unsupportedCallback(
propertyId,
fmt::format(
"Matrix properties are not supported for styling. Property \"{}\" will be ignored.",
propertyId));
return;
} else {
const auto& attribute = propertyAttributeProperty.attribute;
// For some reason the static cast is needed in MSVC
const auto propertyInfo = FabricPropertyInfo<static_cast<cesium::omniverse::DataType>(type)>{
propertyAttributePropertyView.offset(),
propertyAttributePropertyView.scale(),
propertyAttributePropertyView.min(),
propertyAttributePropertyView.max(),
propertyAttributePropertyView.required(),
propertyAttributePropertyView.noData(),
propertyAttributePropertyView.defaultValue(),
};
const auto property =
FabricPropertyAttributePropertyInfo<static_cast<cesium::omniverse::DataType>(type)>{
attribute,
propertyInfo,
};
callback(propertyId, propertyAttributePropertyView, property);
}
},
unsupportedCallback);
}
template <typename Callback, typename UnsupportedCallback>
void forEachStyleablePropertyTextureProperty(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
Callback&& callback,
const UnsupportedCallback& unsupportedCallback) {
forEachPropertyTextureProperty(
context,
model,
primitive,
[&context, callback = std::forward<Callback>(callback), &unsupportedCallback, &model](
const std::string& propertyId,
[[maybe_unused]] const CesiumGltf::Schema& schema,
[[maybe_unused]] const CesiumGltf::Class& classDefinition,
[[maybe_unused]] const CesiumGltf::ClassProperty& classProperty,
[[maybe_unused]] const CesiumGltf::PropertyTexture& propertyTexture,
const CesiumGltf::PropertyTextureProperty& propertyTextureProperty,
[[maybe_unused]] const CesiumGltf::PropertyTextureView& propertyTextureView,
const auto& propertyTexturePropertyView) {
using RawType = decltype(propertyTexturePropertyView.getRaw(0.0, 0.0));
using TransformedType =
typename std::decay_t<decltype(propertyTexturePropertyView.get(0.0, 0.0))>::value_type;
constexpr auto IsArray = HAS_MEMBER(RawType, size());
if constexpr (IsArray) {
unsupportedCallback(
propertyId,
fmt::format(
"Array properties are not supported for styling. Property \"{}\" will be ignored.",
propertyId));
return;
} else {
constexpr auto type = DataTypeUtil::getTypeReverse<RawType, TransformedType>();
if constexpr (DataTypeUtil::getComponentByteLength<type>() > 1) {
unsupportedCallback(
propertyId,
fmt::format(
"Only 8-bit per-component property texture properties are supported for styling. Property "
"\"{}\" will be ignored.",
propertyId));
return;
} else {
const auto textureInfo = GltfUtil::getPropertyTexturePropertyInfo(model, propertyTextureProperty);
if (textureInfo.channels.size() != DataTypeUtil::getComponentCount<type>()) {
unsupportedCallback(
propertyId,
fmt::format(
"Properties with components that are packed across multiple texture channels are not "
"supported for styling. Property \"{}\" will be ignored.",
propertyId));
return;
}
if (textureInfo.channels.size() > 4) {
unsupportedCallback(
propertyId,
fmt::format(
"Properties with more than four channels are not supported for styling. Property "
"\"{}\" will be ignored.",
propertyId));
return;
}
const auto propertyInfo = FabricPropertyInfo<static_cast<cesium::omniverse::DataType>(type)>{
propertyTexturePropertyView.offset(),
propertyTexturePropertyView.scale(),
propertyTexturePropertyView.min(),
propertyTexturePropertyView.max(),
propertyTexturePropertyView.required(),
propertyTexturePropertyView.noData(),
propertyTexturePropertyView.defaultValue(),
};
const auto property =
FabricPropertyTexturePropertyInfo<static_cast<cesium::omniverse::DataType>(type)>{
textureInfo,
static_cast<uint64_t>(propertyTextureProperty.index),
propertyInfo,
};
callback(propertyId, propertyTexturePropertyView, property);
}
}
},
unsupportedCallback);
}
template <typename Callback, typename UnsupportedCallback>
void forEachStyleablePropertyTableProperty(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
Callback&& callback,
const UnsupportedCallback& unsupportedCallback) {
forEachPropertyTableProperty(
context,
model,
primitive,
[&context, callback = std::forward<Callback>(callback), &unsupportedCallback](
const std::string& propertyId,
[[maybe_unused]] const CesiumGltf::Schema& schema,
[[maybe_unused]] const CesiumGltf::Class& classDefinition,
[[maybe_unused]] const CesiumGltf::ClassProperty& classProperty,
[[maybe_unused]] const CesiumGltf::PropertyTable& propertyTable,
[[maybe_unused]] const CesiumGltf::PropertyTableProperty& propertyTableProperty,
[[maybe_unused]] const CesiumGltf::PropertyTableView& propertyTableView,
const auto& propertyTablePropertyView,
uint64_t featureIdSetIndex) {
using RawType = decltype(propertyTablePropertyView.getRaw(0));
using TransformedType = typename std::decay_t<decltype(propertyTablePropertyView.get(0))>::value_type;
constexpr auto IsArray = HAS_MEMBER(RawType, size());
constexpr auto IsBoolean = std::is_same_v<RawType, bool>;
constexpr auto IsString = std::is_same_v<RawType, std::string_view>;
if constexpr (IsArray) {
unsupportedCallback(
propertyId,
fmt::format(
"Array properties are not supported for styling. Property \"{}\" will be ignored.",
propertyId));
return;
} else if constexpr (IsBoolean) {
unsupportedCallback(
propertyId,
fmt::format(
"Boolean properties are not supported for styling. Property \"{}\" will be ignored.",
propertyId));
return;
} else if constexpr (IsString) {
unsupportedCallback(
propertyId,
fmt::format(
"String properties are not supported for styling. Property \"{}\" will be ignored.",
propertyId));
return;
} else {
constexpr auto type = DataTypeUtil::getTypeReverse<RawType, TransformedType>();
constexpr auto unnormalizedComponentType = DataTypeUtil::getUnnormalizedComponentType<type>();
if constexpr (DataTypeUtil::isMatrix<type>()) {
unsupportedCallback(
propertyId,
fmt::format(
"Matrix properties are not supported for styling. Property \"{}\" will be ignored.",
propertyId));
return;
} else if constexpr (unnormalizedComponentType == DataType::UINT32) {
unsupportedCallback(
propertyId,
fmt::format(
"UINT32 properties are not supported for styling due to potential precision loss. Property "
"\"{}\" will be ignored.",
propertyId));
return;
} else if constexpr (unnormalizedComponentType == DataType::UINT64) {
unsupportedCallback(
propertyId,
fmt::format(
"UINT64 properties are not supported for styling due to potential precision loss. Property "
"\"{}\" will be ignored.",
propertyId));
return;
} else if constexpr (unnormalizedComponentType == DataType::INT64) {
unsupportedCallback(
propertyId,
fmt::format(
"INT64 properties are not supported for styling due to potential precision loss. Property "
"\"{}\" will be ignored.",
propertyId));
return;
} else {
if constexpr (unnormalizedComponentType == DataType::FLOAT64) {
unsupportedCallback(
propertyId,
fmt::format(
"64-bit float properties are converted to 32-bit floats for styling. Some precision "
"loss "
"may occur for property \"{}\".",
propertyId));
}
const auto propertyInfo = FabricPropertyInfo<static_cast<cesium::omniverse::DataType>(type)>{
propertyTablePropertyView.offset(),
propertyTablePropertyView.scale(),
propertyTablePropertyView.min(),
propertyTablePropertyView.max(),
propertyTablePropertyView.required(),
propertyTablePropertyView.noData(),
propertyTablePropertyView.defaultValue(),
};
const auto property =
FabricPropertyTablePropertyInfo<static_cast<cesium::omniverse::DataType>(type)>{
featureIdSetIndex,
propertyInfo,
};
callback(propertyId, propertyTablePropertyView, property);
}
}
},
unsupportedCallback);
}
std::tuple<std::vector<FabricPropertyDescriptor>, std::map<std::string, std::string>> getStyleableProperties(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive);
std::vector<const CesiumGltf::ImageCesium*> getPropertyTextureImages(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive);
std::unordered_map<uint64_t, uint64_t> getPropertyTextureIndexMapping(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive);
std::vector<FabricTextureData> encodePropertyTables(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive);
uint64_t getPropertyTableTextureCount(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive);
} // namespace cesium::omniverse::MetadataUtil
| 26,987 | C | 44.130435 | 120 | 0.561974 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/SettingsWrapper.h | #pragma once
#include <cstdint>
#include <string>
#include <vector>
namespace cesium::omniverse::Settings {
struct AccessToken {
std::string ionApiUrl;
std::string accessToken;
};
std::vector<AccessToken> getAccessTokens();
void setAccessToken(const AccessToken& accessToken);
void removeAccessToken(const std::string& ionApiUrl);
void clearTokens();
uint64_t getMaxCacheItems();
} // namespace cesium::omniverse::Settings
| 437 | C | 18.90909 | 53 | 0.757437 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricRenderResources.h | #pragma once
#include <glm/glm.hpp>
#include <vector>
namespace cesium::omniverse {
struct FabricMesh;
struct FabricRenderResources {
FabricRenderResources() = default;
~FabricRenderResources() = default;
FabricRenderResources(const FabricRenderResources&) = delete;
FabricRenderResources& operator=(const FabricRenderResources&) = delete;
FabricRenderResources(FabricRenderResources&&) noexcept = default;
FabricRenderResources& operator=(FabricRenderResources&&) noexcept = default;
std::vector<FabricMesh> fabricMeshes;
};
} // namespace cesium::omniverse
| 594 | C | 24.869564 | 81 | 0.762626 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/UsdUtil.h | #pragma once
#include "CesiumUsdSchemas/rasterOverlay.h"
#include <glm/fwd.hpp>
#include <pxr/base/gf/declare.h>
#include <pxr/usd/usd/common.h>
#include <pxr/usd/usdGeom/basisCurves.h>
#include <pxr/usd/usdGeom/xformOp.h>
PXR_NAMESPACE_OPEN_SCOPE
class CesiumData;
class CesiumGeoreference;
class CesiumGlobeAnchorAPI;
class CesiumRasterOverlay;
class CesiumIonRasterOverlay;
class CesiumIonServer;
class CesiumPolygonRasterOverlay;
class CesiumSession;
class CesiumTileset;
class CesiumWebMapServiceRasterOverlay;
class CesiumTileMapServiceRasterOverlay;
class CesiumWebMapTileServiceRasterOverlay;
class UsdGeomBasisCurves;
class UsdGeomXformable;
class UsdGeomXformOp;
class UsdShadeShader;
PXR_NAMESPACE_CLOSE_SCOPE
namespace Cesium3DTilesSelection {
class ViewState;
}
namespace CesiumGeospatial {
class Cartographic;
class Ellipsoid;
class LocalHorizontalCoordinateSystem;
} // namespace CesiumGeospatial
namespace cesium::omniverse {
class Context;
struct Viewport;
} // namespace cesium::omniverse
namespace cesium::omniverse::MathUtil {
enum class EulerAngleOrder;
}
namespace cesium::omniverse::UsdUtil {
glm::dvec3 usdToGlmVector(const pxr::GfVec3d& vector);
glm::fvec3 usdToGlmVector(const pxr::GfVec3f& vector);
glm::dmat4 usdToGlmMatrix(const pxr::GfMatrix4d& matrix);
glm::dquat usdToGlmQuat(const pxr::GfQuatd& quat);
glm::fquat usdToGlmQuat(const pxr::GfQuatf& quat);
std::array<glm::dvec3, 2> usdToGlmExtent(const pxr::GfRange3d& extent);
pxr::GfVec3d glmToUsdVector(const glm::dvec3& vector);
pxr::GfVec2f glmToUsdVector(const glm::fvec2& vector);
pxr::GfVec3f glmToUsdVector(const glm::fvec3& vector);
pxr::GfVec4f glmToUsdVector(const glm::fvec4& vector);
pxr::GfRange3d glmToUsdExtent(const std::array<glm::dvec3, 2>& extent);
pxr::GfQuatd glmToUsdQuat(const glm::dquat& quat);
pxr::GfQuatf glmToUsdQuat(const glm::fquat& quat);
pxr::GfMatrix4d glmToUsdMatrix(const glm::dmat4& matrix);
glm::dmat4 computePrimLocalToWorldTransform(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
glm::dmat4 computePrimWorldToLocalTransform(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
glm::dmat4 computeEcefToStageTransform(const Context& context, const pxr::SdfPath& georeferencePath);
glm::dmat4 computeEcefToPrimWorldTransform(
const Context& context,
const pxr::SdfPath& georeferencePath,
const pxr::SdfPath& primPath);
glm::dmat4 computePrimWorldToEcefTransform(
const Context& context,
const pxr::SdfPath& georeferencePath,
const pxr::SdfPath& primPath);
glm::dmat4 computeEcefToPrimLocalTransform(
const Context& context,
const pxr::SdfPath& georeferencePath,
const pxr::SdfPath& primPath);
glm::dmat4 computePrimLocalToEcefTransform(
const Context& context,
const pxr::SdfPath& georeferencePath,
const pxr::SdfPath& primPath);
CesiumGeospatial::LocalHorizontalCoordinateSystem computeLocalCoordinateSystem(
const pxr::UsdStageWeakPtr& pStage,
const CesiumGeospatial::Cartographic& origin,
const CesiumGeospatial::Ellipsoid& ellipsoid);
Cesium3DTilesSelection::ViewState computeViewState(
const Context& context,
const pxr::SdfPath& georeferencePath,
const pxr::SdfPath& primPath,
const Viewport& viewport);
bool primExists(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isSchemaValid(const pxr::UsdSchemaBase& schema);
bool isPrimVisible(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
const std::string& getName(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::TfToken getUsdUpAxis(const pxr::UsdStageWeakPtr& pStage);
double getUsdMetersPerUnit(const pxr::UsdStageWeakPtr& pStage);
pxr::SdfPath getRootPath(const pxr::UsdStageWeakPtr& pStage);
pxr::SdfPath
makeUniquePath(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& parentPath, const std::string& name);
std::string getSafeName(const std::string& name);
pxr::TfToken getDynamicTextureProviderAssetPathToken(const std::string_view& name);
pxr::CesiumData defineCesiumData(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumTileset defineCesiumTileset(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumIonRasterOverlay defineCesiumIonRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumPolygonRasterOverlay
defineCesiumPolygonRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumGeoreference defineCesiumGeoreference(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumIonServer defineCesiumIonServer(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumGlobeAnchorAPI applyCesiumGlobeAnchor(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumSession defineCesiumSession(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumData getCesiumData(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumTileset getCesiumTileset(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumRasterOverlay getCesiumRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumIonRasterOverlay getCesiumIonRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumPolygonRasterOverlay
getCesiumPolygonRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumWebMapServiceRasterOverlay
getCesiumWebMapServiceRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumTileMapServiceRasterOverlay
getCesiumTileMapServiceRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumWebMapTileServiceRasterOverlay
getCesiumWebMapTileServiceRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumGeoreference getCesiumGeoreference(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumGlobeAnchorAPI getCesiumGlobeAnchor(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumIonServer getCesiumIonServer(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::UsdGeomBasisCurves getCesiumCartographicPolygon(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::UsdShadeShader getUsdShader(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::UsdGeomBasisCurves getUsdBasisCurves(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
pxr::CesiumSession getOrCreateCesiumSession(const pxr::UsdStageWeakPtr& pStage);
bool isCesiumData(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumTileset(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumIonRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumPolygonRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumWebMapServiceRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumTileMapServiceRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumWebMapTileServiceRasterOverlay(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumGeoreference(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumIonServer(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumCartographicPolygon(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isCesiumSession(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool hasCesiumGlobeAnchor(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isUsdShader(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
bool isUsdMaterial(const pxr::UsdStageWeakPtr& pStage, const pxr::SdfPath& path);
glm::dvec3 getTranslate(const pxr::UsdGeomXformOp& translateOp);
glm::dvec3 getRotate(const pxr::UsdGeomXformOp& rotateOp);
glm::dquat getOrient(const pxr::UsdGeomXformOp& orientOp);
glm::dvec3 getScale(const pxr::UsdGeomXformOp& scaleOp);
void setTranslate(pxr::UsdGeomXformOp& translateOp, const glm::dvec3& translate);
void setRotate(pxr::UsdGeomXformOp& rotateOp, const glm::dvec3& rotate);
void setOrient(pxr::UsdGeomXformOp& orientOp, const glm::dquat& orient);
void setScale(pxr::UsdGeomXformOp& scaleOp, const glm::dvec3& scale);
struct TranslateRotateScaleOps {
pxr::UsdGeomXformOp translateOp;
pxr::UsdGeomXformOp rotateOrOrientOp;
pxr::UsdGeomXformOp scaleOp;
MathUtil::EulerAngleOrder eulerAngleOrder;
};
std::optional<TranslateRotateScaleOps> getOrCreateTranslateRotateScaleOps(const pxr::UsdGeomXformable& xformable);
}; // namespace cesium::omniverse::UsdUtil
| 8,823 | C | 48.853107 | 119 | 0.808682 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniWebMapServiceRasterOverlay.h | #pragma once
#include "cesium/omniverse/OmniRasterOverlay.h"
#include <CesiumRasterOverlays/WebMapServiceRasterOverlay.h>
#include <CesiumUtility/IntrusivePointer.h>
#include <string>
namespace cesium::omniverse {
class OmniWebMapServiceRasterOverlay final : public OmniRasterOverlay {
public:
OmniWebMapServiceRasterOverlay(Context* pContext, const pxr::SdfPath& path);
~OmniWebMapServiceRasterOverlay() override = default;
OmniWebMapServiceRasterOverlay(const OmniWebMapServiceRasterOverlay&) = delete;
OmniWebMapServiceRasterOverlay& operator=(const OmniWebMapServiceRasterOverlay&) = delete;
OmniWebMapServiceRasterOverlay(OmniWebMapServiceRasterOverlay&&) noexcept = default;
OmniWebMapServiceRasterOverlay& operator=(OmniWebMapServiceRasterOverlay&&) noexcept = default;
[[nodiscard]] CesiumRasterOverlays::RasterOverlay* getRasterOverlay() const override;
[[nodiscard]] std::string getBaseUrl() const;
[[nodiscard]] int getMinimumLevel() const;
[[nodiscard]] int getMaximumLevel() const;
[[nodiscard]] int getTileWidth() const;
[[nodiscard]] int getTileHeight() const;
[[nodiscard]] std::string getLayers() const;
void reload() override;
private:
CesiumUtility::IntrusivePointer<CesiumRasterOverlays::WebMapServiceRasterOverlay> _pWebMapServiceRasterOverlay;
};
} // namespace cesium::omniverse
| 1,373 | C | 39.411764 | 115 | 0.782229 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniData.h | #pragma once
#include <pxr/usd/sdf/path.h>
namespace cesium::omniverse {
class Context;
class OmniData {
public:
OmniData(Context* pContext, const pxr::SdfPath& path);
~OmniData() = default;
OmniData(const OmniData&) = delete;
OmniData& operator=(const OmniData&) = delete;
OmniData(OmniData&&) noexcept = default;
OmniData& operator=(OmniData&&) noexcept = default;
[[nodiscard]] const pxr::SdfPath& getPath() const;
[[nodiscard]] pxr::SdfPath getSelectedIonServerPath() const;
[[nodiscard]] bool getDebugDisableMaterials() const;
[[nodiscard]] bool getDebugDisableTextures() const;
[[nodiscard]] bool getDebugDisableGeometryPool() const;
[[nodiscard]] bool getDebugDisableMaterialPool() const;
[[nodiscard]] bool getDebugDisableTexturePool() const;
[[nodiscard]] uint64_t getDebugGeometryPoolInitialCapacity() const;
[[nodiscard]] uint64_t getDebugMaterialPoolInitialCapacity() const;
[[nodiscard]] uint64_t getDebugTexturePoolInitialCapacity() const;
[[nodiscard]] bool getDebugRandomColors() const;
[[nodiscard]] bool getDebugDisableGeoreferencing() const;
private:
Context* _pContext;
pxr::SdfPath _path;
};
} // namespace cesium::omniverse
| 1,236 | C | 33.36111 | 71 | 0.718447 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricFeaturesInfo.h | #pragma once
#include "cesium/omniverse/FabricTextureInfo.h"
#include <optional>
#include <variant>
#include <vector>
namespace cesium::omniverse {
enum class FabricFeatureIdType {
INDEX,
ATTRIBUTE,
TEXTURE,
};
struct FabricFeatureId {
std::optional<uint64_t> nullFeatureId;
uint64_t featureCount;
std::variant<std::monostate, uint64_t, FabricTextureInfo> featureIdStorage;
};
struct FabricFeaturesInfo {
std::vector<FabricFeatureId> featureIds;
};
} // namespace cesium::omniverse
| 517 | C | 17.499999 | 79 | 0.73501 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/TaskProcessor.h | #pragma once
#include <CesiumAsync/ITaskProcessor.h>
#include <pxr/base/work/dispatcher.h>
namespace cesium::omniverse {
class TaskProcessor final : public CesiumAsync::ITaskProcessor {
public:
TaskProcessor() = default;
~TaskProcessor() override = default;
TaskProcessor(const TaskProcessor&) = delete;
TaskProcessor& operator=(const TaskProcessor&) = delete;
TaskProcessor(TaskProcessor&&) noexcept = delete;
TaskProcessor& operator=(TaskProcessor&&) noexcept = delete;
void startTask(std::function<void()> f) override;
private:
// TODO: should we being using something in Carbonite instead?
pxr::WorkDispatcher _dispatcher;
};
} // namespace cesium::omniverse
| 709 | C | 27.399999 | 66 | 0.730606 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricTextureData.h | #pragma once
#include <carb/RenderingTypes.h>
#include <vector>
namespace cesium::omniverse {
struct FabricTextureData {
std::vector<std::byte> bytes;
uint64_t width;
uint64_t height;
carb::Format format;
};
} // namespace cesium::omniverse
| 262 | C | 14.470587 | 33 | 0.694656 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricTextureInfo.h | #pragma once
#include <glm/glm.hpp>
#include <vector>
namespace cesium::omniverse {
struct FabricTextureInfo {
glm::dvec2 offset;
double rotation;
glm::dvec2 scale;
uint64_t setIndex;
int32_t wrapS;
int32_t wrapT;
bool flipVertical;
std::vector<uint8_t> channels;
// Make sure to update this function when adding new fields to the struct
// In C++ 20 we can use the default equality comparison (= default)
// clang-format off
bool operator==(const FabricTextureInfo& other) const {
return offset == other.offset &&
rotation == other.rotation &&
scale == other.scale &&
setIndex == other.setIndex &&
wrapS == other.wrapS &&
wrapT == other.wrapT &&
flipVertical == other.flipVertical &&
channels == other.channels;
}
// clang-format on
};
} // namespace cesium::omniverse
| 945 | C | 25.277777 | 77 | 0.596825 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricMaterialDescriptor.h | #pragma once
#include <pxr/usd/sdf/path.h>
namespace CesiumGltf {
struct Model;
struct MeshPrimitive;
} // namespace CesiumGltf
namespace cesium::omniverse {
class Context;
enum class FabricFeatureIdType;
enum class FabricOverlayRenderMethod;
struct FabricFeaturesInfo;
struct FabricRasterOverlaysInfo;
struct FabricMaterialInfo;
struct FabricPropertyDescriptor;
/**
* @brief A descriptor used to initialize a {@link FabricMaterial} and {@link FabricMaterialPool}.
*
* The descriptor uniquely identifies the topology of a {@link FabricMaterial} i.e. what Fabric prims
* need to be created and how they're connected. It is distinct from {@FabricMaterialInfo} which
* supplies the actual material values.
*
* Materials that have the same material descriptor will be assigned to the same material pool.
* To reduce the number of material pools that are needed the list of member variables should be
* as limited as possible.
*/
class FabricMaterialDescriptor {
public:
FabricMaterialDescriptor(
const Context& context,
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
const FabricMaterialInfo& materialInfo,
const FabricFeaturesInfo& featuresInfo,
const FabricRasterOverlaysInfo& rasterOverlaysInfo,
const pxr::SdfPath& tilesetMaterialPath);
[[nodiscard]] bool hasVertexColors() const;
[[nodiscard]] bool hasBaseColorTexture() const;
[[nodiscard]] const std::vector<FabricFeatureIdType>& getFeatureIdTypes() const;
[[nodiscard]] const std::vector<FabricOverlayRenderMethod>& getRasterOverlayRenderMethods() const;
[[nodiscard]] bool hasTilesetMaterial() const;
[[nodiscard]] const pxr::SdfPath& getTilesetMaterialPath() const;
[[nodiscard]] const std::vector<FabricPropertyDescriptor>& getStyleableProperties() const;
[[nodiscard]] const std::map<std::string, std::string>& getUnsupportedPropertyWarnings() const;
bool operator==(const FabricMaterialDescriptor& other) const;
private:
bool _hasVertexColors;
bool _hasBaseColorTexture;
std::vector<FabricFeatureIdType> _featureIdTypes;
std::vector<FabricOverlayRenderMethod> _rasterOverlayRenderMethods;
pxr::SdfPath _tilesetMaterialPath;
std::vector<FabricPropertyDescriptor> _styleableProperties;
std::map<std::string, std::string> _unsupportedPropertyWarnings;
};
} // namespace cesium::omniverse
| 2,410 | C | 36.671874 | 102 | 0.763071 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/CesiumIonSession.h | #pragma once
#include <CesiumAsync/AsyncSystem.h>
#include <CesiumAsync/SharedFuture.h>
#include <CesiumIonClient/Connection.h>
#include <memory>
#include <optional>
#include <vector>
namespace CesiumAsync {
class IAssetAccessor;
}
namespace cesium::omniverse {
class CesiumIonSession {
public:
CesiumIonSession(
const CesiumAsync::AsyncSystem& asyncSystem,
std::shared_ptr<CesiumAsync::IAssetAccessor> pAssetAccessor,
std::string ionServerUrl,
std::string ionApiUrl,
int64_t ionApplicationId);
~CesiumIonSession() = default;
CesiumIonSession(const CesiumIonSession&) = delete;
CesiumIonSession& operator=(const CesiumIonSession&) = delete;
CesiumIonSession(CesiumIonSession&&) noexcept = default;
CesiumIonSession& operator=(CesiumIonSession&&) noexcept = default;
[[nodiscard]] std::shared_ptr<CesiumAsync::IAssetAccessor> getAssetAccessor() const {
return this->_pAssetAccessor;
}
[[nodiscard]] const CesiumAsync::AsyncSystem& getAsyncSystem() const {
return this->_asyncSystem;
}
CesiumAsync::AsyncSystem& getAsyncSystem() {
return this->_asyncSystem;
}
[[nodiscard]] bool isConnected() const {
return this->_connection.has_value();
}
[[nodiscard]] bool isConnecting() const {
return this->_isConnecting;
}
[[nodiscard]] bool isResuming() const {
return this->_isResuming;
}
[[nodiscard]] bool isProfileLoaded() const {
return this->_profile.has_value();
}
[[nodiscard]] bool isLoadingProfile() const {
return this->_isLoadingProfile;
}
[[nodiscard]] bool isAssetListLoaded() const {
return this->_assets.has_value();
}
[[nodiscard]] bool isLoadingAssetList() const {
return this->_isLoadingAssets;
}
[[nodiscard]] bool isTokenListLoaded() const {
return this->_tokens.has_value();
}
[[nodiscard]] bool isLoadingTokenList() const {
return this->_isLoadingTokens;
}
void connect();
void resume();
void disconnect();
void tick();
void refreshProfile();
void refreshAssets();
void refreshTokens();
[[nodiscard]] const std::optional<CesiumIonClient::Connection>& getConnection() const;
const CesiumIonClient::Profile& getProfile();
const CesiumIonClient::Assets& getAssets();
const std::vector<CesiumIonClient::Token>& getTokens();
[[nodiscard]] const std::string& getAuthorizeUrl() const {
return this->_authorizeUrl;
}
bool refreshProfileIfNeeded();
bool refreshAssetsIfNeeded();
bool refreshTokensIfNeeded();
/**
* Finds the details of the specified token in the user's account.
*
* If this session is not connected, returns std::nullopt.
*
* Even if the list of tokens is already loaded, this method does a new query
* in order get the most up-to-date information about the token.
*
* @param token The token.
* @return The details of the token, or an error response if the token does
* not exist in the signed-in user account.
*/
[[nodiscard]] CesiumAsync::Future<CesiumIonClient::Response<CesiumIonClient::Token>>
findToken(const std::string& token) const;
private:
CesiumAsync::AsyncSystem _asyncSystem;
std::shared_ptr<CesiumAsync::IAssetAccessor> _pAssetAccessor;
std::optional<CesiumIonClient::Connection> _connection;
std::optional<CesiumIonClient::Profile> _profile;
std::optional<CesiumIonClient::Assets> _assets;
std::optional<std::vector<CesiumIonClient::Token>> _tokens;
std::optional<CesiumAsync::SharedFuture<CesiumIonClient::Token>> _projectDefaultTokenDetailsFuture;
bool _isConnecting;
bool _isResuming;
bool _isLoadingProfile;
bool _isLoadingAssets;
bool _isLoadingTokens;
bool _loadProfileQueued;
bool _loadAssetsQueued;
bool _loadTokensQueued;
std::string _authorizeUrl;
std::string _ionServerUrl;
std::string _ionApiUrl;
int64_t _ionApplicationId;
};
} // namespace cesium::omniverse
| 4,107 | C | 28.768116 | 103 | 0.679815 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricPrepareRenderResources.h | #pragma once
#ifdef CESIUM_OMNI_MSVC
#pragma push_macro("OPAQUE")
#undef OPAQUE
#endif
#include <Cesium3DTilesSelection/IPrepareRendererResources.h>
namespace cesium::omniverse {
class Context;
struct FabricMesh;
class OmniTileset;
class FabricPrepareRenderResources final : public Cesium3DTilesSelection::IPrepareRendererResources {
public:
FabricPrepareRenderResources(Context* pContext, OmniTileset* pTileset);
~FabricPrepareRenderResources() override = default;
FabricPrepareRenderResources(const FabricPrepareRenderResources&) = delete;
FabricPrepareRenderResources& operator=(const FabricPrepareRenderResources&) = delete;
FabricPrepareRenderResources(FabricPrepareRenderResources&&) noexcept = default;
FabricPrepareRenderResources& operator=(FabricPrepareRenderResources&&) noexcept = default;
CesiumAsync::Future<Cesium3DTilesSelection::TileLoadResultAndRenderResources> prepareInLoadThread(
const CesiumAsync::AsyncSystem& asyncSystem,
Cesium3DTilesSelection::TileLoadResult&& tileLoadResult,
const glm::dmat4& tileToEcefTransform,
const std::any& rendererOptions) override;
void* prepareInMainThread(Cesium3DTilesSelection::Tile& tile, void* pLoadThreadResult) override;
void free(Cesium3DTilesSelection::Tile& tile, void* pLoadThreadResult, void* pMainThreadResult) noexcept override;
void* prepareRasterInLoadThread(CesiumGltf::ImageCesium& image, const std::any& rendererOptions) override;
void*
prepareRasterInMainThread(CesiumRasterOverlays::RasterOverlayTile& rasterTile, void* pLoadThreadResult) override;
void freeRaster(
const CesiumRasterOverlays::RasterOverlayTile& rasterTile,
void* pLoadThreadResult,
void* pMainThreadResult) noexcept override;
void attachRasterInMainThread(
const Cesium3DTilesSelection::Tile& tile,
int32_t overlayTextureCoordinateID,
const CesiumRasterOverlays::RasterOverlayTile& rasterTile,
void* pMainThreadRendererResources,
const glm::dvec2& translation,
const glm::dvec2& scale) override;
void detachRasterInMainThread(
const Cesium3DTilesSelection::Tile& tile,
int32_t overlayTextureCoordinateID,
const CesiumRasterOverlays::RasterOverlayTile& rasterTile,
void* pMainThreadRendererResources) noexcept override;
[[nodiscard]] bool tilesetExists() const;
void detachTileset();
private:
Context* _pContext;
OmniTileset* _pTileset;
};
} // namespace cesium::omniverse
| 2,547 | C | 36.470588 | 118 | 0.769533 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/CppUtil.h | #pragma once
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <map>
#include <optional>
#include <set>
#include <unordered_set>
#include <vector>
namespace cesium::omniverse::CppUtil {
template <typename T, typename L, uint64_t... I> const auto& dispatchImpl(std::index_sequence<I...>, L lambda) {
static std::array<decltype(lambda(std::integral_constant<T, T(0)>{})), sizeof...(I)> array = {
{lambda(std::integral_constant<T, T(I)>{})...}};
return array;
}
template <uint64_t T_COUNT, typename T, typename L, typename... P> auto dispatch(L lambda, T n, P&&... p) {
const auto& array = dispatchImpl<T>(std::make_index_sequence<T_COUNT>{}, lambda);
return array[static_cast<uint64_t>(n)](std::forward<P>(p)...);
}
template <typename T> const T& defaultValue(const T* pValue, const T& defaultValue) {
return pValue ? *pValue : defaultValue;
}
template <typename T, typename U> T defaultValue(const std::optional<U>& optional, const T& defaultValue) {
return optional.has_value() ? static_cast<T>(optional.value()) : defaultValue;
}
template <typename T> uint64_t getIndexFromRef(const std::vector<T>& vector, const T& item) {
return static_cast<uint64_t>(&item - vector.data());
};
template <typename T, typename U> std::optional<T> castOptional(const std::optional<U>& optional) {
return optional.has_value() ? std::make_optional(static_cast<T>(optional.value())) : std::nullopt;
}
template <typename T, typename U> uint64_t indexOf(const std::vector<T>& vector, const U& value) {
return static_cast<uint64_t>(std::distance(vector.begin(), std::find(vector.begin(), vector.end(), value)));
}
template <typename T, typename U> uint64_t indexOfByMember(const std::vector<T>& vector, U T::*member, const U& value) {
return static_cast<uint64_t>(
std::distance(vector.begin(), std::find_if(vector.begin(), vector.end(), [&value, &member](const auto& item) {
return item.*member == value;
})));
}
template <typename T, typename U> bool contains(const std::vector<T>& vector, const U& value) {
return std::find(vector.begin(), vector.end(), value) != vector.end();
}
// In C++ 20 we can use std::ranges::common_range instead of having a separate version for std::array
template <typename T, size_t C, typename U> bool contains(const std::array<T, C>& array, const U& value) {
return std::find(array.begin(), array.end(), value) != array.end();
}
template <typename T, typename U> bool contains(const std::unordered_set<T>& set, const U& value) {
return set.find(value) != set.end();
}
template <typename T, typename U> bool contains(const std::map<T, U>& map, const U& value) {
return map.find(value) != map.end();
}
template <typename T, typename U> bool containsByMember(const std::vector<T>& vector, U T::*member, const U& value) {
return indexOfByMember(vector, member, value) != vector.size();
}
template <typename T, typename F> bool containsIf(const std::vector<T>& vector, const F& condition) {
return std::find_if(vector.begin(), vector.end(), condition) != vector.end();
}
template <typename T, typename F> void eraseIf(std::vector<T>& vector, const F& condition) {
vector.erase(std::remove_if(vector.begin(), vector.end(), condition), vector.end());
}
template <typename T, typename F> uint64_t countIf(const std::vector<T>& vector, const F& condition) {
return static_cast<uint64_t>(std::count_if(vector.begin(), vector.end(), condition));
}
template <typename T> const T& getElementByIndex(const std::set<T>& set, uint64_t index) {
assert(index < set.size());
return *std::next(set.begin(), static_cast<int>(index));
}
template <typename T, typename F> void sort(std::vector<T>& vector, const F& comparison) {
std::sort(vector.begin(), vector.end(), comparison);
}
template <typename T> void append(std::vector<T>& vector, const std::vector<T>& append) {
vector.insert(vector.end(), append.begin(), append.end());
}
template <typename T, typename F> constexpr auto hasMemberImpl(F&& f) -> decltype(f(std::declval<T>()), true) {
return true;
}
template <typename> constexpr bool hasMemberImpl(...) {
return false;
}
#define HAS_MEMBER(T, EXPR) CppUtil::hasMemberImpl<T>([](auto&& obj) -> decltype(obj.EXPR) {})
} // namespace cesium::omniverse::CppUtil
| 4,382 | C | 38.845454 | 120 | 0.67435 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/Logger.h | #pragma once
#include "cesium/omniverse/CppUtil.h"
#include <spdlog/logger.h>
#include <unordered_set>
namespace cesium::omniverse {
class Logger final : public spdlog::logger {
public:
Logger();
template <typename T> void oneTimWarning(const T& warning) {
if (CppUtil::contains(_oneTimeWarnings, warning)) {
return;
}
_oneTimeWarnings.insert(warning);
warn(warning);
}
template <typename... Args> void oneTimeWarning(spdlog::format_string_t<Args...> fmt, Args&&... args) {
const auto warning = fmt::format(fmt, std::forward<Args>(args)...);
if (CppUtil::contains(_oneTimeWarnings, warning)) {
return;
}
_oneTimeWarnings.insert(warning);
warn(warning);
}
private:
std::unordered_set<std::string> _oneTimeWarnings;
};
} // namespace cesium::omniverse
| 886 | C | 21.174999 | 107 | 0.623025 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/UrlAssetAccessor.h | /* <editor-fold desc="MIT License">
Copyright(c) 2023 Timothy Moore
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</editor-fold> */
#pragma once
#include "CesiumAsync/AsyncSystem.h"
#include "CesiumAsync/IAssetAccessor.h"
#include <curl/curl.h>
#include <cstddef>
#include <filesystem>
#include <memory>
#include <mutex>
#include <vector>
namespace cesium::omniverse {
// A cache that permits reuse of CURL handles. This is extremely important for performance
// because libcurl will keep existing connections open if a curl handle is not destroyed
// ("cleaned up").
struct CurlCache {
struct CacheEntry {
CacheEntry()
: curl(nullptr)
, free(false) {}
CacheEntry(CURL* curl_, bool free_)
: curl(curl_)
, free(free_) {}
CURL* curl;
bool free;
};
std::mutex cacheMutex;
std::vector<CacheEntry> cache;
CURL* get() {
std::lock_guard<std::mutex> lock(cacheMutex);
for (auto& entry : cache) {
if (entry.free) {
entry.free = false;
return entry.curl;
}
}
cache.emplace_back(curl_easy_init(), false);
return cache.back().curl;
}
void release(CURL* curl) {
std::lock_guard<std::mutex> lock(cacheMutex);
for (auto& entry : cache) {
if (curl == entry.curl) {
curl_easy_reset(curl);
entry.free = true;
return;
}
}
throw std::logic_error("releasing a curl handle that is not in the cache");
}
};
// Simple implementation of AssetAcessor that can make network and local requests
class UrlAssetAccessor final : public CesiumAsync::IAssetAccessor {
public:
UrlAssetAccessor(const std::filesystem::path& certificatePath = {});
~UrlAssetAccessor() override;
CesiumAsync::Future<std::shared_ptr<CesiumAsync::IAssetRequest>>
get(const CesiumAsync::AsyncSystem& asyncSystem,
const std::string& url,
const std::vector<CesiumAsync::IAssetAccessor::THeader>& headers) override;
CesiumAsync::Future<std::shared_ptr<CesiumAsync::IAssetRequest>> request(
const CesiumAsync::AsyncSystem& asyncSystem,
const std::string& verb,
const std::string& url,
const std::vector<CesiumAsync::IAssetAccessor::THeader>& headers,
const gsl::span<const std::byte>& contentPayload) override;
void tick() noexcept override;
friend class CurlHandle;
private:
CurlCache curlCache;
std::string userAgent;
curl_slist* setCommonOptions(CURL* curl, const std::string& url, const CesiumAsync::HttpHeaders& headers);
std::string _certificatePath;
};
} // namespace cesium::omniverse
| 3,738 | C | 33.62037 | 110 | 0.68031 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniTileset.h | #pragma once
#include <glm/glm.hpp>
#include <pxr/usd/sdf/path.h>
#include <optional>
#include <gsl/span>
namespace Cesium3DTilesSelection {
class Tileset;
class ViewState;
class ViewUpdateResult;
} // namespace Cesium3DTilesSelection
namespace CesiumRasterOverlays {
class RasterOverlay;
}
namespace CesiumGltf {
struct Model;
}
namespace CesiumIonClient {
struct Token;
}
namespace cesium::omniverse {
class Context;
class FabricPrepareRenderResources;
class OmniRasterOverlay;
struct TilesetStatistics;
struct Viewport;
enum TilesetSourceType {
ION,
URL,
};
class OmniTileset {
public:
OmniTileset(Context* pContext, const pxr::SdfPath& path, int64_t tilesetId);
~OmniTileset();
OmniTileset(const OmniTileset&) = delete;
OmniTileset& operator=(const OmniTileset&) = delete;
OmniTileset(OmniTileset&&) noexcept = default;
OmniTileset& operator=(OmniTileset&&) noexcept = default;
[[nodiscard]] const pxr::SdfPath& getPath() const;
[[nodiscard]] int64_t getTilesetId() const;
[[nodiscard]] TilesetStatistics getStatistics() const;
[[nodiscard]] TilesetSourceType getSourceType() const;
[[nodiscard]] std::string getUrl() const;
[[nodiscard]] int64_t getIonAssetId() const;
[[nodiscard]] CesiumIonClient::Token getIonAccessToken() const;
[[nodiscard]] std::string getIonApiUrl() const;
[[nodiscard]] pxr::SdfPath getResolvedIonServerPath() const;
[[nodiscard]] double getMaximumScreenSpaceError() const;
[[nodiscard]] bool getPreloadAncestors() const;
[[nodiscard]] bool getPreloadSiblings() const;
[[nodiscard]] bool getForbidHoles() const;
[[nodiscard]] uint32_t getMaximumSimultaneousTileLoads() const;
[[nodiscard]] uint64_t getMaximumCachedBytes() const;
[[nodiscard]] uint32_t getLoadingDescendantLimit() const;
[[nodiscard]] bool getEnableFrustumCulling() const;
[[nodiscard]] bool getEnableFogCulling() const;
[[nodiscard]] bool getEnforceCulledScreenSpaceError() const;
[[nodiscard]] double getMainThreadLoadingTimeLimit() const;
[[nodiscard]] double getCulledScreenSpaceError() const;
[[nodiscard]] bool getSuspendUpdate() const;
[[nodiscard]] bool getSmoothNormals() const;
[[nodiscard]] bool getShowCreditsOnScreen() const;
[[nodiscard]] pxr::SdfPath getResolvedGeoreferencePath() const;
[[nodiscard]] pxr::SdfPath getMaterialPath() const;
[[nodiscard]] glm::dvec3 getDisplayColor() const;
[[nodiscard]] double getDisplayOpacity() const;
[[nodiscard]] std::vector<pxr::SdfPath> getRasterOverlayPaths() const;
void updateTilesetOptions();
void reload();
[[nodiscard]] pxr::SdfPath getRasterOverlayPathIfExists(const CesiumRasterOverlays::RasterOverlay& rasterOverlay);
void updateRasterOverlayAlpha(const pxr::SdfPath& rasterOverlayPath);
void updateShaderInput(const pxr::SdfPath& shaderPath, const pxr::TfToken& attributeName);
void updateDisplayColorAndOpacity();
void addRasterOverlayIfExists(const OmniRasterOverlay* overlay);
void onUpdateFrame(const gsl::span<const Viewport>& viewports, bool waitForLoadingTiles);
private:
void updateTransform();
void updateView(const gsl::span<const Viewport>& viewports, bool waitForLoadingTiles);
[[nodiscard]] bool updateExtent();
void updateLoadStatus();
void destroyNativeTileset();
std::unique_ptr<Cesium3DTilesSelection::Tileset> _pTileset;
std::shared_ptr<FabricPrepareRenderResources> _pRenderResourcesPreparer;
const Cesium3DTilesSelection::ViewUpdateResult* _pViewUpdateResult;
Context* _pContext;
pxr::SdfPath _path;
int64_t _tilesetId;
glm::dmat4 _ecefToPrimWorldTransform{};
std::vector<Cesium3DTilesSelection::ViewState> _viewStates;
bool _extentSet{false};
bool _activeLoading{false};
};
} // namespace cesium::omniverse
| 3,856 | C | 32.833333 | 118 | 0.739108 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/DataType.h | #pragma once
namespace cesium::omniverse {
enum class DataType {
UINT8,
INT8,
UINT16,
INT16,
UINT32,
INT32,
UINT64,
INT64,
FLOAT32,
FLOAT64,
UINT8_NORM,
INT8_NORM,
UINT16_NORM,
INT16_NORM,
UINT32_NORM,
INT32_NORM,
UINT64_NORM,
INT64_NORM,
VEC2_UINT8,
VEC2_INT8,
VEC2_UINT16,
VEC2_INT16,
VEC2_UINT32,
VEC2_INT32,
VEC2_UINT64,
VEC2_INT64,
VEC2_FLOAT32,
VEC2_FLOAT64,
VEC2_UINT8_NORM,
VEC2_INT8_NORM,
VEC2_UINT16_NORM,
VEC2_INT16_NORM,
VEC2_UINT32_NORM,
VEC2_INT32_NORM,
VEC2_UINT64_NORM,
VEC2_INT64_NORM,
VEC3_UINT8,
VEC3_INT8,
VEC3_UINT16,
VEC3_INT16,
VEC3_UINT32,
VEC3_INT32,
VEC3_UINT64,
VEC3_INT64,
VEC3_FLOAT32,
VEC3_FLOAT64,
VEC3_UINT8_NORM,
VEC3_INT8_NORM,
VEC3_UINT16_NORM,
VEC3_INT16_NORM,
VEC3_UINT32_NORM,
VEC3_INT32_NORM,
VEC3_UINT64_NORM,
VEC3_INT64_NORM,
VEC4_UINT8,
VEC4_INT8,
VEC4_UINT16,
VEC4_INT16,
VEC4_UINT32,
VEC4_INT32,
VEC4_UINT64,
VEC4_INT64,
VEC4_FLOAT32,
VEC4_FLOAT64,
VEC4_UINT8_NORM,
VEC4_INT8_NORM,
VEC4_UINT16_NORM,
VEC4_INT16_NORM,
VEC4_UINT32_NORM,
VEC4_INT32_NORM,
VEC4_UINT64_NORM,
VEC4_INT64_NORM,
MAT2_UINT8,
MAT2_INT8,
MAT2_UINT16,
MAT2_INT16,
MAT2_UINT32,
MAT2_INT32,
MAT2_UINT64,
MAT2_INT64,
MAT2_FLOAT32,
MAT2_FLOAT64,
MAT2_UINT8_NORM,
MAT2_INT8_NORM,
MAT2_UINT16_NORM,
MAT2_INT16_NORM,
MAT2_UINT32_NORM,
MAT2_INT32_NORM,
MAT2_UINT64_NORM,
MAT2_INT64_NORM,
MAT3_UINT8,
MAT3_INT8,
MAT3_UINT16,
MAT3_INT16,
MAT3_UINT32,
MAT3_INT32,
MAT3_UINT64,
MAT3_INT64,
MAT3_FLOAT32,
MAT3_FLOAT64,
MAT3_UINT8_NORM,
MAT3_INT8_NORM,
MAT3_UINT16_NORM,
MAT3_INT16_NORM,
MAT3_UINT32_NORM,
MAT3_INT32_NORM,
MAT3_UINT64_NORM,
MAT3_INT64_NORM,
MAT4_UINT8,
MAT4_INT8,
MAT4_UINT16,
MAT4_INT16,
MAT4_UINT32,
MAT4_INT32,
MAT4_UINT64,
MAT4_INT64,
MAT4_FLOAT32,
MAT4_FLOAT64,
MAT4_UINT8_NORM,
MAT4_INT8_NORM,
MAT4_UINT16_NORM,
MAT4_INT16_NORM,
MAT4_UINT32_NORM,
MAT4_INT32_NORM,
MAT4_UINT64_NORM,
MAT4_INT64_NORM,
};
enum class MdlInternalPropertyType {
INT32,
FLOAT32,
INT32_NORM,
VEC2_INT32,
VEC2_FLOAT32,
VEC2_INT32_NORM,
VEC3_INT32,
VEC3_FLOAT32,
VEC3_INT32_NORM,
VEC4_INT32,
VEC4_FLOAT32,
VEC4_INT32_NORM,
MAT2_INT32,
MAT2_FLOAT32,
MAT2_INT32_NORM,
MAT3_INT32,
MAT3_FLOAT32,
MAT3_INT32_NORM,
MAT4_INT32,
MAT4_FLOAT32,
MAT4_INT32_NORM,
};
enum class MdlExternalPropertyType {
INT32,
FLOAT32,
VEC2_INT32,
VEC2_FLOAT32,
VEC3_INT32,
VEC3_FLOAT32,
VEC4_INT32,
VEC4_FLOAT32,
MAT2_FLOAT32,
MAT3_FLOAT32,
MAT4_FLOAT32,
};
} // namespace cesium::omniverse
| 2,998 | C | 16.33526 | 36 | 0.602068 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricVertexAttributeAccessors.h | #pragma once
#include "cesium/omniverse/DataType.h"
#include "cesium/omniverse/DataTypeUtil.h"
#ifdef CESIUM_OMNI_MSVC
#pragma push_macro("OPAQUE")
#undef OPAQUE
#endif
#include <CesiumGltf/AccessorView.h>
#include <glm/fwd.hpp>
#include <gsl/span>
namespace cesium::omniverse {
class PositionsAccessor {
public:
PositionsAccessor();
PositionsAccessor(const CesiumGltf::AccessorView<glm::fvec3>& view);
void fill(const gsl::span<glm::fvec3>& values) const;
[[nodiscard]] const glm::fvec3& get(uint64_t index) const;
[[nodiscard]] uint64_t size() const;
private:
CesiumGltf::AccessorView<glm::fvec3> _view;
uint64_t _size;
};
class IndicesAccessor {
public:
IndicesAccessor();
IndicesAccessor(uint64_t size);
IndicesAccessor(const CesiumGltf::AccessorView<uint8_t>& uint8View);
IndicesAccessor(const CesiumGltf::AccessorView<uint16_t>& uint16View);
IndicesAccessor(const CesiumGltf::AccessorView<uint32_t>& uint32View);
template <typename T> static IndicesAccessor FromTriangleStrips(const CesiumGltf::AccessorView<T>& view);
template <typename T> static IndicesAccessor FromTriangleFans(const CesiumGltf::AccessorView<T>& view);
void fill(const gsl::span<int>& values) const;
[[nodiscard]] uint32_t get(uint64_t index) const;
[[nodiscard]] uint64_t size() const;
private:
std::vector<uint32_t> _computed;
CesiumGltf::AccessorView<uint8_t> _uint8View;
CesiumGltf::AccessorView<uint16_t> _uint16View;
CesiumGltf::AccessorView<uint32_t> _uint32View;
uint64_t _size;
};
class NormalsAccessor {
public:
NormalsAccessor();
NormalsAccessor(const CesiumGltf::AccessorView<glm::fvec3>& view);
static NormalsAccessor GenerateSmooth(const PositionsAccessor& positions, const IndicesAccessor& indices);
void fill(const gsl::span<glm::fvec3>& values) const;
[[nodiscard]] uint64_t size() const;
private:
std::vector<glm::fvec3> _computed;
CesiumGltf::AccessorView<glm::fvec3> _view;
uint64_t _size;
};
class TexcoordsAccessor {
public:
TexcoordsAccessor();
TexcoordsAccessor(const CesiumGltf::AccessorView<glm::fvec2>& view, bool flipVertical);
void fill(const gsl::span<glm::fvec2>& values) const;
[[nodiscard]] uint64_t size() const;
private:
CesiumGltf::AccessorView<glm::fvec2> _view;
bool _flipVertical;
uint64_t _size;
};
class VertexColorsAccessor {
public:
VertexColorsAccessor();
VertexColorsAccessor(const CesiumGltf::AccessorView<glm::u8vec3>& uint8Vec3View);
VertexColorsAccessor(const CesiumGltf::AccessorView<glm::u8vec4>& uint8Vec4View);
VertexColorsAccessor(const CesiumGltf::AccessorView<glm::u16vec3>& uint16Vec3View);
VertexColorsAccessor(const CesiumGltf::AccessorView<glm::u16vec4>& uint16Vec4View);
VertexColorsAccessor(const CesiumGltf::AccessorView<glm::fvec3>& float32Vec3View);
VertexColorsAccessor(const CesiumGltf::AccessorView<glm::fvec4>& float32Vec4View);
/**
* @brief Copy accessor values to the given output values, including any data transformations.
*
* @param values The output values.
* @param repeat Indicates how many times each value in the accessor should be repeated in the output. Typically repeat is 1, but for voxel point clouds repeat is 8.
*/
void fill(const gsl::span<glm::fvec4>& values, uint64_t repeat = 1) const;
[[nodiscard]] uint64_t size() const;
private:
CesiumGltf::AccessorView<glm::u8vec3> _uint8Vec3View;
CesiumGltf::AccessorView<glm::u8vec4> _uint8Vec4View;
CesiumGltf::AccessorView<glm::u16vec3> _uint16Vec3View;
CesiumGltf::AccessorView<glm::u16vec4> _uint16Vec4View;
CesiumGltf::AccessorView<glm::fvec3> _float32Vec3View;
CesiumGltf::AccessorView<glm::fvec4> _float32Vec4View;
uint64_t _size;
};
class VertexIdsAccessor {
public:
VertexIdsAccessor();
VertexIdsAccessor(uint64_t size);
void fill(const gsl::span<float>& values, uint64_t repeat = 1) const;
[[nodiscard]] uint64_t size() const;
private:
uint64_t _size;
};
class FaceVertexCountsAccessor {
public:
FaceVertexCountsAccessor();
FaceVertexCountsAccessor(uint64_t size);
void fill(const gsl::span<int>& values) const;
[[nodiscard]] uint64_t size() const;
private:
uint64_t _size;
};
template <DataType T> class VertexAttributeAccessor {
public:
VertexAttributeAccessor()
: _size(0){};
VertexAttributeAccessor(const CesiumGltf::AccessorView<DataTypeUtil::GetNativeType<T>>& view)
: _view(view)
, _size(static_cast<uint64_t>(view.size())) {}
void fill(
const gsl::span<DataTypeUtil::GetNativeType<DataTypeUtil::getPrimvarType<T>()>>& values,
uint64_t repeat = 1) const {
const auto size = values.size();
assert(size == _size * repeat);
for (uint64_t i = 0; i < size; ++i) {
values[i] = static_cast<DataTypeUtil::GetNativeType<DataTypeUtil::getPrimvarType<T>()>>(
_view[static_cast<int64_t>(i / repeat)]);
}
}
[[nodiscard]] uint64_t size() const {
return _size;
}
private:
CesiumGltf::AccessorView<DataTypeUtil::GetNativeType<T>> _view;
uint64_t _size;
};
} // namespace cesium::omniverse
| 5,285 | C | 30.094117 | 169 | 0.70123 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricGeometryPool.h | #pragma once
#include "cesium/omniverse/FabricGeometry.h"
#include "cesium/omniverse/FabricGeometryDescriptor.h"
#include "cesium/omniverse/ObjectPool.h"
namespace cesium::omniverse {
class FabricGeometryPool final : public ObjectPool<FabricGeometry> {
public:
FabricGeometryPool(
Context* pContext,
int64_t poolId,
const FabricGeometryDescriptor& geometryDescriptor,
uint64_t initialCapacity);
~FabricGeometryPool() override = default;
FabricGeometryPool(const FabricGeometryPool&) = delete;
FabricGeometryPool& operator=(const FabricGeometryPool&) = delete;
FabricGeometryPool(FabricGeometryPool&&) noexcept = default;
FabricGeometryPool& operator=(FabricGeometryPool&&) noexcept = default;
[[nodiscard]] const FabricGeometryDescriptor& getGeometryDescriptor() const;
[[nodiscard]] int64_t getPoolId() const;
protected:
[[nodiscard]] std::shared_ptr<FabricGeometry> createObject(uint64_t objectId) const override;
void setActive(FabricGeometry* pGeometry, bool active) const override;
private:
Context* _pContext;
int64_t _poolId;
FabricGeometryDescriptor _geometryDescriptor;
};
} // namespace cesium::omniverse
| 1,212 | C | 32.694444 | 97 | 0.750825 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricGeometryDescriptor.h | #pragma once
#include <cstdint>
#include <set>
namespace CesiumGltf {
struct MeshPrimitive;
struct Model;
} // namespace CesiumGltf
namespace cesium::omniverse {
struct FabricFeaturesInfo;
struct FabricVertexAttributeDescriptor;
/**
* @brief A descriptor used to initialize a {@link FabricGeometry} and {@link FabricGeometryPool}.
*
* The descriptor uniquely identifies the topology of a {@link FabricGeometry} i.e. what Fabric
* attributes are added to the prim, but not the actual values.
*
* Geometries that have the same geometry descriptor will be assigned to the same geometry pool.
* To reduce the number of geometry pools that are needed the list of member variables should be
* as limited as possible.
*/
class FabricGeometryDescriptor {
public:
FabricGeometryDescriptor(
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
const FabricFeaturesInfo& featuresInfo,
bool smoothNormals);
[[nodiscard]] bool hasNormals() const;
[[nodiscard]] bool hasVertexColors() const;
[[nodiscard]] bool hasVertexIds() const;
[[nodiscard]] uint64_t getTexcoordSetCount() const;
[[nodiscard]] const std::set<FabricVertexAttributeDescriptor>& getCustomVertexAttributes() const;
bool operator==(const FabricGeometryDescriptor& other) const;
private:
bool _hasNormals{false};
bool _hasVertexColors{false};
bool _hasVertexIds{false};
uint64_t _texcoordSetCount{0};
// std::set is sorted which is important for checking FabricGeometryDescriptor equality
// Note that features ids are treated as custom vertex attributes since they don't have specific parsing behavior
std::set<FabricVertexAttributeDescriptor> _customVertexAttributes;
};
} // namespace cesium::omniverse
| 1,783 | C | 32.037036 | 117 | 0.751542 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricPropertyInfo.h | #pragma once
#include "cesium/omniverse/DataType.h"
#include "cesium/omniverse/DataTypeUtil.h"
#include "cesium/omniverse/FabricTextureInfo.h"
namespace cesium::omniverse {
template <DataType T> struct FabricPropertyInfo {
std::optional<DataTypeUtil::GetNativeType<DataTypeUtil::getTransformedType<T>()>> offset;
std::optional<DataTypeUtil::GetNativeType<DataTypeUtil::getTransformedType<T>()>> scale;
std::optional<DataTypeUtil::GetNativeType<DataTypeUtil::getTransformedType<T>()>> min;
std::optional<DataTypeUtil::GetNativeType<DataTypeUtil::getTransformedType<T>()>> max;
bool required;
std::optional<DataTypeUtil::GetNativeType<T>> noData;
std::optional<DataTypeUtil::GetNativeType<DataTypeUtil::getTransformedType<T>()>> defaultValue;
};
template <DataType T> struct FabricPropertyAttributePropertyInfo {
static constexpr auto Type = T;
std::string attribute;
FabricPropertyInfo<T> propertyInfo;
};
template <DataType T> struct FabricPropertyTexturePropertyInfo {
static constexpr auto Type = T;
FabricTextureInfo textureInfo;
uint64_t textureIndex;
FabricPropertyInfo<T> propertyInfo;
};
template <DataType T> struct FabricPropertyTablePropertyInfo {
static constexpr auto Type = T;
uint64_t featureIdSetIndex;
FabricPropertyInfo<T> propertyInfo;
};
} // namespace cesium::omniverse
| 1,365 | C | 34.02564 | 99 | 0.7663 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricAttributesBuilder.h | #pragma once
#include <omni/fabric/AttrNameAndType.h>
namespace omni::fabric {
class StageReaderWriter;
}
namespace cesium::omniverse {
class Context;
class FabricAttributesBuilder {
public:
FabricAttributesBuilder(Context* pContext);
~FabricAttributesBuilder() = default;
FabricAttributesBuilder(const FabricAttributesBuilder&) = delete;
FabricAttributesBuilder& operator=(const FabricAttributesBuilder&) = delete;
FabricAttributesBuilder(FabricAttributesBuilder&&) noexcept = default;
FabricAttributesBuilder& operator=(FabricAttributesBuilder&&) noexcept = default;
void addAttribute(const omni::fabric::Type& type, const omni::fabric::Token& name);
void createAttributes(const omni::fabric::Path& path) const;
private:
static const uint64_t MAX_ATTRIBUTES{30};
uint64_t _size{0};
std::array<omni::fabric::AttrNameAndType, MAX_ATTRIBUTES> _attributes;
Context* _pContext;
};
} // namespace cesium::omniverse
| 971 | C | 28.454545 | 87 | 0.753862 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniPolygonRasterOverlay.h | #pragma once
#include "cesium/omniverse/OmniRasterOverlay.h"
#include <Cesium3DTilesSelection/RasterizedPolygonsTileExcluder.h>
#include <CesiumRasterOverlays/RasterizedPolygonsOverlay.h>
#include <CesiumUtility/IntrusivePointer.h>
namespace cesium::omniverse {
class OmniPolygonRasterOverlay final : public OmniRasterOverlay {
public:
OmniPolygonRasterOverlay(Context* pContext, const pxr::SdfPath& path);
~OmniPolygonRasterOverlay() override = default;
OmniPolygonRasterOverlay(const OmniPolygonRasterOverlay&) = delete;
OmniPolygonRasterOverlay& operator=(const OmniPolygonRasterOverlay&) = delete;
OmniPolygonRasterOverlay(OmniPolygonRasterOverlay&&) noexcept = default;
OmniPolygonRasterOverlay& operator=(OmniPolygonRasterOverlay&&) noexcept = default;
[[nodiscard]] std::vector<pxr::SdfPath> getCartographicPolygonPaths() const;
[[nodiscard]] CesiumRasterOverlays::RasterOverlay* getRasterOverlay() const override;
[[nodiscard]] bool getInvertSelection() const;
[[nodiscard]] bool getExcludeSelectedTiles() const;
[[nodiscard]] std::shared_ptr<Cesium3DTilesSelection::RasterizedPolygonsTileExcluder> getExcluder();
void reload() override;
private:
CesiumUtility::IntrusivePointer<CesiumRasterOverlays::RasterizedPolygonsOverlay> _pPolygonRasterOverlay;
std::shared_ptr<Cesium3DTilesSelection::RasterizedPolygonsTileExcluder> _pExcluder;
};
} // namespace cesium::omniverse
| 1,446 | C | 44.218749 | 108 | 0.797372 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/Broadcast.h | #pragma once
// clang-format off
// carb/events/IObject.h should include this
#include <utility>
// clang-format on
#include <carb/events/IEvents.h>
#include <pxr/usd/usd/common.h>
namespace cesium::omniverse::Broadcast {
void assetsUpdated();
void connectionUpdated();
void profileUpdated();
void tokensUpdated();
void showTroubleshooter(
const pxr::SdfPath& tilesetPath,
int64_t tilesetIonAssetId,
const std::string& tilesetName,
int64_t rasterOverlayIonAssetId,
const std::string& rasterOverlayName,
const std::string& message);
void setDefaultTokenComplete();
void tilesetLoaded(const pxr::SdfPath& tilesetPath);
void sendMessageToBus(carb::events::EventType eventType);
void sendMessageToBus(const std::string_view& eventKey);
} // namespace cesium::omniverse::Broadcast
| 805 | C | 25.866666 | 57 | 0.762733 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricTexture.h | #pragma once
#include <carb/RenderingTypes.h>
#include <pxr/base/tf/token.h>
#include <memory>
#include <string>
namespace omni::ui {
class DynamicTextureProvider;
}
namespace CesiumGltf {
struct ImageCesium;
}
namespace cesium::omniverse {
class Context;
enum class TransferFunction {
LINEAR,
SRGB,
};
class FabricTexture {
public:
FabricTexture(Context* pContext, const std::string& name, int64_t poolId);
~FabricTexture();
FabricTexture(const FabricTexture&) = delete;
FabricTexture& operator=(const FabricTexture&) = delete;
FabricTexture(FabricTexture&&) noexcept = default;
FabricTexture& operator=(FabricTexture&&) noexcept = default;
void setImage(const CesiumGltf::ImageCesium& image, TransferFunction transferFunction);
void setBytes(const std::vector<std::byte>& bytes, uint64_t width, uint64_t height, carb::Format format);
void setActive(bool active);
[[nodiscard]] const pxr::TfToken& getAssetPathToken() const;
[[nodiscard]] int64_t getPoolId() const;
private:
void reset();
Context* _pContext;
std::unique_ptr<omni::ui::DynamicTextureProvider> _pTexture;
pxr::TfToken _assetPathToken;
int64_t _poolId;
};
} // namespace cesium::omniverse
| 1,243 | C | 22.923076 | 109 | 0.716814 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/ObjectPool.h | #pragma once
#include <cassert>
#include <memory>
#include <queue>
namespace cesium::omniverse {
template <typename T> class ObjectPool {
public:
ObjectPool() = default;
virtual ~ObjectPool() = default;
std::shared_ptr<T> acquire() {
const auto percentActive = computePercentActive();
if (percentActive > _doublingThreshold) {
// Capacity is initially 0, so make sure the new capacity is at least 1
const auto newCapacity = std::max(_capacity * 2, uint64_t(1));
setCapacity(newCapacity);
}
auto pObject = _queue.front();
_queue.pop_front();
setActive(pObject.get(), true);
return pObject;
}
void release(std::shared_ptr<T> pObject) {
_queue.push_back(pObject);
setActive(pObject.get(), false);
}
[[nodiscard]] uint64_t getCapacity() const {
return _capacity;
}
[[nodiscard]] uint64_t getNumberActive() const {
return getCapacity() - getNumberInactive();
}
[[nodiscard]] uint64_t getNumberInactive() const {
return _queue.size();
}
[[nodiscard]] bool isEmpty() const {
return getNumberInactive() == getCapacity();
}
[[nodiscard]] double computePercentActive() const {
const auto numberActive = static_cast<double>(getNumberActive());
const auto capacity = static_cast<double>(getCapacity());
if (capacity == 0) {
return 1.0;
}
return numberActive / capacity;
}
void setCapacity(uint64_t capacity) {
const auto oldCapacity = _capacity;
const auto newCapacity = capacity;
assert(newCapacity >= oldCapacity);
if (newCapacity <= oldCapacity) {
// We can't shrink capacity because it would mean destroying objects currently in use
return;
}
const auto count = newCapacity - oldCapacity;
for (uint64_t i = 0; i < count; ++i) {
_queue.push_back(createObject(_objectId++));
++_capacity;
}
}
protected:
virtual std::shared_ptr<T> createObject(uint64_t objectId) const = 0;
virtual void setActive(T* pObject, bool active) const = 0;
const std::deque<std::shared_ptr<T>>& getQueue() {
return _queue;
}
private:
std::deque<std::shared_ptr<T>> _queue;
uint64_t _objectId{0};
uint64_t _capacity{0};
double _doublingThreshold{0.75};
};
} // namespace cesium::omniverse
| 2,500 | C | 24.520408 | 97 | 0.5976 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniGlobeAnchor.h | #pragma once
#include <CesiumGeospatial/Cartographic.h>
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <pxr/usd/sdf/path.h>
namespace CesiumGeospatial {
class GlobeAnchor;
class Ellipsoid;
} // namespace CesiumGeospatial
namespace cesium::omniverse {
class Context;
class OmniGlobeAnchor {
public:
OmniGlobeAnchor(Context* pContext, const pxr::SdfPath& path);
~OmniGlobeAnchor();
OmniGlobeAnchor(const OmniGlobeAnchor&) = delete;
OmniGlobeAnchor& operator=(const OmniGlobeAnchor&) = delete;
OmniGlobeAnchor(OmniGlobeAnchor&&) noexcept = default;
OmniGlobeAnchor& operator=(OmniGlobeAnchor&&) noexcept = default;
[[nodiscard]] const pxr::SdfPath& getPath() const;
[[nodiscard]] bool getDetectTransformChanges() const;
[[nodiscard]] bool getAdjustOrientation() const;
[[nodiscard]] pxr::SdfPath getResolvedGeoreferencePath() const;
void updateByEcefPosition();
void updateByGeographicCoordinates();
void updateByPrimLocalTransform(bool resetOrientation);
void updateByGeoreference();
private:
[[nodiscard]] bool isAnchorValid() const;
void initialize();
void finalize();
[[nodiscard]] glm::dvec3 getPrimLocalToEcefTranslation() const;
[[nodiscard]] CesiumGeospatial::Cartographic getGeographicCoordinates() const;
[[nodiscard]] glm::dvec3 getPrimLocalTranslation() const;
[[nodiscard]] glm::dvec3 getPrimLocalRotation() const;
[[nodiscard]] glm::dquat getPrimLocalOrientation() const;
[[nodiscard]] glm::dvec3 getPrimLocalScale() const;
void savePrimLocalToEcefTranslation();
void saveGeographicCoordinates();
void savePrimLocalTransform();
Context* _pContext;
pxr::SdfPath _path;
std::unique_ptr<CesiumGeospatial::GlobeAnchor> _pAnchor;
// These are used for quick comparisons, so we can short circuit successive updates.
glm::dvec3 _cachedPrimLocalToEcefTranslation{0.0};
glm::dvec3 _cachedPrimLocalToEcefRotation{0.0};
glm::dvec3 _cachedPrimLocalToEcefScale{1.0};
CesiumGeospatial::Cartographic _cachedGeographicCoordinates{0.0, 0.0, 0.0};
glm::dvec3 _cachedPrimLocalTranslation{0.0};
glm::dvec3 _cachedPrimLocalRotation{0.0, 0.0, 0.0};
glm::dquat _cachedPrimLocalOrientation{1.0, 0.0, 0.0, 0.0};
glm::dvec3 _cachedPrimLocalScale{1.0};
};
} // namespace cesium::omniverse
| 2,361 | C | 33.735294 | 88 | 0.733587 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/Viewport.h | #pragma once
#include <glm/glm.hpp>
namespace cesium::omniverse {
struct Viewport {
glm::dmat4 viewMatrix;
glm::dmat4 projMatrix;
double width;
double height;
};
} // namespace cesium::omniverse
| 215 | C | 13.399999 | 32 | 0.683721 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/MathUtil.h | #pragma once
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <array>
namespace CesiumGeospatial {
class Cartographic;
}
namespace cesium::omniverse::MathUtil {
enum class EulerAngleOrder {
XYZ,
XZY,
YXZ,
YZX,
ZXY,
ZYX,
};
struct DecomposedEuler {
glm::dvec3 translation;
glm::dvec3 rotation;
glm::dvec3 scale;
};
struct Decomposed {
glm::dvec3 translation;
glm::dquat rotation;
glm::dvec3 scale;
};
EulerAngleOrder getReversedEulerAngleOrder(EulerAngleOrder eulerAngleOrder);
DecomposedEuler decomposeEuler(const glm::dmat4& matrix, EulerAngleOrder eulerAngleOrder);
Decomposed decompose(const glm::dmat4& matrix);
glm::dmat4 composeEuler(
const glm::dvec3& translation,
const glm::dvec3& rotation,
const glm::dvec3& scale,
EulerAngleOrder eulerAngleOrder);
glm::dmat4 compose(const glm::dvec3& translation, const glm::dquat& rotation, const glm::dvec3& scale);
bool equal(const CesiumGeospatial::Cartographic& a, const CesiumGeospatial::Cartographic& b);
bool epsilonEqual(const CesiumGeospatial::Cartographic& a, const CesiumGeospatial::Cartographic& b, double epsilon);
bool epsilonEqual(const glm::dmat4& a, const glm::dmat4& b, double epsilon);
bool epsilonEqual(const glm::dvec3& a, const glm::dvec3& b, double epsilon);
bool epsilonEqual(const glm::dquat& a, const glm::dquat& b, double epsilon);
glm::dvec3 getCorner(const std::array<glm::dvec3, 2>& extent, uint64_t index);
std::array<glm::dvec3, 2> transformExtent(const std::array<glm::dvec3, 2>& extent, const glm::dmat4& transform);
} // namespace cesium::omniverse::MathUtil
| 1,635 | C | 27.206896 | 116 | 0.738226 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricTexturePool.h | #pragma once
#include "cesium/omniverse/FabricTexture.h"
#include "cesium/omniverse/ObjectPool.h"
namespace cesium::omniverse {
class FabricTexturePool final : public ObjectPool<FabricTexture> {
public:
FabricTexturePool(Context* pContext, int64_t poolId, uint64_t initialCapacity);
~FabricTexturePool() override = default;
FabricTexturePool(const FabricTexturePool&) = delete;
FabricTexturePool& operator=(const FabricTexturePool&) = delete;
FabricTexturePool(FabricTexturePool&&) noexcept = default;
FabricTexturePool& operator=(FabricTexturePool&&) noexcept = default;
[[nodiscard]] int64_t getPoolId() const;
protected:
[[nodiscard]] std::shared_ptr<FabricTexture> createObject(uint64_t objectId) const override;
void setActive(FabricTexture* pTexture, bool active) const override;
private:
Context* _pContext;
int64_t _poolId;
};
} // namespace cesium::omniverse
| 925 | C | 30.931033 | 96 | 0.75027 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniCartographicPolygon.h | #pragma once
#include <glm/fwd.hpp>
#include <pxr/usd/sdf/path.h>
namespace CesiumGeospatial {
class Cartographic;
}
namespace cesium::omniverse {
class Context;
class OmniCartographicPolygon {
public:
OmniCartographicPolygon(Context* pContext, const pxr::SdfPath& path);
~OmniCartographicPolygon() = default;
OmniCartographicPolygon(const OmniCartographicPolygon&) = delete;
OmniCartographicPolygon& operator=(const OmniCartographicPolygon&) = delete;
OmniCartographicPolygon(OmniCartographicPolygon&&) noexcept = default;
OmniCartographicPolygon& operator=(OmniCartographicPolygon&&) noexcept = default;
[[nodiscard]] const pxr::SdfPath& getPath() const;
[[nodiscard]] std::vector<CesiumGeospatial::Cartographic> getCartographics() const;
private:
Context* _pContext;
pxr::SdfPath _path;
};
} // namespace cesium::omniverse
| 877 | C | 27.32258 | 87 | 0.753706 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/LoggerSink.h | #pragma once
// clang-format off
// Needs to go above Omniverse headers
#include <cctype>
// clang-format on
#include <omni/log/ILog.h>
#include <spdlog/details/null_mutex.h>
#include <spdlog/sinks/base_sink.h>
#include <mutex>
#include <string>
namespace cesium::omniverse {
class LoggerSink final : public spdlog::sinks::base_sink<spdlog::details::null_mutex> {
public:
LoggerSink(omni::log::Level logLevel);
protected:
void sink_it_(const spdlog::details::log_msg& msg) override;
void flush_() override;
private:
std::string formatMessage(const spdlog::details::log_msg& msg);
std::mutex _formatMutex;
omni::log::Level _logLevel;
};
} // namespace cesium::omniverse
| 709 | C | 19.882352 | 87 | 0.702398 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricPropertyDescriptor.h | #pragma once
#include "cesium/omniverse/DataType.h"
#include <string>
namespace cesium::omniverse {
enum class FabricPropertyStorageType {
ATTRIBUTE,
TEXTURE,
TABLE,
};
struct FabricPropertyDescriptor {
FabricPropertyStorageType storageType;
MdlInternalPropertyType type;
std::string propertyId;
uint64_t featureIdSetIndex; // Only relevant for property tables
// Make sure to update this function when adding new fields to the struct
// In C++ 20 we can use the default equality comparison (= default)
// clang-format off
bool operator==(const FabricPropertyDescriptor& other) const {
return storageType == other.storageType &&
type == other.type &&
propertyId == other.propertyId &&
featureIdSetIndex == other.featureIdSetIndex;
}
// clang-format on
};
} // namespace cesium::omniverse
| 900 | C | 25.499999 | 77 | 0.684444 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniWebMapTileServiceRasterOverlay.h | #pragma once
#include "cesium/omniverse/OmniRasterOverlay.h"
#include <CesiumRasterOverlays/WebMapTileServiceRasterOverlay.h>
#include <CesiumUtility/IntrusivePointer.h>
#include <string>
namespace cesium::omniverse {
class OmniWebMapTileServiceRasterOverlay final : public OmniRasterOverlay {
public:
OmniWebMapTileServiceRasterOverlay(Context* pContext, const pxr::SdfPath& path);
~OmniWebMapTileServiceRasterOverlay() override = default;
OmniWebMapTileServiceRasterOverlay(const OmniWebMapTileServiceRasterOverlay&) = delete;
OmniWebMapTileServiceRasterOverlay& operator=(const OmniWebMapTileServiceRasterOverlay&) = delete;
OmniWebMapTileServiceRasterOverlay(OmniWebMapTileServiceRasterOverlay&&) noexcept = default;
OmniWebMapTileServiceRasterOverlay& operator=(OmniWebMapTileServiceRasterOverlay&&) noexcept = default;
[[nodiscard]] CesiumRasterOverlays::RasterOverlay* getRasterOverlay() const override;
[[nodiscard]] std::string getUrl() const;
[[nodiscard]] std::string getLayer() const;
[[nodiscard]] std::string getTileMatrixSetId() const;
[[nodiscard]] std::string getStyle() const;
[[nodiscard]] std::string getFormat() const;
[[nodiscard]] int getMinimumZoomLevel() const;
[[nodiscard]] int getMaximumZoomLevel() const;
[[nodiscard]] bool getSpecifyZoomLevels() const;
[[nodiscard]] bool getUseWebMercatorProjection() const;
[[nodiscard]] bool getSpecifyTilingScheme() const;
[[nodiscard]] double getNorth() const;
[[nodiscard]] double getSouth() const;
[[nodiscard]] double getEast() const;
[[nodiscard]] double getWest() const;
[[nodiscard]] bool getSpecifyTileMatrixSetLabels() const;
[[nodiscard]] std::string getTileMatrixSetLabelPrefix() const;
[[nodiscard]] std::vector<std::string> getTileMatrixSetLabels() const;
[[nodiscard]] int getRootTilesX() const;
[[nodiscard]] int getRootTilesY() const;
void reload() override;
private:
CesiumUtility::IntrusivePointer<CesiumRasterOverlays::WebMapTileServiceRasterOverlay>
_pWebMapTileServiceRasterOverlay;
};
} // namespace cesium::omniverse
| 2,139 | C | 42.673469 | 107 | 0.758298 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/RenderStatistics.h | #pragma once
#include <cstdint>
namespace cesium::omniverse {
struct RenderStatistics {
uint64_t materialsCapacity{0};
uint64_t materialsLoaded{0};
uint64_t geometriesCapacity{0};
uint64_t geometriesLoaded{0};
uint64_t geometriesRendered{0};
uint64_t trianglesLoaded{0};
uint64_t trianglesRendered{0};
uint64_t tilesetCachedBytes{0};
uint64_t tilesVisited{0};
uint64_t culledTilesVisited{0};
uint64_t tilesRendered{0};
uint64_t tilesCulled{0};
uint64_t maxDepthVisited{0};
uint64_t tilesLoadingWorker{0};
uint64_t tilesLoadingMain{0};
uint64_t tilesLoaded{0};
};
} // namespace cesium::omniverse
| 664 | C | 23.629629 | 35 | 0.707831 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricMesh.h | #pragma once
#include "cesium/omniverse/FabricFeaturesInfo.h"
#include "cesium/omniverse/FabricMaterialInfo.h"
#include <memory>
#include <unordered_map>
#include <vector>
namespace cesium::omniverse {
class FabricGeometry;
class FabricMaterial;
class FabricTexture;
struct FabricMesh {
FabricMesh() = default;
~FabricMesh() = default;
FabricMesh(const FabricMesh&) = delete;
FabricMesh& operator=(const FabricMesh&) = delete;
FabricMesh(FabricMesh&&) noexcept = default;
FabricMesh& operator=(FabricMesh&&) noexcept = default;
std::shared_ptr<FabricGeometry> pGeometry;
std::shared_ptr<FabricMaterial> pMaterial;
std::shared_ptr<FabricTexture> pBaseColorTexture;
std::vector<std::shared_ptr<FabricTexture>> featureIdTextures;
std::vector<std::shared_ptr<FabricTexture>> propertyTextures;
std::vector<std::shared_ptr<FabricTexture>> propertyTableTextures;
FabricMaterialInfo materialInfo;
FabricFeaturesInfo featuresInfo;
std::unordered_map<uint64_t, uint64_t> texcoordIndexMapping;
std::unordered_map<uint64_t, uint64_t> rasterOverlayTexcoordIndexMapping;
std::vector<uint64_t> featureIdIndexSetIndexMapping;
std::vector<uint64_t> featureIdAttributeSetIndexMapping;
std::vector<uint64_t> featureIdTextureSetIndexMapping;
std::unordered_map<uint64_t, uint64_t> propertyTextureIndexMapping;
};
} // namespace cesium::omniverse
| 1,413 | C | 33.487804 | 77 | 0.760793 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricMaterialInfo.h | #pragma once
#include "cesium/omniverse/FabricTextureInfo.h"
#include <glm/glm.hpp>
#include <optional>
#ifdef CESIUM_OMNI_MSVC
#pragma push_macro("OPAQUE")
#undef OPAQUE
#endif
namespace cesium::omniverse {
/**
* @brief Matches gltf_alpha_mode in gltf/pbr.mdl.
*/
enum class FabricAlphaMode : int {
OPAQUE = 0,
MASK = 1,
BLEND = 2,
};
/**
* @brief Material values parsed from a glTF material passed to {@link FabricMaterial::setMaterial}.
*/
struct FabricMaterialInfo {
double alphaCutoff;
FabricAlphaMode alphaMode;
double baseAlpha;
glm::dvec3 baseColorFactor;
glm::dvec3 emissiveFactor;
double metallicFactor;
double roughnessFactor;
bool doubleSided;
bool hasVertexColors;
std::optional<FabricTextureInfo> baseColorTexture;
// Make sure to update this function when adding new fields to the struct
// In C++ 20 we can use the default equality comparison (= default)
// clang-format off
bool operator==(const FabricMaterialInfo& other) const {
return alphaCutoff == other.alphaCutoff &&
alphaMode == other.alphaMode &&
baseAlpha == other.baseAlpha &&
baseColorFactor == other.baseColorFactor &&
emissiveFactor == other.emissiveFactor &&
metallicFactor == other.metallicFactor &&
roughnessFactor == other.roughnessFactor &&
doubleSided == other.doubleSided &&
hasVertexColors == other.hasVertexColors &&
baseColorTexture == other.baseColorTexture;
}
// clang-format on
};
} // namespace cesium::omniverse
| 1,636 | C | 26.745762 | 99 | 0.661369 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniIonServer.h | #pragma once
#include <pxr/usd/sdf/path.h>
namespace CesiumIonClient {
struct Token;
}
namespace cesium::omniverse {
class CesiumIonSession;
class Context;
class OmniIonServer {
public:
OmniIonServer(Context* pContext, const pxr::SdfPath& path);
~OmniIonServer() = default;
OmniIonServer(const OmniIonServer&) = delete;
OmniIonServer& operator=(const OmniIonServer&) = delete;
OmniIonServer(OmniIonServer&&) noexcept = default;
OmniIonServer& operator=(OmniIonServer&&) noexcept = default;
[[nodiscard]] const pxr::SdfPath& getPath() const;
[[nodiscard]] std::string getIonServerUrl() const;
[[nodiscard]] std::string getIonServerApiUrl() const;
[[nodiscard]] int64_t getIonServerApplicationId() const;
[[nodiscard]] CesiumIonClient::Token getToken() const;
void setToken(const CesiumIonClient::Token& token);
[[nodiscard]] std::shared_ptr<CesiumIonSession> getSession() const;
private:
Context* _pContext;
pxr::SdfPath _path;
std::shared_ptr<CesiumIonSession> _session;
};
} // namespace cesium::omniverse
| 1,084 | C | 26.820512 | 71 | 0.71679 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricRasterOverlaysInfo.h | #pragma once
#include <vector>
namespace cesium::omniverse {
enum class FabricOverlayRenderMethod {
OVERLAY = 0,
CLIPPING = 1,
};
struct FabricRasterOverlaysInfo {
std::vector<FabricOverlayRenderMethod> overlayRenderMethods;
};
} // namespace cesium::omniverse
| 278 | C | 15.411764 | 64 | 0.741007 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/FabricResourceManager.h | #pragma once
#include "cesium/omniverse/FabricMaterialInfo.h"
#include <pxr/usd/usd/common.h>
#include <atomic>
#include <mutex>
#include <vector>
namespace CesiumGltf {
struct ImageCesium;
struct MeshPrimitive;
struct Model;
} // namespace CesiumGltf
namespace omni::ui {
class DynamicTextureProvider;
}
namespace cesium::omniverse {
class Context;
class FabricGeometry;
class FabricGeometryPool;
class FabricMaterial;
class FabricMaterialPool;
class FabricGeometryDescriptor;
class FabricMaterialDescriptor;
class FabricTexture;
class FabricTexturePool;
struct FabricFeaturesInfo;
struct FabricRasterOverlaysInfo;
class FabricResourceManager {
public:
FabricResourceManager(Context* pContext);
~FabricResourceManager();
FabricResourceManager(const FabricResourceManager&) = delete;
FabricResourceManager& operator=(const FabricResourceManager&) = delete;
FabricResourceManager(FabricResourceManager&&) noexcept = delete;
FabricResourceManager& operator=(FabricResourceManager&&) noexcept = delete;
bool shouldAcquireMaterial(
const CesiumGltf::MeshPrimitive& primitive,
bool hasRasterOverlay,
const pxr::SdfPath& tilesetMaterialPath) const;
bool getDisableTextures() const;
std::shared_ptr<FabricGeometry> acquireGeometry(
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
const FabricFeaturesInfo& featuresInfo,
bool smoothNormals);
std::shared_ptr<FabricMaterial> acquireMaterial(
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
const FabricMaterialInfo& materialInfo,
const FabricFeaturesInfo& featuresInfo,
const FabricRasterOverlaysInfo& rasterOverlaysInfo,
int64_t tilesetId,
const pxr::SdfPath& tilesetMaterialPath);
std::shared_ptr<FabricTexture> acquireTexture();
void releaseGeometry(std::shared_ptr<FabricGeometry> pGeometry);
void releaseMaterial(std::shared_ptr<FabricMaterial> pMaterial);
void releaseTexture(std::shared_ptr<FabricTexture> pTexture);
void setDisableMaterials(bool disableMaterials);
void setDisableTextures(bool disableTextures);
void setDisableGeometryPool(bool disableGeometryPool);
void setDisableMaterialPool(bool disableMaterialPool);
void setDisableTexturePool(bool disableTexturePool);
void setGeometryPoolInitialCapacity(uint64_t geometryPoolInitialCapacity);
void setMaterialPoolInitialCapacity(uint64_t materialPoolInitialCapacity);
void setTexturePoolInitialCapacity(uint64_t texturePoolInitialCapacity);
void setDebugRandomColors(bool debugRandomColors);
void updateShaderInput(
const pxr::SdfPath& materialPath,
const pxr::SdfPath& shaderPath,
const pxr::TfToken& attributeName) const;
void clear();
private:
struct SharedMaterial {
SharedMaterial() = default;
~SharedMaterial() = default;
SharedMaterial(const SharedMaterial&) = delete;
SharedMaterial& operator=(const SharedMaterial&) = delete;
SharedMaterial(SharedMaterial&&) noexcept = default;
SharedMaterial& operator=(SharedMaterial&&) noexcept = default;
std::shared_ptr<FabricMaterial> pMaterial;
FabricMaterialInfo materialInfo;
int64_t tilesetId;
uint64_t referenceCount;
};
std::shared_ptr<FabricMaterial> createMaterial(const FabricMaterialDescriptor& materialDescriptor);
std::shared_ptr<FabricMaterial> acquireSharedMaterial(
const FabricMaterialInfo& materialInfo,
const FabricMaterialDescriptor& materialDescriptor,
int64_t tilesetId);
void releaseSharedMaterial(const FabricMaterial& material);
bool isSharedMaterial(const FabricMaterial& material) const;
std::shared_ptr<FabricGeometry> acquireGeometryFromPool(const FabricGeometryDescriptor& geometryDescriptor);
std::shared_ptr<FabricMaterial> acquireMaterialFromPool(const FabricMaterialDescriptor& materialDescriptor);
std::shared_ptr<FabricTexture> acquireTextureFromPool();
FabricGeometryPool* getGeometryPool(const FabricGeometry& geometry) const;
FabricMaterialPool* getMaterialPool(const FabricMaterial& material) const;
FabricTexturePool* getTexturePool(const FabricTexture& texture) const;
int64_t getNextGeometryId();
int64_t getNextMaterialId();
int64_t getNextTextureId();
int64_t getNextGeometryPoolId();
int64_t getNextMaterialPoolId();
int64_t getNextTexturePoolId();
std::vector<std::unique_ptr<FabricGeometryPool>> _geometryPools;
std::vector<std::unique_ptr<FabricMaterialPool>> _materialPools;
std::vector<std::unique_ptr<FabricTexturePool>> _texturePools;
bool _disableMaterials{false};
bool _disableTextures{false};
bool _disableGeometryPool{false};
bool _disableMaterialPool{false};
bool _disableTexturePool{false};
uint64_t _geometryPoolInitialCapacity{0};
uint64_t _materialPoolInitialCapacity{0};
uint64_t _texturePoolInitialCapacity{0};
bool _debugRandomColors{false};
std::atomic<int64_t> _geometryId{0};
std::atomic<int64_t> _materialId{0};
std::atomic<int64_t> _textureId{0};
std::atomic<int64_t> _geometryPoolId{0};
std::atomic<int64_t> _materialPoolId{0};
std::atomic<int64_t> _texturePoolId{0};
std::mutex _poolMutex;
Context* _pContext;
std::unique_ptr<omni::ui::DynamicTextureProvider> _defaultWhiteTexture;
std::unique_ptr<omni::ui::DynamicTextureProvider> _defaultTransparentTexture;
pxr::TfToken _defaultWhiteTextureAssetPathToken;
pxr::TfToken _defaultTransparentTextureAssetPathToken;
std::vector<SharedMaterial> _sharedMaterials;
};
} // namespace cesium::omniverse
| 5,777 | C | 34.447853 | 112 | 0.752986 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/GltfUtil.h | #pragma once
#include "cesium/omniverse/DataType.h"
#include "cesium/omniverse/FabricVertexAttributeAccessors.h"
#include <CesiumGltf/Accessor.h>
#include <glm/fwd.hpp>
#include <set>
namespace CesiumGltf {
struct ImageCesium;
struct Material;
struct Model;
struct MeshPrimitive;
struct Texture;
struct PropertyTextureProperty;
} // namespace CesiumGltf
namespace cesium::omniverse {
struct FabricFeaturesInfo;
struct FabricMaterialInfo;
struct FabricTextureInfo;
struct FabricVertexAttributeDescriptor;
} // namespace cesium::omniverse
namespace cesium::omniverse::GltfUtil {
PositionsAccessor getPositions(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive);
std::optional<std::array<glm::dvec3, 2>>
getExtent(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive);
IndicesAccessor getIndices(
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
const PositionsAccessor& positions);
FaceVertexCountsAccessor getFaceVertexCounts(const IndicesAccessor& indices);
NormalsAccessor getNormals(
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
const PositionsAccessor& positionsAccessor,
const IndicesAccessor& indices,
bool smoothNormals);
TexcoordsAccessor
getTexcoords(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive, uint64_t setIndex);
TexcoordsAccessor getRasterOverlayTexcoords(
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
uint64_t setIndex);
VertexColorsAccessor
getVertexColors(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive, uint64_t setIndex);
VertexIdsAccessor getVertexIds(const PositionsAccessor& positionsAccessor);
const CesiumGltf::ImageCesium*
getBaseColorTextureImage(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive);
const CesiumGltf::ImageCesium* getFeatureIdTextureImage(
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
uint64_t featureIdSetIndex);
FabricMaterialInfo getMaterialInfo(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive);
FabricFeaturesInfo getFeaturesInfo(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive);
std::set<FabricVertexAttributeDescriptor>
getCustomVertexAttributes(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive);
const FabricMaterialInfo& getDefaultMaterialInfo();
const FabricTextureInfo& getDefaultTextureInfo();
FabricTextureInfo getPropertyTexturePropertyInfo(
const CesiumGltf::Model& model,
const CesiumGltf::PropertyTextureProperty& propertyTextureProperty);
bool hasNormals(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive, bool smoothNormals);
bool hasTexcoords(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive, uint64_t setIndex);
bool hasRasterOverlayTexcoords(
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
uint64_t setIndex);
bool hasVertexColors(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive, uint64_t setIndex);
bool hasMaterial(const CesiumGltf::MeshPrimitive& primitive);
std::vector<uint64_t> getTexcoordSetIndexes(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive);
std::vector<uint64_t>
getRasterOverlayTexcoordSetIndexes(const CesiumGltf::Model& model, const CesiumGltf::MeshPrimitive& primitive);
CesiumGltf::Ktx2TranscodeTargets getKtx2TranscodeTargets();
template <DataType T>
VertexAttributeAccessor<T> getVertexAttributeValues(
const CesiumGltf::Model& model,
const CesiumGltf::MeshPrimitive& primitive,
const std::string& attributeName) {
const auto it = primitive.attributes.find(attributeName);
if (it == primitive.attributes.end()) {
return {};
}
const auto pAccessor = model.getSafe(&model.accessors, it->second);
if (!pAccessor) {
return {};
}
const auto view = CesiumGltf::AccessorView<DataTypeUtil::GetNativeType<T>>(model, *pAccessor);
if (view.status() != CesiumGltf::AccessorViewStatus::Valid) {
return {};
}
return VertexAttributeAccessor<T>(view);
}
} // namespace cesium::omniverse::GltfUtil
| 4,312 | C | 34.06504 | 120 | 0.790584 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/OmniGeoreference.h | #pragma once
#include <CesiumGeospatial/Ellipsoid.h>
#include <CesiumGeospatial/LocalHorizontalCoordinateSystem.h>
#include <pxr/usd/sdf/path.h>
namespace CesiumGeospatial {
class Cartographic;
class LocalHorizontalCoordinateSystem;
} // namespace CesiumGeospatial
namespace cesium::omniverse {
class Context;
class OmniGeoreference {
public:
OmniGeoreference(Context* pContext, const pxr::SdfPath& path);
~OmniGeoreference() = default;
OmniGeoreference(const OmniGeoreference&) = delete;
OmniGeoreference& operator=(const OmniGeoreference&) = delete;
OmniGeoreference(OmniGeoreference&&) noexcept = default;
OmniGeoreference& operator=(OmniGeoreference&&) noexcept = default;
[[nodiscard]] const pxr::SdfPath& getPath() const;
[[nodiscard]] CesiumGeospatial::Cartographic getOrigin() const;
[[nodiscard]] const CesiumGeospatial::Ellipsoid& getEllipsoid() const;
[[nodiscard]] CesiumGeospatial::LocalHorizontalCoordinateSystem getLocalCoordinateSystem() const;
private:
Context* _pContext;
pxr::SdfPath _path;
CesiumGeospatial::Ellipsoid _ellipsoid;
};
} // namespace cesium::omniverse
| 1,149 | C | 30.944444 | 101 | 0.762402 |
CesiumGS/cesium-omniverse/src/core/include/cesium/omniverse/TilesetStatistics.h | #pragma once
#include <cstdint>
namespace cesium::omniverse {
struct TilesetStatistics {
uint64_t tilesetCachedBytes{0};
uint64_t tilesVisited{0};
uint64_t culledTilesVisited{0};
uint64_t tilesRendered{0};
uint64_t tilesCulled{0};
uint64_t maxDepthVisited{0};
uint64_t tilesLoadingWorker{0};
uint64_t tilesLoadingMain{0};
uint64_t tilesLoaded{0};
};
} // namespace cesium::omniverse
| 423 | C | 20.199999 | 35 | 0.706856 |
CesiumGS/cesium-omniverse/src/bindings/PythonBindings.cpp | #include "cesium/omniverse/CesiumIonSession.h"
#include "cesium/omniverse/CesiumOmniverse.h"
#include <CesiumUtility/CreditSystem.h>
#include <carb/BindingsPythonUtils.h>
#include <pxr/base/gf/matrix4d.h>
#include <pxr/base/gf/vec4d.h>
#include <pxr/usd/sdf/path.h>
// Needs to go after carb
#include "pyboost11.h"
namespace pybind11::detail {
PYBOOST11_TYPE_CASTER(pxr::GfMatrix4d, _("Matrix4d"));
}
#ifdef CESIUM_OMNI_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
CARB_BINDINGS("cesium.omniverse.python")
#ifdef CESIUM_OMNI_CLANG
#pragma clang diagnostic pop
#endif
DISABLE_PYBIND11_DYNAMIC_CAST(cesium::omniverse::ICesiumOmniverseInterface)
struct ViewportPythonBinding {
pxr::GfMatrix4d viewMatrix;
pxr::GfMatrix4d projMatrix;
double width;
double height;
};
PYBIND11_MODULE(CesiumOmniversePythonBindings, m) {
using namespace cesium::omniverse;
m.doc() = "pybind11 cesium.omniverse bindings";
// clang-format off
carb::defineInterfaceClass<ICesiumOmniverseInterface>(
m, "ICesiumOmniverseInterface", "acquire_cesium_omniverse_interface", "release_cesium_omniverse_interface")
.def("on_startup", &ICesiumOmniverseInterface::onStartup)
.def("on_shutdown", &ICesiumOmniverseInterface::onShutdown)
.def("reload_tileset", &ICesiumOmniverseInterface::reloadTileset)
.def("on_update_frame", [](ICesiumOmniverseInterface& interface, const std::vector<ViewportPythonBinding>& viewports, bool waitForLoadingTiles) {
return interface.onUpdateFrame(reinterpret_cast<const ViewportApi*>(viewports.data()), viewports.size(), waitForLoadingTiles);
})
.def("on_stage_change", &ICesiumOmniverseInterface::onUsdStageChanged)
.def("connect_to_ion", &ICesiumOmniverseInterface::connectToIon)
.def("get_session", &ICesiumOmniverseInterface::getSession)
.def("get_server_path", &ICesiumOmniverseInterface::getServerPath)
.def("get_sessions", &ICesiumOmniverseInterface::getSessions)
.def("get_server_paths", &ICesiumOmniverseInterface::getServerPaths)
.def("get_set_default_token_result", &ICesiumOmniverseInterface::getSetDefaultTokenResult)
.def("is_default_token_set", &ICesiumOmniverseInterface::isDefaultTokenSet)
.def("create_token", &ICesiumOmniverseInterface::createToken)
.def("select_token", &ICesiumOmniverseInterface::selectToken)
.def("specify_token", &ICesiumOmniverseInterface::specifyToken)
.def("get_asset_troubleshooting_details", &ICesiumOmniverseInterface::getAssetTroubleshootingDetails)
.def("get_asset_token_troubleshooting_details", &ICesiumOmniverseInterface::getAssetTokenTroubleshootingDetails)
.def("get_default_token_troubleshooting_details", &ICesiumOmniverseInterface::getDefaultTokenTroubleshootingDetails)
.def("update_troubleshooting_details", py::overload_cast<const char*, int64_t, uint64_t, uint64_t>(&ICesiumOmniverseInterface::updateTroubleshootingDetails))
.def("update_troubleshooting_details", py::overload_cast<const char*, int64_t, int64_t, uint64_t, uint64_t>(&ICesiumOmniverseInterface::updateTroubleshootingDetails))
.def("print_fabric_stage", &ICesiumOmniverseInterface::printFabricStage)
.def("get_render_statistics", &ICesiumOmniverseInterface::getRenderStatistics)
.def("credits_available", &ICesiumOmniverseInterface::creditsAvailable)
.def("get_credits", &ICesiumOmniverseInterface::getCredits)
.def("credits_start_next_frame", &ICesiumOmniverseInterface::creditsStartNextFrame)
.def("is_tracing_enabled", &ICesiumOmniverseInterface::isTracingEnabled)
.def("clear_accessor_cache", &ICesiumOmniverseInterface::clearAccessorCache);
// clang-format on
py::class_<CesiumIonSession, std::shared_ptr<CesiumIonSession>>(m, "CesiumIonSession")
.def("is_connected", &CesiumIonSession::isConnected)
.def("is_connecting", &CesiumIonSession::isConnecting)
.def("is_resuming", &CesiumIonSession::isResuming)
.def("is_profile_loaded", &CesiumIonSession::isProfileLoaded)
.def("is_loading_profile", &CesiumIonSession::isLoadingProfile)
.def("is_asset_list_loaded", &CesiumIonSession::isAssetListLoaded)
.def("is_loading_asset_list", &CesiumIonSession::isLoadingAssetList)
.def("is_token_list_loaded", &CesiumIonSession::isTokenListLoaded)
.def("is_loading_token_list", &CesiumIonSession::isLoadingTokenList)
.def("get_authorize_url", &CesiumIonSession::getAuthorizeUrl)
.def("get_connection", &CesiumIonSession::getConnection)
.def("get_profile", &CesiumIonSession::getProfile)
.def("get_assets", &CesiumIonSession::getAssets)
.def("get_tokens", &CesiumIonSession::getTokens)
.def("refresh_tokens", &CesiumIonSession::refreshTokens)
.def("refresh_profile", &CesiumIonSession::refreshProfile)
.def("refresh_assets", &CesiumIonSession::refreshAssets)
.def("disconnect", &CesiumIonSession::disconnect);
py::class_<SetDefaultTokenResult>(m, "SetDefaultTokenResult")
.def_readonly("code", &SetDefaultTokenResult::code)
.def_readonly("message", &SetDefaultTokenResult::message);
py::class_<CesiumIonClient::Assets>(m, "Assets")
.def_readonly("link", &CesiumIonClient::Assets::link)
.def_readonly("items", &CesiumIonClient::Assets::items);
py::class_<CesiumIonClient::Asset>(m, "Asset")
.def_readonly("asset_id", &CesiumIonClient::Asset::id)
.def_readonly("name", &CesiumIonClient::Asset::name)
.def_readonly("description", &CesiumIonClient::Asset::description)
.def_readonly("attribution", &CesiumIonClient::Asset::attribution)
.def_readonly("asset_type", &CesiumIonClient::Asset::type)
.def_readonly("bytes", &CesiumIonClient::Asset::bytes)
.def_readonly("date_added", &CesiumIonClient::Asset::dateAdded)
.def_readonly("status", &CesiumIonClient::Asset::status)
.def_readonly("percent_complete", &CesiumIonClient::Asset::percentComplete);
py::class_<CesiumIonClient::Connection>(m, "Connection")
// Wrap non-static member function in lambda. May be able to use py::overload_cast<> in C++ 20
.def("get_api_uri", [](CesiumIonClient::Connection& connection) { return connection.getApiUrl(); })
.def("get_access_token", &CesiumIonClient::Connection::getAccessToken);
py::class_<CesiumIonClient::Profile>(m, "Profile")
.def_readonly("id", &CesiumIonClient::Profile::id)
.def_readonly("username", &CesiumIonClient::Profile::username);
py::class_<CesiumIonClient::Token>(m, "Token")
.def_readonly("id", &CesiumIonClient::Token::id)
.def_readonly("name", &CesiumIonClient::Token::name)
.def_readonly("token", &CesiumIonClient::Token::token)
.def_readonly("is_default", &CesiumIonClient::Token::isDefault);
py::class_<TokenTroubleshootingDetails>(m, "TokenTroubleshootingDetails")
.def_readonly("token", &TokenTroubleshootingDetails::token)
.def_readonly("is_valid", &TokenTroubleshootingDetails::isValid)
.def_readonly("allows_access_to_asset", &TokenTroubleshootingDetails::allowsAccessToAsset)
.def_readonly("associated_with_user_account", &TokenTroubleshootingDetails::associatedWithUserAccount)
.def_readonly("show_details", &TokenTroubleshootingDetails::showDetails);
py::class_<AssetTroubleshootingDetails>(m, "AssetTroubleshootingDetails")
.def_readonly("asset_id", &AssetTroubleshootingDetails::assetId)
.def_readonly("asset_exists_in_user_account", &AssetTroubleshootingDetails::assetExistsInUserAccount);
py::class_<RenderStatistics>(m, "RenderStatistics")
.def_readonly("materials_capacity", &RenderStatistics::materialsCapacity)
.def_readonly("materials_loaded", &RenderStatistics::materialsLoaded)
.def_readonly("geometries_capacity", &RenderStatistics::geometriesCapacity)
.def_readonly("geometries_loaded", &RenderStatistics::geometriesLoaded)
.def_readonly("geometries_rendered", &RenderStatistics::geometriesRendered)
.def_readonly("triangles_loaded", &RenderStatistics::trianglesLoaded)
.def_readonly("triangles_rendered", &RenderStatistics::trianglesRendered)
.def_readonly("tileset_cached_bytes", &RenderStatistics::tilesetCachedBytes)
.def_readonly("tiles_visited", &RenderStatistics::tilesVisited)
.def_readonly("culled_tiles_visited", &RenderStatistics::culledTilesVisited)
.def_readonly("tiles_rendered", &RenderStatistics::tilesRendered)
.def_readonly("tiles_culled", &RenderStatistics::tilesCulled)
.def_readonly("max_depth_visited", &RenderStatistics::maxDepthVisited)
.def_readonly("tiles_loading_worker", &RenderStatistics::tilesLoadingWorker)
.def_readonly("tiles_loading_main", &RenderStatistics::tilesLoadingMain)
.def_readonly("tiles_loaded", &RenderStatistics::tilesLoaded);
py::class_<ViewportPythonBinding>(m, "Viewport")
.def(py::init())
.def_readwrite("viewMatrix", &ViewportPythonBinding::viewMatrix)
.def_readwrite("projMatrix", &ViewportPythonBinding::projMatrix)
.def_readwrite("width", &ViewportPythonBinding::width)
.def_readwrite("height", &ViewportPythonBinding::height);
}
| 9,489 | C++ | 55.153846 | 174 | 0.720413 |
CesiumGS/cesium-omniverse/src/bindings/pyboost11.h | // From https://yyc.solvcon.net/en/latest/writing/2021/pyboost11/code.html
// clang-format off
/*
* Copyright (c) 2021, Yung-Yu Chen <[email protected]>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include <pybind11/pybind11.h>
#ifdef CESIUM_OMNI_GCC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#endif
#include <boost/python.hpp>
#ifdef CESIUM_OMNI_GCC
#pragma GCC diagnostic pop
#endif
namespace pyboost11
{
// Pybind11 cast by using boost.python.
template <typename T> struct caster
{
caster(pybind11::handle src)
: obj(boost::python::handle<>(boost::python::borrowed(src.ptr())))
, ext(obj)
{}
bool check() const { return ext.check(); }
// From-Python conversion.
operator T() { return ext(); }
T operator()() { return ext(); }
// To-Python conversion.
static pybind11::handle to_python(T & src)
{
namespace bpy = boost::python;
return bpy::incref(bpy::object(src).ptr());
}
boost::python::object obj;
boost::python::extract<T> ext;
};
} // end namespace pyboost11
namespace pybind11
{
namespace detail
{
template <typename type> struct pyboost11_type_caster
{
// Expanded from PYBIND11_TYPE_CASTER.
protected:
type value;
public:
template <typename T_, enable_if_t<std::is_same<type, remove_cv_t<T_>>::value, int> = 0>
static handle cast(T_ *src, return_value_policy policy, handle parent) {
if (!src) return none().release();
if (policy == return_value_policy::take_ownership) {
auto h = cast(std::move(*src), policy, parent); delete src; return h;
} else {
return cast(*src, policy, parent);
}
}
operator type*() { return &value; }
operator type&() { return value; }
operator type&&() && { return std::move(value); }
template <typename T_> using cast_op_type = pybind11::detail::movable_cast_op_type<T_>;
// Boilerplate.
bool load(handle src, bool)
{
if (!src)
{
return false;
}
pyboost11::caster<type> ext(src);
if (!ext.check())
{
return false;
}
value = ext();
return true;
}
static handle cast(type * src, return_value_policy /* policy */, handle /* parent */)
{
return pyboost11::caster<type>::to_python(src);
}
static handle cast(type src, return_value_policy /* policy */, handle /* parent */)
{
return pyboost11::caster<type>::to_python(src);
}
};
#define PYBOOST11_TYPE_CASTER(type, py_name) \
template <> struct type_caster<type> : public pyboost11_type_caster<type> \
{ static constexpr auto name = py_name; }
} // end namespace detail
} // end namespace pybind11
namespace pyboost11
{
// Boost.python convert by using pybind11.
template <typename T> struct converter
{
public:
converter() { init(); }
void init()
{
static bool initialized = false;
if (!initialized)
{
namespace bpy = boost::python;
// From-Python conversion.
bpy::converter::registry::push_back
(
&convertible
, &construct
, bpy::type_id<T>()
);
// To-Python conversion.
bpy::to_python_converter<T, converter>();
initialized = true;
}
}
// From-Python convertibility.
static void * convertible(PyObject * objptr)
{
namespace pyb = pybind11;
try
{
pyb::handle(objptr).cast<T>();
return objptr;
}
catch (pyb::cast_error const &)
{
return nullptr;
}
}
// From-Python conversion.
static void construct
(
PyObject * objptr
, boost::python::converter::rvalue_from_python_stage1_data * data
)
{
namespace pyb = pybind11;
void * storage = reinterpret_cast
<
boost::python::converter::rvalue_from_python_storage<T> *
>(data)->storage.bytes;
new (storage) T(pyb::handle(objptr).cast<T>());
data->convertible = storage;
}
// To-Python conversion.
static PyObject * convert(T const & t)
{
return pybind11::cast(t).inc_ref().ptr();
}
};
} // end namespace pyboost11
// vim: set ff=unix fenc=utf8 et sw=4 ts=4 sts=4:
// clang-format on
| 5,974 | C | 26.790698 | 92 | 0.629227 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapSession.cpp | #include ".//session.h"
#include "pxr/usd/usd/schemaBase.h"
#include "pxr/usd/sdf/primSpec.h"
#include "pxr/usd/usd/pyConversions.h"
#include "pxr/base/tf/pyContainerConversions.h"
#include "pxr/base/tf/pyResultConversions.h"
#include "pxr/base/tf/pyUtils.h"
#include "pxr/base/tf/wrapTypeHelpers.h"
#include <boost/python.hpp>
#include <string>
using namespace boost::python;
PXR_NAMESPACE_USING_DIRECTIVE
namespace {
#define WRAP_CUSTOM \
template <class Cls> static void _CustomWrapCode(Cls &_class)
// fwd decl.
WRAP_CUSTOM;
static UsdAttribute
_CreateEcefToUsdTransformAttr(CesiumSession &self,
object defaultVal, bool writeSparsely) {
return self.CreateEcefToUsdTransformAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Matrix4d), writeSparsely);
}
static std::string
_Repr(const CesiumSession &self)
{
std::string primRepr = TfPyRepr(self.GetPrim());
return TfStringPrintf(
"CesiumUsdSchemas.Session(%s)",
primRepr.c_str());
}
} // anonymous namespace
void wrapCesiumSession()
{
typedef CesiumSession This;
class_<This, bases<UsdTyped> >
cls("Session");
cls
.def(init<UsdPrim>(arg("prim")))
.def(init<UsdSchemaBase const&>(arg("schemaObj")))
.def(TfTypePythonClass())
.def("Get", &This::Get, (arg("stage"), arg("path")))
.staticmethod("Get")
.def("Define", &This::Define, (arg("stage"), arg("path")))
.staticmethod("Define")
.def("GetSchemaAttributeNames",
&This::GetSchemaAttributeNames,
arg("includeInherited")=true,
return_value_policy<TfPySequenceToList>())
.staticmethod("GetSchemaAttributeNames")
.def("_GetStaticTfType", (TfType const &(*)()) TfType::Find<This>,
return_value_policy<return_by_value>())
.staticmethod("_GetStaticTfType")
.def(!self)
.def("GetEcefToUsdTransformAttr",
&This::GetEcefToUsdTransformAttr)
.def("CreateEcefToUsdTransformAttr",
&_CreateEcefToUsdTransformAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("__repr__", ::_Repr)
;
_CustomWrapCode(cls);
}
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator. The entry point for your custom code should look
// minimally like the following:
//
// WRAP_CUSTOM {
// _class
// .def("MyCustomMethod", ...)
// ;
// }
//
// Of course any other ancillary or support code may be provided.
//
// Just remember to wrap code in the appropriate delimiters:
// 'namespace {', '}'.
//
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
namespace {
WRAP_CUSTOM {
}
}
| 2,983 | C++ | 24.724138 | 84 | 0.588669 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapTileset.cpp | #include ".//tileset.h"
#include "pxr/usd/usd/schemaBase.h"
#include "pxr/usd/sdf/primSpec.h"
#include "pxr/usd/usd/pyConversions.h"
#include "pxr/base/tf/pyContainerConversions.h"
#include "pxr/base/tf/pyResultConversions.h"
#include "pxr/base/tf/pyUtils.h"
#include "pxr/base/tf/wrapTypeHelpers.h"
#include <boost/python.hpp>
#include <string>
using namespace boost::python;
PXR_NAMESPACE_USING_DIRECTIVE
namespace {
#define WRAP_CUSTOM \
template <class Cls> static void _CustomWrapCode(Cls &_class)
// fwd decl.
WRAP_CUSTOM;
static UsdAttribute
_CreateSourceTypeAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateSourceTypeAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Token), writeSparsely);
}
static UsdAttribute
_CreateUrlAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateUrlAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateIonAssetIdAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateIonAssetIdAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Int64), writeSparsely);
}
static UsdAttribute
_CreateIonAccessTokenAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateIonAccessTokenAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateMaximumScreenSpaceErrorAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateMaximumScreenSpaceErrorAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Float), writeSparsely);
}
static UsdAttribute
_CreatePreloadAncestorsAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreatePreloadAncestorsAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreatePreloadSiblingsAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreatePreloadSiblingsAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateForbidHolesAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateForbidHolesAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateMaximumSimultaneousTileLoadsAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateMaximumSimultaneousTileLoadsAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->UInt), writeSparsely);
}
static UsdAttribute
_CreateMaximumCachedBytesAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateMaximumCachedBytesAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->UInt64), writeSparsely);
}
static UsdAttribute
_CreateLoadingDescendantLimitAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateLoadingDescendantLimitAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->UInt), writeSparsely);
}
static UsdAttribute
_CreateEnableFrustumCullingAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateEnableFrustumCullingAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateEnableFogCullingAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateEnableFogCullingAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateEnforceCulledScreenSpaceErrorAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateEnforceCulledScreenSpaceErrorAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateCulledScreenSpaceErrorAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateCulledScreenSpaceErrorAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Float), writeSparsely);
}
static UsdAttribute
_CreateSuspendUpdateAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateSuspendUpdateAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateSmoothNormalsAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateSmoothNormalsAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateShowCreditsOnScreenAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateShowCreditsOnScreenAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateMainThreadLoadingTimeLimitAttr(CesiumTileset &self,
object defaultVal, bool writeSparsely) {
return self.CreateMainThreadLoadingTimeLimitAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Float), writeSparsely);
}
static std::string
_Repr(const CesiumTileset &self)
{
std::string primRepr = TfPyRepr(self.GetPrim());
return TfStringPrintf(
"CesiumUsdSchemas.Tileset(%s)",
primRepr.c_str());
}
} // anonymous namespace
void wrapCesiumTileset()
{
typedef CesiumTileset This;
class_<This, bases<UsdGeomGprim> >
cls("Tileset");
cls
.def(init<UsdPrim>(arg("prim")))
.def(init<UsdSchemaBase const&>(arg("schemaObj")))
.def(TfTypePythonClass())
.def("Get", &This::Get, (arg("stage"), arg("path")))
.staticmethod("Get")
.def("Define", &This::Define, (arg("stage"), arg("path")))
.staticmethod("Define")
.def("GetSchemaAttributeNames",
&This::GetSchemaAttributeNames,
arg("includeInherited")=true,
return_value_policy<TfPySequenceToList>())
.staticmethod("GetSchemaAttributeNames")
.def("_GetStaticTfType", (TfType const &(*)()) TfType::Find<This>,
return_value_policy<return_by_value>())
.staticmethod("_GetStaticTfType")
.def(!self)
.def("GetSourceTypeAttr",
&This::GetSourceTypeAttr)
.def("CreateSourceTypeAttr",
&_CreateSourceTypeAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetUrlAttr",
&This::GetUrlAttr)
.def("CreateUrlAttr",
&_CreateUrlAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetIonAssetIdAttr",
&This::GetIonAssetIdAttr)
.def("CreateIonAssetIdAttr",
&_CreateIonAssetIdAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetIonAccessTokenAttr",
&This::GetIonAccessTokenAttr)
.def("CreateIonAccessTokenAttr",
&_CreateIonAccessTokenAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetMaximumScreenSpaceErrorAttr",
&This::GetMaximumScreenSpaceErrorAttr)
.def("CreateMaximumScreenSpaceErrorAttr",
&_CreateMaximumScreenSpaceErrorAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetPreloadAncestorsAttr",
&This::GetPreloadAncestorsAttr)
.def("CreatePreloadAncestorsAttr",
&_CreatePreloadAncestorsAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetPreloadSiblingsAttr",
&This::GetPreloadSiblingsAttr)
.def("CreatePreloadSiblingsAttr",
&_CreatePreloadSiblingsAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetForbidHolesAttr",
&This::GetForbidHolesAttr)
.def("CreateForbidHolesAttr",
&_CreateForbidHolesAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetMaximumSimultaneousTileLoadsAttr",
&This::GetMaximumSimultaneousTileLoadsAttr)
.def("CreateMaximumSimultaneousTileLoadsAttr",
&_CreateMaximumSimultaneousTileLoadsAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetMaximumCachedBytesAttr",
&This::GetMaximumCachedBytesAttr)
.def("CreateMaximumCachedBytesAttr",
&_CreateMaximumCachedBytesAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetLoadingDescendantLimitAttr",
&This::GetLoadingDescendantLimitAttr)
.def("CreateLoadingDescendantLimitAttr",
&_CreateLoadingDescendantLimitAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetEnableFrustumCullingAttr",
&This::GetEnableFrustumCullingAttr)
.def("CreateEnableFrustumCullingAttr",
&_CreateEnableFrustumCullingAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetEnableFogCullingAttr",
&This::GetEnableFogCullingAttr)
.def("CreateEnableFogCullingAttr",
&_CreateEnableFogCullingAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetEnforceCulledScreenSpaceErrorAttr",
&This::GetEnforceCulledScreenSpaceErrorAttr)
.def("CreateEnforceCulledScreenSpaceErrorAttr",
&_CreateEnforceCulledScreenSpaceErrorAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetCulledScreenSpaceErrorAttr",
&This::GetCulledScreenSpaceErrorAttr)
.def("CreateCulledScreenSpaceErrorAttr",
&_CreateCulledScreenSpaceErrorAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetSuspendUpdateAttr",
&This::GetSuspendUpdateAttr)
.def("CreateSuspendUpdateAttr",
&_CreateSuspendUpdateAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetSmoothNormalsAttr",
&This::GetSmoothNormalsAttr)
.def("CreateSmoothNormalsAttr",
&_CreateSmoothNormalsAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetShowCreditsOnScreenAttr",
&This::GetShowCreditsOnScreenAttr)
.def("CreateShowCreditsOnScreenAttr",
&_CreateShowCreditsOnScreenAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetMainThreadLoadingTimeLimitAttr",
&This::GetMainThreadLoadingTimeLimitAttr)
.def("CreateMainThreadLoadingTimeLimitAttr",
&_CreateMainThreadLoadingTimeLimitAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetGeoreferenceBindingRel",
&This::GetGeoreferenceBindingRel)
.def("CreateGeoreferenceBindingRel",
&This::CreateGeoreferenceBindingRel)
.def("GetIonServerBindingRel",
&This::GetIonServerBindingRel)
.def("CreateIonServerBindingRel",
&This::CreateIonServerBindingRel)
.def("GetRasterOverlayBindingRel",
&This::GetRasterOverlayBindingRel)
.def("CreateRasterOverlayBindingRel",
&This::CreateRasterOverlayBindingRel)
.def("__repr__", ::_Repr)
;
_CustomWrapCode(cls);
}
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator. The entry point for your custom code should look
// minimally like the following:
//
// WRAP_CUSTOM {
// _class
// .def("MyCustomMethod", ...)
// ;
// }
//
// Of course any other ancillary or support code may be provided.
//
// Just remember to wrap code in the appropriate delimiters:
// 'namespace {', '}'.
//
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
namespace {
WRAP_CUSTOM {
}
}
| 13,615 | C++ | 34.550914 | 82 | 0.617481 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/api.h | #ifndef CESIUMUSDSCHEMAS_API_H
#define CESIUMUSDSCHEMAS_API_H
#include "pxr/base/arch/export.h"
#if defined(PXR_STATIC)
# define CESIUMUSDSCHEMAS_API
# define CESIUMUSDSCHEMAS_API_TEMPLATE_CLASS(...)
# define CESIUMUSDSCHEMAS_API_TEMPLATE_STRUCT(...)
# define CESIUMUSDSCHEMAS_LOCAL
#else
# if defined(CESIUMUSDSCHEMAS_EXPORTS)
# define CESIUMUSDSCHEMAS_API ARCH_EXPORT
# define CESIUMUSDSCHEMAS_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__)
# define CESIUMUSDSCHEMAS_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__)
# else
# define CESIUMUSDSCHEMAS_API ARCH_IMPORT
# define CESIUMUSDSCHEMAS_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__)
# define CESIUMUSDSCHEMAS_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__)
# endif
# define CESIUMUSDSCHEMAS_LOCAL ARCH_HIDDEN
#endif
#endif
| 908 | C | 35.359999 | 98 | 0.72467 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/polygonRasterOverlay.h | #ifndef CESIUMUSDSCHEMAS_GENERATED_POLYGONRASTEROVERLAY_H
#define CESIUMUSDSCHEMAS_GENERATED_POLYGONRASTEROVERLAY_H
/// \file CesiumUsdSchemas/polygonRasterOverlay.h
#include "pxr/pxr.h"
#include ".//api.h"
#include ".//rasterOverlay.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include ".//tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// CESIUMPOLYGONRASTEROVERLAYPRIM //
// -------------------------------------------------------------------------- //
/// \class CesiumPolygonRasterOverlay
///
/// Adds a prim for representing a polygon raster overlay.
///
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
/// that are text/tokens, the actual token is published and defined in \ref CesiumTokens.
/// So to set an attribute to the value "rightHanded", use CesiumTokens->rightHanded
/// as the value.
///
class CesiumPolygonRasterOverlay : public CesiumRasterOverlay
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a CesiumPolygonRasterOverlay on UsdPrim \p prim .
/// Equivalent to CesiumPolygonRasterOverlay::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit CesiumPolygonRasterOverlay(const UsdPrim& prim=UsdPrim())
: CesiumRasterOverlay(prim)
{
}
/// Construct a CesiumPolygonRasterOverlay on the prim held by \p schemaObj .
/// Should be preferred over CesiumPolygonRasterOverlay(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit CesiumPolygonRasterOverlay(const UsdSchemaBase& schemaObj)
: CesiumRasterOverlay(schemaObj)
{
}
/// Destructor.
CESIUMUSDSCHEMAS_API
virtual ~CesiumPolygonRasterOverlay();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
CESIUMUSDSCHEMAS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a CesiumPolygonRasterOverlay holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// CesiumPolygonRasterOverlay(stage->GetPrimAtPath(path));
/// \endcode
///
CESIUMUSDSCHEMAS_API
static CesiumPolygonRasterOverlay
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
CESIUMUSDSCHEMAS_API
static CesiumPolygonRasterOverlay
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
CESIUMUSDSCHEMAS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
CESIUMUSDSCHEMAS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
CESIUMUSDSCHEMAS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// INVERTSELECTION
// --------------------------------------------------------------------- //
/// Whether to invert the selection specified by the polygons. If this is true, only the areas outside of the polygons will be rasterized.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:invertSelection = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetInvertSelectionAttr() const;
/// See GetInvertSelectionAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateInvertSelectionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// EXCLUDESELECTEDTILES
// --------------------------------------------------------------------- //
/// Whether tiles that fall entirely within the rasterized selection should be excluded from loading and rendering. For better performance, this should be enabled when this overlay will be used for clipping. But when this overlay is used for other effects, this option should be disabled to avoid missing tiles. Note that if InvertSelection is true, this will cull tiles that are outside of all the polygons. If it is false, this will cull tiles that are completely inside at least one polygon.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:excludeSelectedTiles = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetExcludeSelectedTilesAttr() const;
/// See GetExcludeSelectedTilesAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateExcludeSelectedTilesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// CESIUMOVERLAYRENDERMETHOD
// --------------------------------------------------------------------- //
///
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token cesium:overlayRenderMethod = "clip"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
CESIUMUSDSCHEMAS_API
UsdAttribute GetCesiumOverlayRenderMethodAttr() const;
/// See GetCesiumOverlayRenderMethodAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateCesiumOverlayRenderMethodAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// CARTOGRAPHICPOLYGONBINDING
// --------------------------------------------------------------------- //
/// Specifies which Cartographic Polygons to use in the raster overlay
///
CESIUMUSDSCHEMAS_API
UsdRelationship GetCartographicPolygonBindingRel() const;
/// See GetCartographicPolygonBindingRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
CESIUMUSDSCHEMAS_API
UsdRelationship CreateCartographicPolygonBindingRel() const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| 9,686 | C | 41.117391 | 498 | 0.626574 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/webMapTileServiceRasterOverlay.h | #ifndef CESIUMUSDSCHEMAS_GENERATED_WEBMAPTILESERVICERASTEROVERLAY_H
#define CESIUMUSDSCHEMAS_GENERATED_WEBMAPTILESERVICERASTEROVERLAY_H
/// \file CesiumUsdSchemas/webMapTileServiceRasterOverlay.h
#include "pxr/pxr.h"
#include ".//api.h"
#include ".//rasterOverlay.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include ".//tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// CESIUMWEBMAPTILESERVICERASTEROVERLAYPRIM //
// -------------------------------------------------------------------------- //
/// \class CesiumWebMapTileServiceRasterOverlay
///
/// Adds a prim for representing a Web Map Tile Service (WMTS) raster overlay.
///
class CesiumWebMapTileServiceRasterOverlay : public CesiumRasterOverlay
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a CesiumWebMapTileServiceRasterOverlay on UsdPrim \p prim .
/// Equivalent to CesiumWebMapTileServiceRasterOverlay::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit CesiumWebMapTileServiceRasterOverlay(const UsdPrim& prim=UsdPrim())
: CesiumRasterOverlay(prim)
{
}
/// Construct a CesiumWebMapTileServiceRasterOverlay on the prim held by \p schemaObj .
/// Should be preferred over CesiumWebMapTileServiceRasterOverlay(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit CesiumWebMapTileServiceRasterOverlay(const UsdSchemaBase& schemaObj)
: CesiumRasterOverlay(schemaObj)
{
}
/// Destructor.
CESIUMUSDSCHEMAS_API
virtual ~CesiumWebMapTileServiceRasterOverlay();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
CESIUMUSDSCHEMAS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a CesiumWebMapTileServiceRasterOverlay holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// CesiumWebMapTileServiceRasterOverlay(stage->GetPrimAtPath(path));
/// \endcode
///
CESIUMUSDSCHEMAS_API
static CesiumWebMapTileServiceRasterOverlay
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
CESIUMUSDSCHEMAS_API
static CesiumWebMapTileServiceRasterOverlay
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
CESIUMUSDSCHEMAS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
CESIUMUSDSCHEMAS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
CESIUMUSDSCHEMAS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// URL
// --------------------------------------------------------------------- //
/// The base url of the Web Map Tile Service (WMTS).
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:url = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetUrlAttr() const;
/// See GetUrlAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateUrlAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// LAYER
// --------------------------------------------------------------------- //
/// Layer name.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:layer = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetLayerAttr() const;
/// See GetLayerAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateLayerAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// STYLE
// --------------------------------------------------------------------- //
/// Style.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:style = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetStyleAttr() const;
/// See GetStyleAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateStyleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// FORMAT
// --------------------------------------------------------------------- //
/// Format.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:format = "image/jpeg"` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetFormatAttr() const;
/// See GetFormatAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateFormatAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// TILEMATRIXSETID
// --------------------------------------------------------------------- //
/// Tile Matrix Set ID
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:tileMatrixSetId = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetTileMatrixSetIdAttr() const;
/// See GetTileMatrixSetIdAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateTileMatrixSetIdAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SPECIFYTILEMATRIXSETLABELS
// --------------------------------------------------------------------- //
/// True to specify tile matrix set labels manually, or false to automatically determine from level and prefix.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:specifyTileMatrixSetLabels = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetSpecifyTileMatrixSetLabelsAttr() const;
/// See GetSpecifyTileMatrixSetLabelsAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateSpecifyTileMatrixSetLabelsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// TILEMATRIXSETLABELPREFIX
// --------------------------------------------------------------------- //
/// Prefix for tile matrix set labels. For instance, setting "EPSG:4326:" as prefix generates label list ["EPSG:4326:0", "EPSG:4326:1", "EPSG:4326:2", ...]
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:tileMatrixSetLabelPrefix = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetTileMatrixSetLabelPrefixAttr() const;
/// See GetTileMatrixSetLabelPrefixAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateTileMatrixSetLabelPrefixAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// TILEMATRIXSETLABELS
// --------------------------------------------------------------------- //
/// Comma-separated tile matrix set labels
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:tileMatrixSetLabels` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetTileMatrixSetLabelsAttr() const;
/// See GetTileMatrixSetLabelsAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateTileMatrixSetLabelsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// USEWEBMERCATORPROJECTION
// --------------------------------------------------------------------- //
/// False to use geographic projection, true to use webmercator projection. For instance, EPSG:4326 uses geographic and EPSG:3857 uses webmercator.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:useWebMercatorProjection = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetUseWebMercatorProjectionAttr() const;
/// See GetUseWebMercatorProjectionAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateUseWebMercatorProjectionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SPECIFYTILINGSCHEME
// --------------------------------------------------------------------- //
/// True to specify quadtree tiling scheme according to projection and bounding rectangle, or false to automatically determine from projection.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:specifyTilingScheme = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetSpecifyTilingSchemeAttr() const;
/// See GetSpecifyTilingSchemeAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateSpecifyTilingSchemeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ROOTTILESX
// --------------------------------------------------------------------- //
/// Tile number corresponding to TileCol, also known as TileMatrixWidth
///
/// | ||
/// | -- | -- |
/// | Declaration | `int cesium:rootTilesX = 1` |
/// | C++ Type | int |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int |
CESIUMUSDSCHEMAS_API
UsdAttribute GetRootTilesXAttr() const;
/// See GetRootTilesXAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateRootTilesXAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ROOTTILESY
// --------------------------------------------------------------------- //
/// Tile number corresponding to TileRow, also known as TileMatrixHeight
///
/// | ||
/// | -- | -- |
/// | Declaration | `int cesium:rootTilesY = 1` |
/// | C++ Type | int |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int |
CESIUMUSDSCHEMAS_API
UsdAttribute GetRootTilesYAttr() const;
/// See GetRootTilesYAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateRootTilesYAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// WEST
// --------------------------------------------------------------------- //
/// The longitude of the west boundary on globe in degrees, in the range [-180, 180]
///
/// | ||
/// | -- | -- |
/// | Declaration | `double cesium:west = -180` |
/// | C++ Type | double |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
CESIUMUSDSCHEMAS_API
UsdAttribute GetWestAttr() const;
/// See GetWestAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateWestAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// EAST
// --------------------------------------------------------------------- //
/// The longitude of the east boundary on globe in degrees, in the range [-180, 180]
///
/// | ||
/// | -- | -- |
/// | Declaration | `double cesium:east = 180` |
/// | C++ Type | double |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
CESIUMUSDSCHEMAS_API
UsdAttribute GetEastAttr() const;
/// See GetEastAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateEastAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SOUTH
// --------------------------------------------------------------------- //
/// The longitude of the south boundary on globe in degrees, in the range [-90, 90]
///
/// | ||
/// | -- | -- |
/// | Declaration | `double cesium:south = -90` |
/// | C++ Type | double |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
CESIUMUSDSCHEMAS_API
UsdAttribute GetSouthAttr() const;
/// See GetSouthAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateSouthAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// NORTH
// --------------------------------------------------------------------- //
/// The longitude of the north boundary on globe in degrees, in the range [-90, 90]
///
/// | ||
/// | -- | -- |
/// | Declaration | `double cesium:north = 90` |
/// | C++ Type | double |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
CESIUMUSDSCHEMAS_API
UsdAttribute GetNorthAttr() const;
/// See GetNorthAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateNorthAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SPECIFYZOOMLEVELS
// --------------------------------------------------------------------- //
/// True to directly specify minum and maximum zoom levels available from the server, or false to automatically determine the minimum and maximum zoom levels from the server's tilemapresource.xml file.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:specifyZoomLevels = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetSpecifyZoomLevelsAttr() const;
/// See GetSpecifyZoomLevelsAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateSpecifyZoomLevelsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MINIMUMZOOMLEVEL
// --------------------------------------------------------------------- //
/// Minimum zoom level
///
/// | ||
/// | -- | -- |
/// | Declaration | `int cesium:minimumZoomLevel = 0` |
/// | C++ Type | int |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int |
CESIUMUSDSCHEMAS_API
UsdAttribute GetMinimumZoomLevelAttr() const;
/// See GetMinimumZoomLevelAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateMinimumZoomLevelAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MAXIMUMZOOMLEVEL
// --------------------------------------------------------------------- //
/// Maximum zoom level
///
/// | ||
/// | -- | -- |
/// | Declaration | `int cesium:maximumZoomLevel = 25` |
/// | C++ Type | int |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int |
CESIUMUSDSCHEMAS_API
UsdAttribute GetMaximumZoomLevelAttr() const;
/// See GetMaximumZoomLevelAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateMaximumZoomLevelAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| 24,500 | C | 42.596085 | 205 | 0.572571 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapIonServer.cpp | #include ".//ionServer.h"
#include "pxr/usd/usd/schemaBase.h"
#include "pxr/usd/sdf/primSpec.h"
#include "pxr/usd/usd/pyConversions.h"
#include "pxr/base/tf/pyContainerConversions.h"
#include "pxr/base/tf/pyResultConversions.h"
#include "pxr/base/tf/pyUtils.h"
#include "pxr/base/tf/wrapTypeHelpers.h"
#include <boost/python.hpp>
#include <string>
using namespace boost::python;
PXR_NAMESPACE_USING_DIRECTIVE
namespace {
#define WRAP_CUSTOM \
template <class Cls> static void _CustomWrapCode(Cls &_class)
// fwd decl.
WRAP_CUSTOM;
static UsdAttribute
_CreateDisplayNameAttr(CesiumIonServer &self,
object defaultVal, bool writeSparsely) {
return self.CreateDisplayNameAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateIonServerUrlAttr(CesiumIonServer &self,
object defaultVal, bool writeSparsely) {
return self.CreateIonServerUrlAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateIonServerApiUrlAttr(CesiumIonServer &self,
object defaultVal, bool writeSparsely) {
return self.CreateIonServerApiUrlAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateIonServerApplicationIdAttr(CesiumIonServer &self,
object defaultVal, bool writeSparsely) {
return self.CreateIonServerApplicationIdAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Int64), writeSparsely);
}
static UsdAttribute
_CreateProjectDefaultIonAccessTokenAttr(CesiumIonServer &self,
object defaultVal, bool writeSparsely) {
return self.CreateProjectDefaultIonAccessTokenAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateProjectDefaultIonAccessTokenIdAttr(CesiumIonServer &self,
object defaultVal, bool writeSparsely) {
return self.CreateProjectDefaultIonAccessTokenIdAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static std::string
_Repr(const CesiumIonServer &self)
{
std::string primRepr = TfPyRepr(self.GetPrim());
return TfStringPrintf(
"CesiumUsdSchemas.IonServer(%s)",
primRepr.c_str());
}
} // anonymous namespace
void wrapCesiumIonServer()
{
typedef CesiumIonServer This;
class_<This, bases<UsdTyped> >
cls("IonServer");
cls
.def(init<UsdPrim>(arg("prim")))
.def(init<UsdSchemaBase const&>(arg("schemaObj")))
.def(TfTypePythonClass())
.def("Get", &This::Get, (arg("stage"), arg("path")))
.staticmethod("Get")
.def("Define", &This::Define, (arg("stage"), arg("path")))
.staticmethod("Define")
.def("GetSchemaAttributeNames",
&This::GetSchemaAttributeNames,
arg("includeInherited")=true,
return_value_policy<TfPySequenceToList>())
.staticmethod("GetSchemaAttributeNames")
.def("_GetStaticTfType", (TfType const &(*)()) TfType::Find<This>,
return_value_policy<return_by_value>())
.staticmethod("_GetStaticTfType")
.def(!self)
.def("GetDisplayNameAttr",
&This::GetDisplayNameAttr)
.def("CreateDisplayNameAttr",
&_CreateDisplayNameAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetIonServerUrlAttr",
&This::GetIonServerUrlAttr)
.def("CreateIonServerUrlAttr",
&_CreateIonServerUrlAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetIonServerApiUrlAttr",
&This::GetIonServerApiUrlAttr)
.def("CreateIonServerApiUrlAttr",
&_CreateIonServerApiUrlAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetIonServerApplicationIdAttr",
&This::GetIonServerApplicationIdAttr)
.def("CreateIonServerApplicationIdAttr",
&_CreateIonServerApplicationIdAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetProjectDefaultIonAccessTokenAttr",
&This::GetProjectDefaultIonAccessTokenAttr)
.def("CreateProjectDefaultIonAccessTokenAttr",
&_CreateProjectDefaultIonAccessTokenAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetProjectDefaultIonAccessTokenIdAttr",
&This::GetProjectDefaultIonAccessTokenIdAttr)
.def("CreateProjectDefaultIonAccessTokenIdAttr",
&_CreateProjectDefaultIonAccessTokenIdAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("__repr__", ::_Repr)
;
_CustomWrapCode(cls);
}
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator. The entry point for your custom code should look
// minimally like the following:
//
// WRAP_CUSTOM {
// _class
// .def("MyCustomMethod", ...)
// ;
// }
//
// Of course any other ancillary or support code may be provided.
//
// Just remember to wrap code in the appropriate delimiters:
// 'namespace {', '}'.
//
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
namespace {
WRAP_CUSTOM {
}
}
| 5,889 | C++ | 30.666667 | 82 | 0.614196 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/session.cpp | #include ".//session.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumSession,
TfType::Bases< UsdTyped > >();
// Register the usd prim typename as an alias under UsdSchemaBase. This
// enables one to call
// TfType::Find<UsdSchemaBase>().FindDerivedByName("CesiumSessionPrim")
// to find TfType<CesiumSession>, which is how IsA queries are
// answered.
TfType::AddAlias<UsdSchemaBase, CesiumSession>("CesiumSessionPrim");
}
/* virtual */
CesiumSession::~CesiumSession()
{
}
/* static */
CesiumSession
CesiumSession::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumSession();
}
return CesiumSession(stage->GetPrimAtPath(path));
}
/* static */
CesiumSession
CesiumSession::Define(
const UsdStagePtr &stage, const SdfPath &path)
{
static TfToken usdPrimTypeName("CesiumSessionPrim");
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumSession();
}
return CesiumSession(
stage->DefinePrim(path, usdPrimTypeName));
}
/* virtual */
UsdSchemaKind CesiumSession::_GetSchemaKind() const
{
return CesiumSession::schemaKind;
}
/* static */
const TfType &
CesiumSession::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumSession>();
return tfType;
}
/* static */
bool
CesiumSession::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumSession::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumSession::GetEcefToUsdTransformAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumEcefToUsdTransform);
}
UsdAttribute
CesiumSession::CreateEcefToUsdTransformAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumEcefToUsdTransform,
SdfValueTypeNames->Matrix4d,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumSession::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumEcefToUsdTransform,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
UsdTyped::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 3,568 | C++ | 24.492857 | 98 | 0.654989 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/ionServer.cpp | #include ".//ionServer.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumIonServer,
TfType::Bases< UsdTyped > >();
// Register the usd prim typename as an alias under UsdSchemaBase. This
// enables one to call
// TfType::Find<UsdSchemaBase>().FindDerivedByName("CesiumIonServerPrim")
// to find TfType<CesiumIonServer>, which is how IsA queries are
// answered.
TfType::AddAlias<UsdSchemaBase, CesiumIonServer>("CesiumIonServerPrim");
}
/* virtual */
CesiumIonServer::~CesiumIonServer()
{
}
/* static */
CesiumIonServer
CesiumIonServer::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumIonServer();
}
return CesiumIonServer(stage->GetPrimAtPath(path));
}
/* static */
CesiumIonServer
CesiumIonServer::Define(
const UsdStagePtr &stage, const SdfPath &path)
{
static TfToken usdPrimTypeName("CesiumIonServerPrim");
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumIonServer();
}
return CesiumIonServer(
stage->DefinePrim(path, usdPrimTypeName));
}
/* virtual */
UsdSchemaKind CesiumIonServer::_GetSchemaKind() const
{
return CesiumIonServer::schemaKind;
}
/* static */
const TfType &
CesiumIonServer::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumIonServer>();
return tfType;
}
/* static */
bool
CesiumIonServer::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumIonServer::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumIonServer::GetDisplayNameAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDisplayName);
}
UsdAttribute
CesiumIonServer::CreateDisplayNameAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDisplayName,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumIonServer::GetIonServerUrlAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumIonServerUrl);
}
UsdAttribute
CesiumIonServer::CreateIonServerUrlAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumIonServerUrl,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumIonServer::GetIonServerApiUrlAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumIonServerApiUrl);
}
UsdAttribute
CesiumIonServer::CreateIonServerApiUrlAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumIonServerApiUrl,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumIonServer::GetIonServerApplicationIdAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumIonServerApplicationId);
}
UsdAttribute
CesiumIonServer::CreateIonServerApplicationIdAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumIonServerApplicationId,
SdfValueTypeNames->Int64,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumIonServer::GetProjectDefaultIonAccessTokenAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumProjectDefaultIonAccessToken);
}
UsdAttribute
CesiumIonServer::CreateProjectDefaultIonAccessTokenAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumProjectDefaultIonAccessToken,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumIonServer::GetProjectDefaultIonAccessTokenIdAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumProjectDefaultIonAccessTokenId);
}
UsdAttribute
CesiumIonServer::CreateProjectDefaultIonAccessTokenIdAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumProjectDefaultIonAccessTokenId,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumIonServer::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumDisplayName,
CesiumTokens->cesiumIonServerUrl,
CesiumTokens->cesiumIonServerApiUrl,
CesiumTokens->cesiumIonServerApplicationId,
CesiumTokens->cesiumProjectDefaultIonAccessToken,
CesiumTokens->cesiumProjectDefaultIonAccessTokenId,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
UsdTyped::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 6,697 | C++ | 28.121739 | 112 | 0.662386 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/module.cpp | #include "pxr/pxr.h"
#include "pxr/base/tf/pyModule.h"
PXR_NAMESPACE_USING_DIRECTIVE
TF_WRAP_MODULE
{
TF_WRAP(CesiumData);
TF_WRAP(CesiumGeoreference);
TF_WRAP(CesiumGlobeAnchorAPI);
TF_WRAP(CesiumIonServer);
TF_WRAP(CesiumRasterOverlay);
TF_WRAP(CesiumIonRasterOverlay);
TF_WRAP(CesiumPolygonRasterOverlay);
TF_WRAP(CesiumSession);
TF_WRAP(CesiumTileMapServiceRasterOverlay);
TF_WRAP(CesiumTileset);
TF_WRAP(CesiumTokens);
TF_WRAP(CesiumWebMapServiceRasterOverlay);
TF_WRAP(CesiumWebMapTileServiceRasterOverlay);
}
| 544 | C++ | 23.772726 | 48 | 0.779412 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/webMapServiceRasterOverlay.cpp | #include ".//webMapServiceRasterOverlay.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumWebMapServiceRasterOverlay,
TfType::Bases< CesiumRasterOverlay > >();
// Register the usd prim typename as an alias under UsdSchemaBase. This
// enables one to call
// TfType::Find<UsdSchemaBase>().FindDerivedByName("CesiumWebMapServiceRasterOverlayPrim")
// to find TfType<CesiumWebMapServiceRasterOverlay>, which is how IsA queries are
// answered.
TfType::AddAlias<UsdSchemaBase, CesiumWebMapServiceRasterOverlay>("CesiumWebMapServiceRasterOverlayPrim");
}
/* virtual */
CesiumWebMapServiceRasterOverlay::~CesiumWebMapServiceRasterOverlay()
{
}
/* static */
CesiumWebMapServiceRasterOverlay
CesiumWebMapServiceRasterOverlay::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumWebMapServiceRasterOverlay();
}
return CesiumWebMapServiceRasterOverlay(stage->GetPrimAtPath(path));
}
/* static */
CesiumWebMapServiceRasterOverlay
CesiumWebMapServiceRasterOverlay::Define(
const UsdStagePtr &stage, const SdfPath &path)
{
static TfToken usdPrimTypeName("CesiumWebMapServiceRasterOverlayPrim");
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumWebMapServiceRasterOverlay();
}
return CesiumWebMapServiceRasterOverlay(
stage->DefinePrim(path, usdPrimTypeName));
}
/* virtual */
UsdSchemaKind CesiumWebMapServiceRasterOverlay::_GetSchemaKind() const
{
return CesiumWebMapServiceRasterOverlay::schemaKind;
}
/* static */
const TfType &
CesiumWebMapServiceRasterOverlay::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumWebMapServiceRasterOverlay>();
return tfType;
}
/* static */
bool
CesiumWebMapServiceRasterOverlay::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumWebMapServiceRasterOverlay::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::GetBaseUrlAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumBaseUrl);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::CreateBaseUrlAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumBaseUrl,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::GetLayersAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumLayers);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::CreateLayersAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumLayers,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::GetTileWidthAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumTileWidth);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::CreateTileWidthAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumTileWidth,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::GetTileHeightAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumTileHeight);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::CreateTileHeightAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumTileHeight,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::GetMinimumLevelAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMinimumLevel);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::CreateMinimumLevelAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMinimumLevel,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::GetMaximumLevelAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMaximumLevel);
}
UsdAttribute
CesiumWebMapServiceRasterOverlay::CreateMaximumLevelAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMaximumLevel,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumWebMapServiceRasterOverlay::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumBaseUrl,
CesiumTokens->cesiumLayers,
CesiumTokens->cesiumTileWidth,
CesiumTokens->cesiumTileHeight,
CesiumTokens->cesiumMinimumLevel,
CesiumTokens->cesiumMaximumLevel,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
CesiumRasterOverlay::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 7,010 | C++ | 29.482609 | 111 | 0.677461 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/georeference.cpp | #include ".//georeference.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumGeoreference,
TfType::Bases< UsdTyped > >();
// Register the usd prim typename as an alias under UsdSchemaBase. This
// enables one to call
// TfType::Find<UsdSchemaBase>().FindDerivedByName("CesiumGeoreferencePrim")
// to find TfType<CesiumGeoreference>, which is how IsA queries are
// answered.
TfType::AddAlias<UsdSchemaBase, CesiumGeoreference>("CesiumGeoreferencePrim");
}
/* virtual */
CesiumGeoreference::~CesiumGeoreference()
{
}
/* static */
CesiumGeoreference
CesiumGeoreference::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumGeoreference();
}
return CesiumGeoreference(stage->GetPrimAtPath(path));
}
/* static */
CesiumGeoreference
CesiumGeoreference::Define(
const UsdStagePtr &stage, const SdfPath &path)
{
static TfToken usdPrimTypeName("CesiumGeoreferencePrim");
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumGeoreference();
}
return CesiumGeoreference(
stage->DefinePrim(path, usdPrimTypeName));
}
/* virtual */
UsdSchemaKind CesiumGeoreference::_GetSchemaKind() const
{
return CesiumGeoreference::schemaKind;
}
/* static */
const TfType &
CesiumGeoreference::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumGeoreference>();
return tfType;
}
/* static */
bool
CesiumGeoreference::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumGeoreference::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumGeoreference::GetGeoreferenceOriginLongitudeAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumGeoreferenceOriginLongitude);
}
UsdAttribute
CesiumGeoreference::CreateGeoreferenceOriginLongitudeAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumGeoreferenceOriginLongitude,
SdfValueTypeNames->Double,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumGeoreference::GetGeoreferenceOriginLatitudeAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumGeoreferenceOriginLatitude);
}
UsdAttribute
CesiumGeoreference::CreateGeoreferenceOriginLatitudeAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumGeoreferenceOriginLatitude,
SdfValueTypeNames->Double,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumGeoreference::GetGeoreferenceOriginHeightAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumGeoreferenceOriginHeight);
}
UsdAttribute
CesiumGeoreference::CreateGeoreferenceOriginHeightAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumGeoreferenceOriginHeight,
SdfValueTypeNames->Double,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumGeoreference::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumGeoreferenceOriginLongitude,
CesiumTokens->cesiumGeoreferenceOriginLatitude,
CesiumTokens->cesiumGeoreferenceOriginHeight,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
UsdTyped::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 5,035 | C++ | 27.613636 | 112 | 0.673684 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/webMapTileServiceRasterOverlay.cpp | #include ".//webMapTileServiceRasterOverlay.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumWebMapTileServiceRasterOverlay,
TfType::Bases< CesiumRasterOverlay > >();
// Register the usd prim typename as an alias under UsdSchemaBase. This
// enables one to call
// TfType::Find<UsdSchemaBase>().FindDerivedByName("CesiumWebMapTileServiceRasterOverlayPrim")
// to find TfType<CesiumWebMapTileServiceRasterOverlay>, which is how IsA queries are
// answered.
TfType::AddAlias<UsdSchemaBase, CesiumWebMapTileServiceRasterOverlay>("CesiumWebMapTileServiceRasterOverlayPrim");
}
/* virtual */
CesiumWebMapTileServiceRasterOverlay::~CesiumWebMapTileServiceRasterOverlay()
{
}
/* static */
CesiumWebMapTileServiceRasterOverlay
CesiumWebMapTileServiceRasterOverlay::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumWebMapTileServiceRasterOverlay();
}
return CesiumWebMapTileServiceRasterOverlay(stage->GetPrimAtPath(path));
}
/* static */
CesiumWebMapTileServiceRasterOverlay
CesiumWebMapTileServiceRasterOverlay::Define(
const UsdStagePtr &stage, const SdfPath &path)
{
static TfToken usdPrimTypeName("CesiumWebMapTileServiceRasterOverlayPrim");
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumWebMapTileServiceRasterOverlay();
}
return CesiumWebMapTileServiceRasterOverlay(
stage->DefinePrim(path, usdPrimTypeName));
}
/* virtual */
UsdSchemaKind CesiumWebMapTileServiceRasterOverlay::_GetSchemaKind() const
{
return CesiumWebMapTileServiceRasterOverlay::schemaKind;
}
/* static */
const TfType &
CesiumWebMapTileServiceRasterOverlay::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumWebMapTileServiceRasterOverlay>();
return tfType;
}
/* static */
bool
CesiumWebMapTileServiceRasterOverlay::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumWebMapTileServiceRasterOverlay::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetUrlAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumUrl);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateUrlAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumUrl,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetLayerAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumLayer);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateLayerAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumLayer,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetStyleAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumStyle);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateStyleAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumStyle,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetFormatAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumFormat);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateFormatAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumFormat,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetTileMatrixSetIdAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumTileMatrixSetId);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateTileMatrixSetIdAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumTileMatrixSetId,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetSpecifyTileMatrixSetLabelsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumSpecifyTileMatrixSetLabels);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateSpecifyTileMatrixSetLabelsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumSpecifyTileMatrixSetLabels,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetTileMatrixSetLabelPrefixAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumTileMatrixSetLabelPrefix);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateTileMatrixSetLabelPrefixAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumTileMatrixSetLabelPrefix,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetTileMatrixSetLabelsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumTileMatrixSetLabels);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateTileMatrixSetLabelsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumTileMatrixSetLabels,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetUseWebMercatorProjectionAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumUseWebMercatorProjection);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateUseWebMercatorProjectionAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumUseWebMercatorProjection,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetSpecifyTilingSchemeAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumSpecifyTilingScheme);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateSpecifyTilingSchemeAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumSpecifyTilingScheme,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetRootTilesXAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumRootTilesX);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateRootTilesXAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumRootTilesX,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetRootTilesYAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumRootTilesY);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateRootTilesYAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumRootTilesY,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetWestAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumWest);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateWestAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumWest,
SdfValueTypeNames->Double,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetEastAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumEast);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateEastAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumEast,
SdfValueTypeNames->Double,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetSouthAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumSouth);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateSouthAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumSouth,
SdfValueTypeNames->Double,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetNorthAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumNorth);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateNorthAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumNorth,
SdfValueTypeNames->Double,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetSpecifyZoomLevelsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumSpecifyZoomLevels);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateSpecifyZoomLevelsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumSpecifyZoomLevels,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetMinimumZoomLevelAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMinimumZoomLevel);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateMinimumZoomLevelAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMinimumZoomLevel,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::GetMaximumZoomLevelAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMaximumZoomLevel);
}
UsdAttribute
CesiumWebMapTileServiceRasterOverlay::CreateMaximumZoomLevelAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMaximumZoomLevel,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumWebMapTileServiceRasterOverlay::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumUrl,
CesiumTokens->cesiumLayer,
CesiumTokens->cesiumStyle,
CesiumTokens->cesiumFormat,
CesiumTokens->cesiumTileMatrixSetId,
CesiumTokens->cesiumSpecifyTileMatrixSetLabels,
CesiumTokens->cesiumTileMatrixSetLabelPrefix,
CesiumTokens->cesiumTileMatrixSetLabels,
CesiumTokens->cesiumUseWebMercatorProjection,
CesiumTokens->cesiumSpecifyTilingScheme,
CesiumTokens->cesiumRootTilesX,
CesiumTokens->cesiumRootTilesY,
CesiumTokens->cesiumWest,
CesiumTokens->cesiumEast,
CesiumTokens->cesiumSouth,
CesiumTokens->cesiumNorth,
CesiumTokens->cesiumSpecifyZoomLevels,
CesiumTokens->cesiumMinimumZoomLevel,
CesiumTokens->cesiumMaximumZoomLevel,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
CesiumRasterOverlay::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 15,285 | C++ | 31.943965 | 129 | 0.676873 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/globeAnchorAPI.cpp | #include ".//globeAnchorAPI.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/usd/tokens.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumGlobeAnchorAPI,
TfType::Bases< UsdAPISchemaBase > >();
}
TF_DEFINE_PRIVATE_TOKENS(
_schemaTokens,
(CesiumGlobeAnchorSchemaAPI)
);
/* virtual */
CesiumGlobeAnchorAPI::~CesiumGlobeAnchorAPI()
{
}
/* static */
CesiumGlobeAnchorAPI
CesiumGlobeAnchorAPI::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumGlobeAnchorAPI();
}
return CesiumGlobeAnchorAPI(stage->GetPrimAtPath(path));
}
/* virtual */
UsdSchemaKind CesiumGlobeAnchorAPI::_GetSchemaKind() const
{
return CesiumGlobeAnchorAPI::schemaKind;
}
/* static */
bool
CesiumGlobeAnchorAPI::CanApply(
const UsdPrim &prim, std::string *whyNot)
{
return prim.CanApplyAPI<CesiumGlobeAnchorAPI>(whyNot);
}
/* static */
CesiumGlobeAnchorAPI
CesiumGlobeAnchorAPI::Apply(const UsdPrim &prim)
{
if (prim.ApplyAPI<CesiumGlobeAnchorAPI>()) {
return CesiumGlobeAnchorAPI(prim);
}
return CesiumGlobeAnchorAPI();
}
/* static */
const TfType &
CesiumGlobeAnchorAPI::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumGlobeAnchorAPI>();
return tfType;
}
/* static */
bool
CesiumGlobeAnchorAPI::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumGlobeAnchorAPI::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumGlobeAnchorAPI::GetAdjustOrientationForGlobeWhenMovingAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumAnchorAdjustOrientationForGlobeWhenMoving);
}
UsdAttribute
CesiumGlobeAnchorAPI::CreateAdjustOrientationForGlobeWhenMovingAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumAnchorAdjustOrientationForGlobeWhenMoving,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumGlobeAnchorAPI::GetDetectTransformChangesAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumAnchorDetectTransformChanges);
}
UsdAttribute
CesiumGlobeAnchorAPI::CreateDetectTransformChangesAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumAnchorDetectTransformChanges,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumGlobeAnchorAPI::GetAnchorLongitudeAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumAnchorLongitude);
}
UsdAttribute
CesiumGlobeAnchorAPI::CreateAnchorLongitudeAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumAnchorLongitude,
SdfValueTypeNames->Double,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumGlobeAnchorAPI::GetAnchorLatitudeAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumAnchorLatitude);
}
UsdAttribute
CesiumGlobeAnchorAPI::CreateAnchorLatitudeAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumAnchorLatitude,
SdfValueTypeNames->Double,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumGlobeAnchorAPI::GetAnchorHeightAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumAnchorHeight);
}
UsdAttribute
CesiumGlobeAnchorAPI::CreateAnchorHeightAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumAnchorHeight,
SdfValueTypeNames->Double,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumGlobeAnchorAPI::GetPositionAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumAnchorPosition);
}
UsdAttribute
CesiumGlobeAnchorAPI::CreatePositionAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumAnchorPosition,
SdfValueTypeNames->Double3,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdRelationship
CesiumGlobeAnchorAPI::GetGeoreferenceBindingRel() const
{
return GetPrim().GetRelationship(CesiumTokens->cesiumAnchorGeoreferenceBinding);
}
UsdRelationship
CesiumGlobeAnchorAPI::CreateGeoreferenceBindingRel() const
{
return GetPrim().CreateRelationship(CesiumTokens->cesiumAnchorGeoreferenceBinding,
/* custom = */ false);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumGlobeAnchorAPI::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumAnchorAdjustOrientationForGlobeWhenMoving,
CesiumTokens->cesiumAnchorDetectTransformChanges,
CesiumTokens->cesiumAnchorLongitude,
CesiumTokens->cesiumAnchorLatitude,
CesiumTokens->cesiumAnchorHeight,
CesiumTokens->cesiumAnchorPosition,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
UsdAPISchemaBase::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 7,019 | C++ | 27.306452 | 122 | 0.675025 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/georeference.h | #ifndef CESIUMUSDSCHEMAS_GENERATED_GEOREFERENCE_H
#define CESIUMUSDSCHEMAS_GENERATED_GEOREFERENCE_H
/// \file CesiumUsdSchemas/georeference.h
#include "pxr/pxr.h"
#include ".//api.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include ".//tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// CESIUMGEOREFERENCEPRIM //
// -------------------------------------------------------------------------- //
/// \class CesiumGeoreference
///
/// Stores Georeference data for Cesium for Omniverse. Every stage should have at least one of these.
///
class CesiumGeoreference : public UsdTyped
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a CesiumGeoreference on UsdPrim \p prim .
/// Equivalent to CesiumGeoreference::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit CesiumGeoreference(const UsdPrim& prim=UsdPrim())
: UsdTyped(prim)
{
}
/// Construct a CesiumGeoreference on the prim held by \p schemaObj .
/// Should be preferred over CesiumGeoreference(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit CesiumGeoreference(const UsdSchemaBase& schemaObj)
: UsdTyped(schemaObj)
{
}
/// Destructor.
CESIUMUSDSCHEMAS_API
virtual ~CesiumGeoreference();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
CESIUMUSDSCHEMAS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a CesiumGeoreference holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// CesiumGeoreference(stage->GetPrimAtPath(path));
/// \endcode
///
CESIUMUSDSCHEMAS_API
static CesiumGeoreference
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
CESIUMUSDSCHEMAS_API
static CesiumGeoreference
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
CESIUMUSDSCHEMAS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
CESIUMUSDSCHEMAS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
CESIUMUSDSCHEMAS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// GEOREFERENCEORIGINLONGITUDE
// --------------------------------------------------------------------- //
/// The longitude of the origin in degrees, in the range [-180, 180].
///
/// | ||
/// | -- | -- |
/// | Declaration | `double cesium:georeferenceOrigin:longitude = -105.25737` |
/// | C++ Type | double |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
CESIUMUSDSCHEMAS_API
UsdAttribute GetGeoreferenceOriginLongitudeAttr() const;
/// See GetGeoreferenceOriginLongitudeAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateGeoreferenceOriginLongitudeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// GEOREFERENCEORIGINLATITUDE
// --------------------------------------------------------------------- //
/// The latitude of the origin in degrees, in the range [-90, 90].
///
/// | ||
/// | -- | -- |
/// | Declaration | `double cesium:georeferenceOrigin:latitude = 39.736401` |
/// | C++ Type | double |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
CESIUMUSDSCHEMAS_API
UsdAttribute GetGeoreferenceOriginLatitudeAttr() const;
/// See GetGeoreferenceOriginLatitudeAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateGeoreferenceOriginLatitudeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// GEOREFERENCEORIGINHEIGHT
// --------------------------------------------------------------------- //
/// The height of the origin in meters above the WGS84 ellipsoid. Do not confuse this with a geoid height or height above mean sea level, which can be tens of meters higher or lower depending on where in the world the origin is located.
///
/// | ||
/// | -- | -- |
/// | Declaration | `double cesium:georeferenceOrigin:height = 2250` |
/// | C++ Type | double |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
CESIUMUSDSCHEMAS_API
UsdAttribute GetGeoreferenceOriginHeightAttr() const;
/// See GetGeoreferenceOriginHeightAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateGeoreferenceOriginHeightAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| 8,471 | C | 39.342857 | 240 | 0.617991 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapGlobeAnchorAPI.cpp | #include ".//globeAnchorAPI.h"
#include "pxr/usd/usd/schemaBase.h"
#include "pxr/usd/sdf/primSpec.h"
#include "pxr/usd/usd/pyConversions.h"
#include "pxr/base/tf/pyAnnotatedBoolResult.h"
#include "pxr/base/tf/pyContainerConversions.h"
#include "pxr/base/tf/pyResultConversions.h"
#include "pxr/base/tf/pyUtils.h"
#include "pxr/base/tf/wrapTypeHelpers.h"
#include <boost/python.hpp>
#include <string>
using namespace boost::python;
PXR_NAMESPACE_USING_DIRECTIVE
namespace {
#define WRAP_CUSTOM \
template <class Cls> static void _CustomWrapCode(Cls &_class)
// fwd decl.
WRAP_CUSTOM;
static UsdAttribute
_CreateAdjustOrientationForGlobeWhenMovingAttr(CesiumGlobeAnchorAPI &self,
object defaultVal, bool writeSparsely) {
return self.CreateAdjustOrientationForGlobeWhenMovingAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateDetectTransformChangesAttr(CesiumGlobeAnchorAPI &self,
object defaultVal, bool writeSparsely) {
return self.CreateDetectTransformChangesAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateAnchorLongitudeAttr(CesiumGlobeAnchorAPI &self,
object defaultVal, bool writeSparsely) {
return self.CreateAnchorLongitudeAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Double), writeSparsely);
}
static UsdAttribute
_CreateAnchorLatitudeAttr(CesiumGlobeAnchorAPI &self,
object defaultVal, bool writeSparsely) {
return self.CreateAnchorLatitudeAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Double), writeSparsely);
}
static UsdAttribute
_CreateAnchorHeightAttr(CesiumGlobeAnchorAPI &self,
object defaultVal, bool writeSparsely) {
return self.CreateAnchorHeightAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Double), writeSparsely);
}
static UsdAttribute
_CreatePositionAttr(CesiumGlobeAnchorAPI &self,
object defaultVal, bool writeSparsely) {
return self.CreatePositionAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Double3), writeSparsely);
}
static std::string
_Repr(const CesiumGlobeAnchorAPI &self)
{
std::string primRepr = TfPyRepr(self.GetPrim());
return TfStringPrintf(
"CesiumUsdSchemas.GlobeAnchorAPI(%s)",
primRepr.c_str());
}
struct CesiumGlobeAnchorAPI_CanApplyResult :
public TfPyAnnotatedBoolResult<std::string>
{
CesiumGlobeAnchorAPI_CanApplyResult(bool val, std::string const &msg) :
TfPyAnnotatedBoolResult<std::string>(val, msg) {}
};
static CesiumGlobeAnchorAPI_CanApplyResult
_WrapCanApply(const UsdPrim& prim)
{
std::string whyNot;
bool result = CesiumGlobeAnchorAPI::CanApply(prim, &whyNot);
return CesiumGlobeAnchorAPI_CanApplyResult(result, whyNot);
}
} // anonymous namespace
void wrapCesiumGlobeAnchorAPI()
{
typedef CesiumGlobeAnchorAPI This;
CesiumGlobeAnchorAPI_CanApplyResult::Wrap<CesiumGlobeAnchorAPI_CanApplyResult>(
"_CanApplyResult", "whyNot");
class_<This, bases<UsdAPISchemaBase> >
cls("GlobeAnchorAPI");
cls
.def(init<UsdPrim>(arg("prim")))
.def(init<UsdSchemaBase const&>(arg("schemaObj")))
.def(TfTypePythonClass())
.def("Get", &This::Get, (arg("stage"), arg("path")))
.staticmethod("Get")
.def("CanApply", &_WrapCanApply, (arg("prim")))
.staticmethod("CanApply")
.def("Apply", &This::Apply, (arg("prim")))
.staticmethod("Apply")
.def("GetSchemaAttributeNames",
&This::GetSchemaAttributeNames,
arg("includeInherited")=true,
return_value_policy<TfPySequenceToList>())
.staticmethod("GetSchemaAttributeNames")
.def("_GetStaticTfType", (TfType const &(*)()) TfType::Find<This>,
return_value_policy<return_by_value>())
.staticmethod("_GetStaticTfType")
.def(!self)
.def("GetAdjustOrientationForGlobeWhenMovingAttr",
&This::GetAdjustOrientationForGlobeWhenMovingAttr)
.def("CreateAdjustOrientationForGlobeWhenMovingAttr",
&_CreateAdjustOrientationForGlobeWhenMovingAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetDetectTransformChangesAttr",
&This::GetDetectTransformChangesAttr)
.def("CreateDetectTransformChangesAttr",
&_CreateDetectTransformChangesAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetAnchorLongitudeAttr",
&This::GetAnchorLongitudeAttr)
.def("CreateAnchorLongitudeAttr",
&_CreateAnchorLongitudeAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetAnchorLatitudeAttr",
&This::GetAnchorLatitudeAttr)
.def("CreateAnchorLatitudeAttr",
&_CreateAnchorLatitudeAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetAnchorHeightAttr",
&This::GetAnchorHeightAttr)
.def("CreateAnchorHeightAttr",
&_CreateAnchorHeightAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetPositionAttr",
&This::GetPositionAttr)
.def("CreatePositionAttr",
&_CreatePositionAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetGeoreferenceBindingRel",
&This::GetGeoreferenceBindingRel)
.def("CreateGeoreferenceBindingRel",
&This::CreateGeoreferenceBindingRel)
.def("__repr__", ::_Repr)
;
_CustomWrapCode(cls);
}
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator. The entry point for your custom code should look
// minimally like the following:
//
// WRAP_CUSTOM {
// _class
// .def("MyCustomMethod", ...)
// ;
// }
//
// Of course any other ancillary or support code may be provided.
//
// Just remember to wrap code in the appropriate delimiters:
// 'namespace {', '}'.
//
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
namespace {
WRAP_CUSTOM {
}
}
| 6,790 | C++ | 30.882629 | 83 | 0.626951 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/rasterOverlay.h | #ifndef CESIUMUSDSCHEMAS_GENERATED_RASTEROVERLAY_H
#define CESIUMUSDSCHEMAS_GENERATED_RASTEROVERLAY_H
/// \file CesiumUsdSchemas/rasterOverlay.h
#include "pxr/pxr.h"
#include ".//api.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include ".//tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// CESIUMRASTEROVERLAYPRIM //
// -------------------------------------------------------------------------- //
/// \class CesiumRasterOverlay
///
/// Abstract base class for prims that represent a raster overlay.
///
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
/// that are text/tokens, the actual token is published and defined in \ref CesiumTokens.
/// So to set an attribute to the value "rightHanded", use CesiumTokens->rightHanded
/// as the value.
///
class CesiumRasterOverlay : public UsdTyped
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractTyped;
/// Construct a CesiumRasterOverlay on UsdPrim \p prim .
/// Equivalent to CesiumRasterOverlay::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit CesiumRasterOverlay(const UsdPrim& prim=UsdPrim())
: UsdTyped(prim)
{
}
/// Construct a CesiumRasterOverlay on the prim held by \p schemaObj .
/// Should be preferred over CesiumRasterOverlay(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit CesiumRasterOverlay(const UsdSchemaBase& schemaObj)
: UsdTyped(schemaObj)
{
}
/// Destructor.
CESIUMUSDSCHEMAS_API
virtual ~CesiumRasterOverlay();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
CESIUMUSDSCHEMAS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a CesiumRasterOverlay holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// CesiumRasterOverlay(stage->GetPrimAtPath(path));
/// \endcode
///
CESIUMUSDSCHEMAS_API
static CesiumRasterOverlay
Get(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
CESIUMUSDSCHEMAS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
CESIUMUSDSCHEMAS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
CESIUMUSDSCHEMAS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// SHOWCREDITSONSCREEN
// --------------------------------------------------------------------- //
/// Whether or not to show this raster overlay's credits on screen.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform bool cesium:showCreditsOnScreen = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
CESIUMUSDSCHEMAS_API
UsdAttribute GetShowCreditsOnScreenAttr() const;
/// See GetShowCreditsOnScreenAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateShowCreditsOnScreenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ALPHA
// --------------------------------------------------------------------- //
/// The alpha blending value, from 0.0 to 1.0, where 1.0 is fully opaque.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform float cesium:alpha = 1` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
CESIUMUSDSCHEMAS_API
UsdAttribute GetAlphaAttr() const;
/// See GetAlphaAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateAlphaAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// OVERLAYRENDERMETHOD
// --------------------------------------------------------------------- //
/// The Cesium default material will give the raster overlay a different rendering treatment based on this selection.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token cesium:overlayRenderMethod = "overlay"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
/// | \ref CesiumTokens "Allowed Values" | overlay, clip |
CESIUMUSDSCHEMAS_API
UsdAttribute GetOverlayRenderMethodAttr() const;
/// See GetOverlayRenderMethodAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateOverlayRenderMethodAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MAXIMUMSCREENSPACEERROR
// --------------------------------------------------------------------- //
/// The maximum number of pixels of error when rendering this overlay. This is used to select an appropriate level-of-detail. When this property has its default value, 2.0, it means that raster overlay images will be sized so that, when zoomed in closest, a single pixel in the raster overlay maps to approximately 2x2 pixels on the screen.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform float cesium:maximumScreenSpaceError = 2` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
CESIUMUSDSCHEMAS_API
UsdAttribute GetMaximumScreenSpaceErrorAttr() const;
/// See GetMaximumScreenSpaceErrorAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateMaximumScreenSpaceErrorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MAXIMUMTEXTURESIZE
// --------------------------------------------------------------------- //
/// The maximum texel size of raster overlay textures, in either direction. Images created by this overlay will be no more than this number of texels in either direction. This may result in reduced raster overlay detail in some cases.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform int cesium:maximumTextureSize = 2048` |
/// | C++ Type | int |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
CESIUMUSDSCHEMAS_API
UsdAttribute GetMaximumTextureSizeAttr() const;
/// See GetMaximumTextureSizeAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateMaximumTextureSizeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MAXIMUMSIMULTANEOUSTILELOADS
// --------------------------------------------------------------------- //
/// The maximum number of overlay tiles that may simultaneously be in the process of loading.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform int cesium:maximumSimultaneousTileLoads = 20` |
/// | C++ Type | int |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
CESIUMUSDSCHEMAS_API
UsdAttribute GetMaximumSimultaneousTileLoadsAttr() const;
/// See GetMaximumSimultaneousTileLoadsAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateMaximumSimultaneousTileLoadsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SUBTILECACHEBYTES
// --------------------------------------------------------------------- //
/// The maximum number of bytes to use to cache sub-tiles in memory. This is used by provider types, that have an underlying tiling scheme that may not align with the tiling scheme of the geometry tiles on which the raster overlay tiles are draped. Because a single sub-tile may overlap multiple geometry tiles, it is useful to cache loaded sub-tiles in memory in case they're needed again soon. This property controls the maximum size of that cache.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform int cesium:subTileCacheBytes = 16777216` |
/// | C++ Type | int |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
CESIUMUSDSCHEMAS_API
UsdAttribute GetSubTileCacheBytesAttr() const;
/// See GetSubTileCacheBytesAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateSubTileCacheBytesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| 12,723 | C | 43.48951 | 454 | 0.607247 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapWebMapTileServiceRasterOverlay.cpp | #include ".//webMapTileServiceRasterOverlay.h"
#include "pxr/usd/usd/schemaBase.h"
#include "pxr/usd/sdf/primSpec.h"
#include "pxr/usd/usd/pyConversions.h"
#include "pxr/base/tf/pyContainerConversions.h"
#include "pxr/base/tf/pyResultConversions.h"
#include "pxr/base/tf/pyUtils.h"
#include "pxr/base/tf/wrapTypeHelpers.h"
#include <boost/python.hpp>
#include <string>
using namespace boost::python;
PXR_NAMESPACE_USING_DIRECTIVE
namespace {
#define WRAP_CUSTOM \
template <class Cls> static void _CustomWrapCode(Cls &_class)
// fwd decl.
WRAP_CUSTOM;
static UsdAttribute
_CreateUrlAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateUrlAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateLayerAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateLayerAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateStyleAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateStyleAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateFormatAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateFormatAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateTileMatrixSetIdAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateTileMatrixSetIdAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateSpecifyTileMatrixSetLabelsAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateSpecifyTileMatrixSetLabelsAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateTileMatrixSetLabelPrefixAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateTileMatrixSetLabelPrefixAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateTileMatrixSetLabelsAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateTileMatrixSetLabelsAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->String), writeSparsely);
}
static UsdAttribute
_CreateUseWebMercatorProjectionAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateUseWebMercatorProjectionAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateSpecifyTilingSchemeAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateSpecifyTilingSchemeAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateRootTilesXAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateRootTilesXAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Int), writeSparsely);
}
static UsdAttribute
_CreateRootTilesYAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateRootTilesYAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Int), writeSparsely);
}
static UsdAttribute
_CreateWestAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateWestAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Double), writeSparsely);
}
static UsdAttribute
_CreateEastAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateEastAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Double), writeSparsely);
}
static UsdAttribute
_CreateSouthAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateSouthAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Double), writeSparsely);
}
static UsdAttribute
_CreateNorthAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateNorthAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Double), writeSparsely);
}
static UsdAttribute
_CreateSpecifyZoomLevelsAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateSpecifyZoomLevelsAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateMinimumZoomLevelAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateMinimumZoomLevelAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Int), writeSparsely);
}
static UsdAttribute
_CreateMaximumZoomLevelAttr(CesiumWebMapTileServiceRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateMaximumZoomLevelAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Int), writeSparsely);
}
static std::string
_Repr(const CesiumWebMapTileServiceRasterOverlay &self)
{
std::string primRepr = TfPyRepr(self.GetPrim());
return TfStringPrintf(
"CesiumUsdSchemas.WebMapTileServiceRasterOverlay(%s)",
primRepr.c_str());
}
} // anonymous namespace
void wrapCesiumWebMapTileServiceRasterOverlay()
{
typedef CesiumWebMapTileServiceRasterOverlay This;
class_<This, bases<CesiumRasterOverlay> >
cls("WebMapTileServiceRasterOverlay");
cls
.def(init<UsdPrim>(arg("prim")))
.def(init<UsdSchemaBase const&>(arg("schemaObj")))
.def(TfTypePythonClass())
.def("Get", &This::Get, (arg("stage"), arg("path")))
.staticmethod("Get")
.def("Define", &This::Define, (arg("stage"), arg("path")))
.staticmethod("Define")
.def("GetSchemaAttributeNames",
&This::GetSchemaAttributeNames,
arg("includeInherited")=true,
return_value_policy<TfPySequenceToList>())
.staticmethod("GetSchemaAttributeNames")
.def("_GetStaticTfType", (TfType const &(*)()) TfType::Find<This>,
return_value_policy<return_by_value>())
.staticmethod("_GetStaticTfType")
.def(!self)
.def("GetUrlAttr",
&This::GetUrlAttr)
.def("CreateUrlAttr",
&_CreateUrlAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetLayerAttr",
&This::GetLayerAttr)
.def("CreateLayerAttr",
&_CreateLayerAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetStyleAttr",
&This::GetStyleAttr)
.def("CreateStyleAttr",
&_CreateStyleAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetFormatAttr",
&This::GetFormatAttr)
.def("CreateFormatAttr",
&_CreateFormatAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetTileMatrixSetIdAttr",
&This::GetTileMatrixSetIdAttr)
.def("CreateTileMatrixSetIdAttr",
&_CreateTileMatrixSetIdAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetSpecifyTileMatrixSetLabelsAttr",
&This::GetSpecifyTileMatrixSetLabelsAttr)
.def("CreateSpecifyTileMatrixSetLabelsAttr",
&_CreateSpecifyTileMatrixSetLabelsAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetTileMatrixSetLabelPrefixAttr",
&This::GetTileMatrixSetLabelPrefixAttr)
.def("CreateTileMatrixSetLabelPrefixAttr",
&_CreateTileMatrixSetLabelPrefixAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetTileMatrixSetLabelsAttr",
&This::GetTileMatrixSetLabelsAttr)
.def("CreateTileMatrixSetLabelsAttr",
&_CreateTileMatrixSetLabelsAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetUseWebMercatorProjectionAttr",
&This::GetUseWebMercatorProjectionAttr)
.def("CreateUseWebMercatorProjectionAttr",
&_CreateUseWebMercatorProjectionAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetSpecifyTilingSchemeAttr",
&This::GetSpecifyTilingSchemeAttr)
.def("CreateSpecifyTilingSchemeAttr",
&_CreateSpecifyTilingSchemeAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetRootTilesXAttr",
&This::GetRootTilesXAttr)
.def("CreateRootTilesXAttr",
&_CreateRootTilesXAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetRootTilesYAttr",
&This::GetRootTilesYAttr)
.def("CreateRootTilesYAttr",
&_CreateRootTilesYAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetWestAttr",
&This::GetWestAttr)
.def("CreateWestAttr",
&_CreateWestAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetEastAttr",
&This::GetEastAttr)
.def("CreateEastAttr",
&_CreateEastAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetSouthAttr",
&This::GetSouthAttr)
.def("CreateSouthAttr",
&_CreateSouthAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetNorthAttr",
&This::GetNorthAttr)
.def("CreateNorthAttr",
&_CreateNorthAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetSpecifyZoomLevelsAttr",
&This::GetSpecifyZoomLevelsAttr)
.def("CreateSpecifyZoomLevelsAttr",
&_CreateSpecifyZoomLevelsAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetMinimumZoomLevelAttr",
&This::GetMinimumZoomLevelAttr)
.def("CreateMinimumZoomLevelAttr",
&_CreateMinimumZoomLevelAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetMaximumZoomLevelAttr",
&This::GetMaximumZoomLevelAttr)
.def("CreateMaximumZoomLevelAttr",
&_CreateMaximumZoomLevelAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("__repr__", ::_Repr)
;
_CustomWrapCode(cls);
}
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator. The entry point for your custom code should look
// minimally like the following:
//
// WRAP_CUSTOM {
// _class
// .def("MyCustomMethod", ...)
// ;
// }
//
// Of course any other ancillary or support code may be provided.
//
// Just remember to wrap code in the appropriate delimiters:
// 'namespace {', '}'.
//
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
namespace {
WRAP_CUSTOM {
}
}
| 13,063 | C++ | 34.5 | 82 | 0.618082 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/tileMapServiceRasterOverlay.cpp | #include ".//tileMapServiceRasterOverlay.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumTileMapServiceRasterOverlay,
TfType::Bases< CesiumRasterOverlay > >();
// Register the usd prim typename as an alias under UsdSchemaBase. This
// enables one to call
// TfType::Find<UsdSchemaBase>().FindDerivedByName("CesiumTileMapServiceRasterOverlayPrim")
// to find TfType<CesiumTileMapServiceRasterOverlay>, which is how IsA queries are
// answered.
TfType::AddAlias<UsdSchemaBase, CesiumTileMapServiceRasterOverlay>("CesiumTileMapServiceRasterOverlayPrim");
}
/* virtual */
CesiumTileMapServiceRasterOverlay::~CesiumTileMapServiceRasterOverlay()
{
}
/* static */
CesiumTileMapServiceRasterOverlay
CesiumTileMapServiceRasterOverlay::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumTileMapServiceRasterOverlay();
}
return CesiumTileMapServiceRasterOverlay(stage->GetPrimAtPath(path));
}
/* static */
CesiumTileMapServiceRasterOverlay
CesiumTileMapServiceRasterOverlay::Define(
const UsdStagePtr &stage, const SdfPath &path)
{
static TfToken usdPrimTypeName("CesiumTileMapServiceRasterOverlayPrim");
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumTileMapServiceRasterOverlay();
}
return CesiumTileMapServiceRasterOverlay(
stage->DefinePrim(path, usdPrimTypeName));
}
/* virtual */
UsdSchemaKind CesiumTileMapServiceRasterOverlay::_GetSchemaKind() const
{
return CesiumTileMapServiceRasterOverlay::schemaKind;
}
/* static */
const TfType &
CesiumTileMapServiceRasterOverlay::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumTileMapServiceRasterOverlay>();
return tfType;
}
/* static */
bool
CesiumTileMapServiceRasterOverlay::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumTileMapServiceRasterOverlay::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumTileMapServiceRasterOverlay::GetUrlAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumUrl);
}
UsdAttribute
CesiumTileMapServiceRasterOverlay::CreateUrlAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumUrl,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileMapServiceRasterOverlay::GetSpecifyZoomLevelsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumSpecifyZoomLevels);
}
UsdAttribute
CesiumTileMapServiceRasterOverlay::CreateSpecifyZoomLevelsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumSpecifyZoomLevels,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileMapServiceRasterOverlay::GetMinimumZoomLevelAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMinimumZoomLevel);
}
UsdAttribute
CesiumTileMapServiceRasterOverlay::CreateMinimumZoomLevelAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMinimumZoomLevel,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileMapServiceRasterOverlay::GetMaximumZoomLevelAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMaximumZoomLevel);
}
UsdAttribute
CesiumTileMapServiceRasterOverlay::CreateMaximumZoomLevelAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMaximumZoomLevel,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumTileMapServiceRasterOverlay::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumUrl,
CesiumTokens->cesiumSpecifyZoomLevels,
CesiumTokens->cesiumMinimumZoomLevel,
CesiumTokens->cesiumMaximumZoomLevel,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
CesiumRasterOverlay::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 5,926 | C++ | 29.551546 | 117 | 0.687985 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/ionRasterOverlay.h | #ifndef CESIUMUSDSCHEMAS_GENERATED_IONRASTEROVERLAY_H
#define CESIUMUSDSCHEMAS_GENERATED_IONRASTEROVERLAY_H
/// \file CesiumUsdSchemas/ionRasterOverlay.h
#include "pxr/pxr.h"
#include ".//api.h"
#include ".//rasterOverlay.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include ".//tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// CESIUMIONRASTEROVERLAYPRIM //
// -------------------------------------------------------------------------- //
/// \class CesiumIonRasterOverlay
///
/// Adds a prim for representing an ion raster overlay.
///
class CesiumIonRasterOverlay : public CesiumRasterOverlay
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a CesiumIonRasterOverlay on UsdPrim \p prim .
/// Equivalent to CesiumIonRasterOverlay::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit CesiumIonRasterOverlay(const UsdPrim& prim=UsdPrim())
: CesiumRasterOverlay(prim)
{
}
/// Construct a CesiumIonRasterOverlay on the prim held by \p schemaObj .
/// Should be preferred over CesiumIonRasterOverlay(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit CesiumIonRasterOverlay(const UsdSchemaBase& schemaObj)
: CesiumRasterOverlay(schemaObj)
{
}
/// Destructor.
CESIUMUSDSCHEMAS_API
virtual ~CesiumIonRasterOverlay();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
CESIUMUSDSCHEMAS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a CesiumIonRasterOverlay holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// CesiumIonRasterOverlay(stage->GetPrimAtPath(path));
/// \endcode
///
CESIUMUSDSCHEMAS_API
static CesiumIonRasterOverlay
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
CESIUMUSDSCHEMAS_API
static CesiumIonRasterOverlay
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
CESIUMUSDSCHEMAS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
CESIUMUSDSCHEMAS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
CESIUMUSDSCHEMAS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// IONASSETID
// --------------------------------------------------------------------- //
/// The ID of the Cesium ion asset to use.
///
/// | ||
/// | -- | -- |
/// | Declaration | `int64 cesium:ionAssetId = 0` |
/// | C++ Type | int64_t |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int64 |
CESIUMUSDSCHEMAS_API
UsdAttribute GetIonAssetIdAttr() const;
/// See GetIonAssetIdAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateIonAssetIdAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// IONACCESSTOKEN
// --------------------------------------------------------------------- //
/// The access token to use to access the Cesium ion resource. Overrides the default token. Blank if using URL.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:ionAccessToken = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetIonAccessTokenAttr() const;
/// See GetIonAccessTokenAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateIonAccessTokenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// IONSERVERBINDING
// --------------------------------------------------------------------- //
/// Specifies which Cesium ion Server prim to use for this tileset.
///
CESIUMUSDSCHEMAS_API
UsdRelationship GetIonServerBindingRel() const;
/// See GetIonServerBindingRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
CESIUMUSDSCHEMAS_API
UsdRelationship CreateIonServerBindingRel() const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| 7,700 | C | 37.123762 | 115 | 0.61 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/globeAnchorAPI.h | #ifndef CESIUMUSDSCHEMAS_GENERATED_GLOBEANCHORAPI_H
#define CESIUMUSDSCHEMAS_GENERATED_GLOBEANCHORAPI_H
/// \file CesiumUsdSchemas/globeAnchorAPI.h
#include "pxr/pxr.h"
#include ".//api.h"
#include "pxr/usd/usd/apiSchemaBase.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include ".//tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// CESIUMGLOBEANCHORSCHEMAAPI //
// -------------------------------------------------------------------------- //
/// \class CesiumGlobeAnchorAPI
///
/// Adds Globe Anchoring information to a Prim for use with Cesium for Omniverse.
///
class CesiumGlobeAnchorAPI : public UsdAPISchemaBase
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
/// Construct a CesiumGlobeAnchorAPI on UsdPrim \p prim .
/// Equivalent to CesiumGlobeAnchorAPI::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit CesiumGlobeAnchorAPI(const UsdPrim& prim=UsdPrim())
: UsdAPISchemaBase(prim)
{
}
/// Construct a CesiumGlobeAnchorAPI on the prim held by \p schemaObj .
/// Should be preferred over CesiumGlobeAnchorAPI(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit CesiumGlobeAnchorAPI(const UsdSchemaBase& schemaObj)
: UsdAPISchemaBase(schemaObj)
{
}
/// Destructor.
CESIUMUSDSCHEMAS_API
virtual ~CesiumGlobeAnchorAPI();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
CESIUMUSDSCHEMAS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a CesiumGlobeAnchorAPI holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// CesiumGlobeAnchorAPI(stage->GetPrimAtPath(path));
/// \endcode
///
CESIUMUSDSCHEMAS_API
static CesiumGlobeAnchorAPI
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Returns true if this <b>single-apply</b> API schema can be applied to
/// the given \p prim. If this schema can not be a applied to the prim,
/// this returns false and, if provided, populates \p whyNot with the
/// reason it can not be applied.
///
/// Note that if CanApply returns false, that does not necessarily imply
/// that calling Apply will fail. Callers are expected to call CanApply
/// before calling Apply if they want to ensure that it is valid to
/// apply a schema.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
CESIUMUSDSCHEMAS_API
static bool
CanApply(const UsdPrim &prim, std::string *whyNot=nullptr);
/// Applies this <b>single-apply</b> API schema to the given \p prim.
/// This information is stored by adding "CesiumGlobeAnchorSchemaAPI" to the
/// token-valued, listOp metadata \em apiSchemas on the prim.
///
/// \return A valid CesiumGlobeAnchorAPI object is returned upon success.
/// An invalid (or empty) CesiumGlobeAnchorAPI object is returned upon
/// failure. See \ref UsdPrim::ApplyAPI() for conditions
/// resulting in failure.
///
/// \sa UsdPrim::GetAppliedSchemas()
/// \sa UsdPrim::HasAPI()
/// \sa UsdPrim::CanApplyAPI()
/// \sa UsdPrim::ApplyAPI()
/// \sa UsdPrim::RemoveAPI()
///
CESIUMUSDSCHEMAS_API
static CesiumGlobeAnchorAPI
Apply(const UsdPrim &prim);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
CESIUMUSDSCHEMAS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
CESIUMUSDSCHEMAS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
CESIUMUSDSCHEMAS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// ADJUSTORIENTATIONFORGLOBEWHENMOVING
// --------------------------------------------------------------------- //
/// Gets or sets whether to adjust the Prim's orientation based on globe curvature as the game object moves.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:anchor:adjustOrientationForGlobeWhenMoving = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetAdjustOrientationForGlobeWhenMovingAttr() const;
/// See GetAdjustOrientationForGlobeWhenMovingAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateAdjustOrientationForGlobeWhenMovingAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DETECTTRANSFORMCHANGES
// --------------------------------------------------------------------- //
/// Gets or sets whether to automatically detect changes in the Prim's transform and update the precise globe coordinates accordingly.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:anchor:detectTransformChanges = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDetectTransformChangesAttr() const;
/// See GetDetectTransformChangesAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDetectTransformChangesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ANCHORLONGITUDE
// --------------------------------------------------------------------- //
/// The longitude in degrees, in the range [-180, 180].
///
/// | ||
/// | -- | -- |
/// | Declaration | `double cesium:anchor:longitude = 0` |
/// | C++ Type | double |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
CESIUMUSDSCHEMAS_API
UsdAttribute GetAnchorLongitudeAttr() const;
/// See GetAnchorLongitudeAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateAnchorLongitudeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ANCHORLATITUDE
// --------------------------------------------------------------------- //
/// The latitude in degrees, in the range [-90, 90].
///
/// | ||
/// | -- | -- |
/// | Declaration | `double cesium:anchor:latitude = 0` |
/// | C++ Type | double |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
CESIUMUSDSCHEMAS_API
UsdAttribute GetAnchorLatitudeAttr() const;
/// See GetAnchorLatitudeAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateAnchorLatitudeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ANCHORHEIGHT
// --------------------------------------------------------------------- //
/// The height in meters above the ellipsoid.
///
/// | ||
/// | -- | -- |
/// | Declaration | `double cesium:anchor:height = 0` |
/// | C++ Type | double |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double |
CESIUMUSDSCHEMAS_API
UsdAttribute GetAnchorHeightAttr() const;
/// See GetAnchorHeightAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateAnchorHeightAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// POSITION
// --------------------------------------------------------------------- //
/// The actual position of the globally anchored prim in the ECEF coordinate system.
///
/// | ||
/// | -- | -- |
/// | Declaration | `double3 cesium:anchor:position = (0, 0, 0)` |
/// | C++ Type | GfVec3d |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Double3 |
CESIUMUSDSCHEMAS_API
UsdAttribute GetPositionAttr() const;
/// See GetPositionAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreatePositionAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// GEOREFERENCEBINDING
// --------------------------------------------------------------------- //
/// The Georeference Origin prim used for the globe anchor calculations.
///
CESIUMUSDSCHEMAS_API
UsdRelationship GetGeoreferenceBindingRel() const;
/// See GetGeoreferenceBindingRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
CESIUMUSDSCHEMAS_API
UsdRelationship CreateGeoreferenceBindingRel() const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| 12,204 | C | 39.148026 | 138 | 0.592101 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/rasterOverlay.cpp | #include ".//rasterOverlay.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumRasterOverlay,
TfType::Bases< UsdTyped > >();
}
/* virtual */
CesiumRasterOverlay::~CesiumRasterOverlay()
{
}
/* static */
CesiumRasterOverlay
CesiumRasterOverlay::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumRasterOverlay();
}
return CesiumRasterOverlay(stage->GetPrimAtPath(path));
}
/* virtual */
UsdSchemaKind CesiumRasterOverlay::_GetSchemaKind() const
{
return CesiumRasterOverlay::schemaKind;
}
/* static */
const TfType &
CesiumRasterOverlay::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumRasterOverlay>();
return tfType;
}
/* static */
bool
CesiumRasterOverlay::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumRasterOverlay::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumRasterOverlay::GetShowCreditsOnScreenAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumShowCreditsOnScreen);
}
UsdAttribute
CesiumRasterOverlay::CreateShowCreditsOnScreenAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumShowCreditsOnScreen,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityUniform,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumRasterOverlay::GetAlphaAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumAlpha);
}
UsdAttribute
CesiumRasterOverlay::CreateAlphaAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumAlpha,
SdfValueTypeNames->Float,
/* custom = */ false,
SdfVariabilityUniform,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumRasterOverlay::GetOverlayRenderMethodAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumOverlayRenderMethod);
}
UsdAttribute
CesiumRasterOverlay::CreateOverlayRenderMethodAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumOverlayRenderMethod,
SdfValueTypeNames->Token,
/* custom = */ false,
SdfVariabilityUniform,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumRasterOverlay::GetMaximumScreenSpaceErrorAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMaximumScreenSpaceError);
}
UsdAttribute
CesiumRasterOverlay::CreateMaximumScreenSpaceErrorAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMaximumScreenSpaceError,
SdfValueTypeNames->Float,
/* custom = */ false,
SdfVariabilityUniform,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumRasterOverlay::GetMaximumTextureSizeAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMaximumTextureSize);
}
UsdAttribute
CesiumRasterOverlay::CreateMaximumTextureSizeAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMaximumTextureSize,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityUniform,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumRasterOverlay::GetMaximumSimultaneousTileLoadsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMaximumSimultaneousTileLoads);
}
UsdAttribute
CesiumRasterOverlay::CreateMaximumSimultaneousTileLoadsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMaximumSimultaneousTileLoads,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityUniform,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumRasterOverlay::GetSubTileCacheBytesAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumSubTileCacheBytes);
}
UsdAttribute
CesiumRasterOverlay::CreateSubTileCacheBytesAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumSubTileCacheBytes,
SdfValueTypeNames->Int,
/* custom = */ false,
SdfVariabilityUniform,
defaultValue,
writeSparsely);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumRasterOverlay::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumShowCreditsOnScreen,
CesiumTokens->cesiumAlpha,
CesiumTokens->cesiumOverlayRenderMethod,
CesiumTokens->cesiumMaximumScreenSpaceError,
CesiumTokens->cesiumMaximumTextureSize,
CesiumTokens->cesiumMaximumSimultaneousTileLoads,
CesiumTokens->cesiumSubTileCacheBytes,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
UsdTyped::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 6,680 | C++ | 28.174672 | 114 | 0.661527 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.cpp | #include ".//data.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumData,
TfType::Bases< UsdTyped > >();
// Register the usd prim typename as an alias under UsdSchemaBase. This
// enables one to call
// TfType::Find<UsdSchemaBase>().FindDerivedByName("CesiumDataPrim")
// to find TfType<CesiumData>, which is how IsA queries are
// answered.
TfType::AddAlias<UsdSchemaBase, CesiumData>("CesiumDataPrim");
}
/* virtual */
CesiumData::~CesiumData()
{
}
/* static */
CesiumData
CesiumData::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumData();
}
return CesiumData(stage->GetPrimAtPath(path));
}
/* static */
CesiumData
CesiumData::Define(
const UsdStagePtr &stage, const SdfPath &path)
{
static TfToken usdPrimTypeName("CesiumDataPrim");
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumData();
}
return CesiumData(
stage->DefinePrim(path, usdPrimTypeName));
}
/* virtual */
UsdSchemaKind CesiumData::_GetSchemaKind() const
{
return CesiumData::schemaKind;
}
/* static */
const TfType &
CesiumData::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumData>();
return tfType;
}
/* static */
bool
CesiumData::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumData::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumData::GetDebugDisableMaterialsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDebugDisableMaterials);
}
UsdAttribute
CesiumData::CreateDebugDisableMaterialsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDebugDisableMaterials,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumData::GetDebugDisableTexturesAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDebugDisableTextures);
}
UsdAttribute
CesiumData::CreateDebugDisableTexturesAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDebugDisableTextures,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumData::GetDebugDisableGeometryPoolAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDebugDisableGeometryPool);
}
UsdAttribute
CesiumData::CreateDebugDisableGeometryPoolAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDebugDisableGeometryPool,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumData::GetDebugDisableMaterialPoolAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDebugDisableMaterialPool);
}
UsdAttribute
CesiumData::CreateDebugDisableMaterialPoolAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDebugDisableMaterialPool,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumData::GetDebugDisableTexturePoolAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDebugDisableTexturePool);
}
UsdAttribute
CesiumData::CreateDebugDisableTexturePoolAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDebugDisableTexturePool,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumData::GetDebugGeometryPoolInitialCapacityAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDebugGeometryPoolInitialCapacity);
}
UsdAttribute
CesiumData::CreateDebugGeometryPoolInitialCapacityAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDebugGeometryPoolInitialCapacity,
SdfValueTypeNames->UInt64,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumData::GetDebugMaterialPoolInitialCapacityAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDebugMaterialPoolInitialCapacity);
}
UsdAttribute
CesiumData::CreateDebugMaterialPoolInitialCapacityAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDebugMaterialPoolInitialCapacity,
SdfValueTypeNames->UInt64,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumData::GetDebugTexturePoolInitialCapacityAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDebugTexturePoolInitialCapacity);
}
UsdAttribute
CesiumData::CreateDebugTexturePoolInitialCapacityAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDebugTexturePoolInitialCapacity,
SdfValueTypeNames->UInt64,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumData::GetDebugRandomColorsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDebugRandomColors);
}
UsdAttribute
CesiumData::CreateDebugRandomColorsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDebugRandomColors,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumData::GetDebugDisableGeoreferencingAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumDebugDisableGeoreferencing);
}
UsdAttribute
CesiumData::CreateDebugDisableGeoreferencingAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumDebugDisableGeoreferencing,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdRelationship
CesiumData::GetSelectedIonServerRel() const
{
return GetPrim().GetRelationship(CesiumTokens->cesiumSelectedIonServer);
}
UsdRelationship
CesiumData::CreateSelectedIonServerRel() const
{
return GetPrim().CreateRelationship(CesiumTokens->cesiumSelectedIonServer,
/* custom = */ false);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumData::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumDebugDisableMaterials,
CesiumTokens->cesiumDebugDisableTextures,
CesiumTokens->cesiumDebugDisableGeometryPool,
CesiumTokens->cesiumDebugDisableMaterialPool,
CesiumTokens->cesiumDebugDisableTexturePool,
CesiumTokens->cesiumDebugGeometryPoolInitialCapacity,
CesiumTokens->cesiumDebugMaterialPoolInitialCapacity,
CesiumTokens->cesiumDebugTexturePoolInitialCapacity,
CesiumTokens->cesiumDebugRandomColors,
CesiumTokens->cesiumDebugDisableGeoreferencing,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
UsdTyped::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 9,523 | C++ | 29.234921 | 109 | 0.667017 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/data.h | #ifndef CESIUMUSDSCHEMAS_GENERATED_DATA_H
#define CESIUMUSDSCHEMAS_GENERATED_DATA_H
/// \file CesiumUsdSchemas/data.h
#include "pxr/pxr.h"
#include ".//api.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include ".//tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// CESIUMDATAPRIM //
// -------------------------------------------------------------------------- //
/// \class CesiumData
///
/// Stores stage level data for Cesium for Omniverse/USD.
///
class CesiumData : public UsdTyped
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a CesiumData on UsdPrim \p prim .
/// Equivalent to CesiumData::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit CesiumData(const UsdPrim& prim=UsdPrim())
: UsdTyped(prim)
{
}
/// Construct a CesiumData on the prim held by \p schemaObj .
/// Should be preferred over CesiumData(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit CesiumData(const UsdSchemaBase& schemaObj)
: UsdTyped(schemaObj)
{
}
/// Destructor.
CESIUMUSDSCHEMAS_API
virtual ~CesiumData();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
CESIUMUSDSCHEMAS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a CesiumData holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// CesiumData(stage->GetPrimAtPath(path));
/// \endcode
///
CESIUMUSDSCHEMAS_API
static CesiumData
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
CESIUMUSDSCHEMAS_API
static CesiumData
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
CESIUMUSDSCHEMAS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
CESIUMUSDSCHEMAS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
CESIUMUSDSCHEMAS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// DEBUGDISABLEMATERIALS
// --------------------------------------------------------------------- //
/// Debug option that renders tilesets with materials disabled.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:debug:disableMaterials = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDebugDisableMaterialsAttr() const;
/// See GetDebugDisableMaterialsAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDebugDisableMaterialsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DEBUGDISABLETEXTURES
// --------------------------------------------------------------------- //
/// Debug option that renders tilesets with textures disabled.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:debug:disableTextures = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDebugDisableTexturesAttr() const;
/// See GetDebugDisableTexturesAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDebugDisableTexturesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DEBUGDISABLEGEOMETRYPOOL
// --------------------------------------------------------------------- //
/// Debug option that disables geometry pooling.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:debug:disableGeometryPool = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDebugDisableGeometryPoolAttr() const;
/// See GetDebugDisableGeometryPoolAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDebugDisableGeometryPoolAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DEBUGDISABLEMATERIALPOOL
// --------------------------------------------------------------------- //
/// Debug option that disables material pooling.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:debug:disableMaterialPool = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDebugDisableMaterialPoolAttr() const;
/// See GetDebugDisableMaterialPoolAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDebugDisableMaterialPoolAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DEBUGDISABLETEXTUREPOOL
// --------------------------------------------------------------------- //
/// Debug option that disables texture pooling.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:debug:disableTexturePool = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDebugDisableTexturePoolAttr() const;
/// See GetDebugDisableTexturePoolAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDebugDisableTexturePoolAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DEBUGGEOMETRYPOOLINITIALCAPACITY
// --------------------------------------------------------------------- //
/// Debug option that controls the initial capacity of the geometry pool.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uint64 cesium:debug:geometryPoolInitialCapacity = 2048` |
/// | C++ Type | uint64_t |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->UInt64 |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDebugGeometryPoolInitialCapacityAttr() const;
/// See GetDebugGeometryPoolInitialCapacityAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDebugGeometryPoolInitialCapacityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DEBUGMATERIALPOOLINITIALCAPACITY
// --------------------------------------------------------------------- //
/// Debug option that controls the initial capacity of the material pool.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uint64 cesium:debug:materialPoolInitialCapacity = 2048` |
/// | C++ Type | uint64_t |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->UInt64 |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDebugMaterialPoolInitialCapacityAttr() const;
/// See GetDebugMaterialPoolInitialCapacityAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDebugMaterialPoolInitialCapacityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DEBUGTEXTUREPOOLINITIALCAPACITY
// --------------------------------------------------------------------- //
/// Debug option that controls the initial capacity of the texture pool.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uint64 cesium:debug:texturePoolInitialCapacity = 2048` |
/// | C++ Type | uint64_t |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->UInt64 |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDebugTexturePoolInitialCapacityAttr() const;
/// See GetDebugTexturePoolInitialCapacityAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDebugTexturePoolInitialCapacityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DEBUGRANDOMCOLORS
// --------------------------------------------------------------------- //
/// Debug option that renders tiles with random colors.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:debug:randomColors = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDebugRandomColorsAttr() const;
/// See GetDebugRandomColorsAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDebugRandomColorsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// DEBUGDISABLEGEOREFERENCING
// --------------------------------------------------------------------- //
/// Debug option to disable georeferencing. Tiles will be rendered in EPSG:4978 (ECEF) coordinates where (0, 0, 0) is the center of the globe, the X axis points towards the prime meridian, the Y axis points towards the 90th meridian east, and the Z axis points towards the North Pole.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:debug:disableGeoreferencing = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDebugDisableGeoreferencingAttr() const;
/// See GetDebugDisableGeoreferencingAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDebugDisableGeoreferencingAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SELECTEDIONSERVER
// --------------------------------------------------------------------- //
/// The current ion Server prim used in the Cesium for Omniverse UI.
///
CESIUMUSDSCHEMAS_API
UsdRelationship GetSelectedIonServerRel() const;
/// See GetSelectedIonServerRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
CESIUMUSDSCHEMAS_API
UsdRelationship CreateSelectedIonServerRel() const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| 16,223 | C | 41.920635 | 288 | 0.589657 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/tileset.h | #ifndef CESIUMUSDSCHEMAS_GENERATED_TILESET_H
#define CESIUMUSDSCHEMAS_GENERATED_TILESET_H
/// \file CesiumUsdSchemas/tileset.h
#include "pxr/pxr.h"
#include ".//api.h"
#include "pxr/usd/usdGeom/gprim.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include ".//tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// CESIUMTILESETPRIM //
// -------------------------------------------------------------------------- //
/// \class CesiumTileset
///
/// A prim representing a tileset.
///
/// For any described attribute \em Fallback \em Value or \em Allowed \em Values below
/// that are text/tokens, the actual token is published and defined in \ref CesiumTokens.
/// So to set an attribute to the value "rightHanded", use CesiumTokens->rightHanded
/// as the value.
///
class CesiumTileset : public UsdGeomGprim
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a CesiumTileset on UsdPrim \p prim .
/// Equivalent to CesiumTileset::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit CesiumTileset(const UsdPrim& prim=UsdPrim())
: UsdGeomGprim(prim)
{
}
/// Construct a CesiumTileset on the prim held by \p schemaObj .
/// Should be preferred over CesiumTileset(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit CesiumTileset(const UsdSchemaBase& schemaObj)
: UsdGeomGprim(schemaObj)
{
}
/// Destructor.
CESIUMUSDSCHEMAS_API
virtual ~CesiumTileset();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
CESIUMUSDSCHEMAS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a CesiumTileset holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// CesiumTileset(stage->GetPrimAtPath(path));
/// \endcode
///
CESIUMUSDSCHEMAS_API
static CesiumTileset
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
CESIUMUSDSCHEMAS_API
static CesiumTileset
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
CESIUMUSDSCHEMAS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
CESIUMUSDSCHEMAS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
CESIUMUSDSCHEMAS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// SOURCETYPE
// --------------------------------------------------------------------- //
/// Selects whether to use the Cesium ion Asset ID or the provided URL for this tileset.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uniform token cesium:sourceType = "ion"` |
/// | C++ Type | TfToken |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Token |
/// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
/// | \ref CesiumTokens "Allowed Values" | ion, url |
CESIUMUSDSCHEMAS_API
UsdAttribute GetSourceTypeAttr() const;
/// See GetSourceTypeAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateSourceTypeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// URL
// --------------------------------------------------------------------- //
/// The URL of this tileset's tileset.json file. Usually blank if this is an ion asset.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:url = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetUrlAttr() const;
/// See GetUrlAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateUrlAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// IONASSETID
// --------------------------------------------------------------------- //
/// The ID of the Cesium ion asset to use. Usually blank if using URL.
///
/// | ||
/// | -- | -- |
/// | Declaration | `int64 cesium:ionAssetId = 0` |
/// | C++ Type | int64_t |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int64 |
CESIUMUSDSCHEMAS_API
UsdAttribute GetIonAssetIdAttr() const;
/// See GetIonAssetIdAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateIonAssetIdAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// IONACCESSTOKEN
// --------------------------------------------------------------------- //
/// The access token to use to access the Cesium ion resource. Overrides the default token. Usually blank if using URL.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:ionAccessToken = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetIonAccessTokenAttr() const;
/// See GetIonAccessTokenAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateIonAccessTokenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MAXIMUMSCREENSPACEERROR
// --------------------------------------------------------------------- //
/// The maximum number of pixels of error when rendering this tileset. This is used to select an appropriate level-of-detail: A low value will cause many tiles with a high level of detail to be loaded, causing a finer visual representation of the tiles, but with a higher performance cost for loading and rendering. A higher value will cause a coarser visual representation, with lower performance requirements. When a tileset uses the older layer.json / quantized-mesh format rather than 3D Tiles, this value is effectively divided by 8.0. So the default value of 16.0 corresponds to the standard value for quantized-mesh terrain of 2.0.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float cesium:maximumScreenSpaceError = 16` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
CESIUMUSDSCHEMAS_API
UsdAttribute GetMaximumScreenSpaceErrorAttr() const;
/// See GetMaximumScreenSpaceErrorAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateMaximumScreenSpaceErrorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// PRELOADANCESTORS
// --------------------------------------------------------------------- //
/// Whether to preload ancestor tiles. Setting this to true optimizes the zoom-out experience and provides more detail in newly-exposed areas when panning. The down side is that it requires loading more tiles.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:preloadAncestors = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetPreloadAncestorsAttr() const;
/// See GetPreloadAncestorsAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreatePreloadAncestorsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// PRELOADSIBLINGS
// --------------------------------------------------------------------- //
/// Whether to preload sibling tiles. Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even if they are culled. Setting this to true may provide a better panning experience at the cost of loading more tiles.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:preloadSiblings = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetPreloadSiblingsAttr() const;
/// See GetPreloadSiblingsAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreatePreloadSiblingsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// FORBIDHOLES
// --------------------------------------------------------------------- //
/// Whether to prevent refinement of a parent tile when a child isn't done loading. When this is set to true, the tileset will guarantee that the tileset will never be rendered with holes in place of tiles that are not yet loaded, even though the tile that is rendered instead may have low resolution. When false, overall loading will be faster, but newly-visible parts of the tileset may initially be blank.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:forbidHoles = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetForbidHolesAttr() const;
/// See GetForbidHolesAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateForbidHolesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MAXIMUMSIMULTANEOUSTILELOADS
// --------------------------------------------------------------------- //
/// The maximum number of tiles that may be loaded at once. When new parts of the tileset become visible, the tasks to load the corresponding tiles are put into a queue. This value determines how many of these tasks are processed at the same time. A higher value may cause the tiles to be loaded and rendered more quickly, at the cost of a higher network and processing load.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uint cesium:maximumSimultaneousTileLoads = 20` |
/// | C++ Type | unsigned int |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->UInt |
CESIUMUSDSCHEMAS_API
UsdAttribute GetMaximumSimultaneousTileLoadsAttr() const;
/// See GetMaximumSimultaneousTileLoadsAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateMaximumSimultaneousTileLoadsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MAXIMUMCACHEDBYTES
// --------------------------------------------------------------------- //
/// The maximum number of bytes that may be cached. Note that this value, even if 0, will never cause tiles that are needed for rendering to be unloaded. However, if the total number of loaded bytes is greater than this value, tiles will be unloaded until the total is under this number or until only required tiles remain, whichever comes first.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uint64 cesium:maximumCachedBytes = 536870912` |
/// | C++ Type | uint64_t |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->UInt64 |
CESIUMUSDSCHEMAS_API
UsdAttribute GetMaximumCachedBytesAttr() const;
/// See GetMaximumCachedBytesAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateMaximumCachedBytesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// LOADINGDESCENDANTLIMIT
// --------------------------------------------------------------------- //
/// The number of loading descendants a tile should allow before deciding to render itself instead of waiting. Setting this to 0 will cause each level of detail to be loaded successively. This will increase the overall loading time, but cause additional detail to appear more gradually. Setting this to a high value like 1000 will decrease the overall time until the desired level of detail is achieved, but this high-detail representation will appear at once, as soon as it is loaded completely.
///
/// | ||
/// | -- | -- |
/// | Declaration | `uint cesium:loadingDescendantLimit = 20` |
/// | C++ Type | unsigned int |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->UInt |
CESIUMUSDSCHEMAS_API
UsdAttribute GetLoadingDescendantLimitAttr() const;
/// See GetLoadingDescendantLimitAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateLoadingDescendantLimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ENABLEFRUSTUMCULLING
// --------------------------------------------------------------------- //
/// Whether to cull tiles that are outside the frustum. By default this is true, meaning that tiles that are not visible with the current camera configuration will be ignored. It can be set to false, so that these tiles are still considered for loading, refinement and rendering. This will cause more tiles to be loaded, but helps to avoid holes and provides a more consistent mesh, which may be helpful for physics and shadows. Note that this will always be disabled if Use Lod Transitions is set to true.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:enableFrustumCulling = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetEnableFrustumCullingAttr() const;
/// See GetEnableFrustumCullingAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateEnableFrustumCullingAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ENABLEFOGCULLING
// --------------------------------------------------------------------- //
/// Whether to cull tiles that are occluded by fog. This does not refer to the atmospheric fog rendered by Unity, but to an internal representation of fog: Depending on the height of the camera above the ground, tiles that are far away (close to the horizon) will be culled when this flag is enabled. Note that this will always be disabled if Use Lod Transitions is set to true.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:enableFogCulling = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetEnableFogCullingAttr() const;
/// See GetEnableFogCullingAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateEnableFogCullingAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// ENFORCECULLEDSCREENSPACEERROR
// --------------------------------------------------------------------- //
/// Whether a specified screen-space error should be enforced for tiles that are outside the frustum or hidden in fog. When Enable Frustum Culling and Enable Fog Culling are both true, tiles outside the view frustum or hidden in fog are effectively ignored, and so their level-of-detail doesn't matter. And in this scenario, this property is ignored. However, when either of those flags are false, these would-be-culled tiles continue to be processed, and the question arises of how to handle their level-of-detail. When this property is false, refinement terminates at these tiles, no matter what their current screen-space error. The tiles are available for physics, shadows, etc., but their level-of-detail may be very low. When set to true, these tiles are refined until they achieve the specified Culled Screen Space Error. This allows control over the minimum quality of these would-be-culled tiles.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:enforceCulledScreenSpaceError = 1` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetEnforceCulledScreenSpaceErrorAttr() const;
/// See GetEnforceCulledScreenSpaceErrorAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateEnforceCulledScreenSpaceErrorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// CULLEDSCREENSPACEERROR
// --------------------------------------------------------------------- //
/// The screen-space error to be enforced for tiles that are outside the frustum or hidden in fog. When Enable Frustum Culling and Enable Fog Culling are both true, tiles outside the view frustum or hidden in fog are effectively ignored, and so their level-of-detail doesn't matter. And in this scenario, this property is ignored. However, when either of those flags are false, these would-be-culled tiles continue to be processed, and the question arises of how to handle their level-of-detail. When this property is false, refinement terminates at these tiles, no matter what their current screen-space error. The tiles are available for physics, shadows, etc., but their level-of-detail may be very low. When set to true, these tiles are refined until they achieve the specified Culled Screen Space Error. This allows control over the minimum quality of these would-be-culled tiles.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float cesium:culledScreenSpaceError = 64` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
CESIUMUSDSCHEMAS_API
UsdAttribute GetCulledScreenSpaceErrorAttr() const;
/// See GetCulledScreenSpaceErrorAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateCulledScreenSpaceErrorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SUSPENDUPDATE
// --------------------------------------------------------------------- //
/// Pauses level-of-detail and culling updates of this tileset.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:suspendUpdate = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetSuspendUpdateAttr() const;
/// See GetSuspendUpdateAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateSuspendUpdateAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SMOOTHNORMALS
// --------------------------------------------------------------------- //
/// Generate smooth normals instead of flat normals when normals are missing.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:smoothNormals = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetSmoothNormalsAttr() const;
/// See GetSmoothNormalsAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateSmoothNormalsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// SHOWCREDITSONSCREEN
// --------------------------------------------------------------------- //
/// Whether or not to show this tileset's credits on screen.
///
/// | ||
/// | -- | -- |
/// | Declaration | `bool cesium:showCreditsOnScreen = 0` |
/// | C++ Type | bool |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
CESIUMUSDSCHEMAS_API
UsdAttribute GetShowCreditsOnScreenAttr() const;
/// See GetShowCreditsOnScreenAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateShowCreditsOnScreenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// MAINTHREADLOADINGTIMELIMIT
// --------------------------------------------------------------------- //
/// A soft limit on how long (in milliseconds) to spend on the main-thread part of tile loading each frame. A value of 0.0 indicates that all pending main-thread loads should be completed each tick.
///
/// | ||
/// | -- | -- |
/// | Declaration | `float cesium:mainThreadLoadingTimeLimit = 0` |
/// | C++ Type | float |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
CESIUMUSDSCHEMAS_API
UsdAttribute GetMainThreadLoadingTimeLimitAttr() const;
/// See GetMainThreadLoadingTimeLimitAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateMainThreadLoadingTimeLimitAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// GEOREFERENCEBINDING
// --------------------------------------------------------------------- //
/// Specifies which Cesium Georeference object to use for this tileset.
///
CESIUMUSDSCHEMAS_API
UsdRelationship GetGeoreferenceBindingRel() const;
/// See GetGeoreferenceBindingRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
CESIUMUSDSCHEMAS_API
UsdRelationship CreateGeoreferenceBindingRel() const;
public:
// --------------------------------------------------------------------- //
// IONSERVERBINDING
// --------------------------------------------------------------------- //
/// Specifies which Cesium ion Server prim to use for this tileset.
///
CESIUMUSDSCHEMAS_API
UsdRelationship GetIonServerBindingRel() const;
/// See GetIonServerBindingRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
CESIUMUSDSCHEMAS_API
UsdRelationship CreateIonServerBindingRel() const;
public:
// --------------------------------------------------------------------- //
// RASTEROVERLAYBINDING
// --------------------------------------------------------------------- //
/// Specifies which raster overlays to use for this tileset.
///
CESIUMUSDSCHEMAS_API
UsdRelationship GetRasterOverlayBindingRel() const;
/// See GetRasterOverlayBindingRel(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create
CESIUMUSDSCHEMAS_API
UsdRelationship CreateRasterOverlayBindingRel() const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| 31,339 | C | 50.292962 | 909 | 0.606848 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/tokens.h | #ifndef CESIUM_TOKENS_H
#define CESIUM_TOKENS_H
/// \file CesiumUsdSchemas/tokens.h
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//
// This is an automatically generated file (by usdGenSchema.py).
// Do not hand-edit!
//
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include "pxr/pxr.h"
#include ".//api.h"
#include "pxr/base/tf/staticData.h"
#include "pxr/base/tf/token.h"
#include <vector>
PXR_NAMESPACE_OPEN_SCOPE
/// \class CesiumTokensType
///
/// \link CesiumTokens \endlink provides static, efficient
/// \link TfToken TfTokens\endlink for use in all public USD API.
///
/// These tokens are auto-generated from the module's schema, representing
/// property names, for when you need to fetch an attribute or relationship
/// directly by name, e.g. UsdPrim::GetAttribute(), in the most efficient
/// manner, and allow the compiler to verify that you spelled the name
/// correctly.
///
/// CesiumTokens also contains all of the \em allowedTokens values
/// declared for schema builtin attributes of 'token' scene description type.
/// Use CesiumTokens like so:
///
/// \code
/// gprim.GetMyTokenValuedAttr().Set(CesiumTokens->cesiumAlpha);
/// \endcode
struct CesiumTokensType {
CESIUMUSDSCHEMAS_API CesiumTokensType();
/// \brief "cesium:alpha"
///
/// CesiumRasterOverlay
const TfToken cesiumAlpha;
/// \brief "cesium:anchor:adjustOrientationForGlobeWhenMoving"
///
/// CesiumGlobeAnchorAPI
const TfToken cesiumAnchorAdjustOrientationForGlobeWhenMoving;
/// \brief "cesium:anchor:detectTransformChanges"
///
/// CesiumGlobeAnchorAPI
const TfToken cesiumAnchorDetectTransformChanges;
/// \brief "cesium:anchor:georeferenceBinding"
///
/// CesiumGlobeAnchorAPI
const TfToken cesiumAnchorGeoreferenceBinding;
/// \brief "cesium:anchor:height"
///
/// CesiumGlobeAnchorAPI
const TfToken cesiumAnchorHeight;
/// \brief "cesium:anchor:latitude"
///
/// CesiumGlobeAnchorAPI
const TfToken cesiumAnchorLatitude;
/// \brief "cesium:anchor:longitude"
///
/// CesiumGlobeAnchorAPI
const TfToken cesiumAnchorLongitude;
/// \brief "cesium:anchor:position"
///
/// CesiumGlobeAnchorAPI
const TfToken cesiumAnchorPosition;
/// \brief "cesium:baseUrl"
///
/// CesiumWebMapServiceRasterOverlay
const TfToken cesiumBaseUrl;
/// \brief "cesium:cartographicPolygonBinding"
///
/// CesiumPolygonRasterOverlay
const TfToken cesiumCartographicPolygonBinding;
/// \brief "cesium:culledScreenSpaceError"
///
/// CesiumTileset
const TfToken cesiumCulledScreenSpaceError;
/// \brief "cesium:debug:disableGeometryPool"
///
/// CesiumData
const TfToken cesiumDebugDisableGeometryPool;
/// \brief "cesium:debug:disableGeoreferencing"
///
/// CesiumData
const TfToken cesiumDebugDisableGeoreferencing;
/// \brief "cesium:debug:disableMaterialPool"
///
/// CesiumData
const TfToken cesiumDebugDisableMaterialPool;
/// \brief "cesium:debug:disableMaterials"
///
/// CesiumData
const TfToken cesiumDebugDisableMaterials;
/// \brief "cesium:debug:disableTexturePool"
///
/// CesiumData
const TfToken cesiumDebugDisableTexturePool;
/// \brief "cesium:debug:disableTextures"
///
/// CesiumData
const TfToken cesiumDebugDisableTextures;
/// \brief "cesium:debug:geometryPoolInitialCapacity"
///
/// CesiumData
const TfToken cesiumDebugGeometryPoolInitialCapacity;
/// \brief "cesium:debug:materialPoolInitialCapacity"
///
/// CesiumData
const TfToken cesiumDebugMaterialPoolInitialCapacity;
/// \brief "cesium:debug:randomColors"
///
/// CesiumData
const TfToken cesiumDebugRandomColors;
/// \brief "cesium:debug:texturePoolInitialCapacity"
///
/// CesiumData
const TfToken cesiumDebugTexturePoolInitialCapacity;
/// \brief "cesium:displayName"
///
/// CesiumIonServer
const TfToken cesiumDisplayName;
/// \brief "cesium:east"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumEast;
/// \brief "cesium:ecefToUsdTransform"
///
/// CesiumSession
const TfToken cesiumEcefToUsdTransform;
/// \brief "cesium:enableFogCulling"
///
/// CesiumTileset
const TfToken cesiumEnableFogCulling;
/// \brief "cesium:enableFrustumCulling"
///
/// CesiumTileset
const TfToken cesiumEnableFrustumCulling;
/// \brief "cesium:enforceCulledScreenSpaceError"
///
/// CesiumTileset
const TfToken cesiumEnforceCulledScreenSpaceError;
/// \brief "cesium:excludeSelectedTiles"
///
/// CesiumPolygonRasterOverlay
const TfToken cesiumExcludeSelectedTiles;
/// \brief "cesium:forbidHoles"
///
/// CesiumTileset
const TfToken cesiumForbidHoles;
/// \brief "cesium:format"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumFormat;
/// \brief "cesium:georeferenceBinding"
///
/// CesiumTileset
const TfToken cesiumGeoreferenceBinding;
/// \brief "cesium:georeferenceOrigin:height"
///
/// CesiumGeoreference
const TfToken cesiumGeoreferenceOriginHeight;
/// \brief "cesium:georeferenceOrigin:latitude"
///
/// CesiumGeoreference
const TfToken cesiumGeoreferenceOriginLatitude;
/// \brief "cesium:georeferenceOrigin:longitude"
///
/// CesiumGeoreference
const TfToken cesiumGeoreferenceOriginLongitude;
/// \brief "cesium:invertSelection"
///
/// CesiumPolygonRasterOverlay
const TfToken cesiumInvertSelection;
/// \brief "cesium:ionAccessToken"
///
/// CesiumIonRasterOverlay, CesiumTileset
const TfToken cesiumIonAccessToken;
/// \brief "cesium:ionAssetId"
///
/// CesiumIonRasterOverlay, CesiumTileset
const TfToken cesiumIonAssetId;
/// \brief "cesium:ionServerApiUrl"
///
/// CesiumIonServer
const TfToken cesiumIonServerApiUrl;
/// \brief "cesium:ionServerApplicationId"
///
/// CesiumIonServer
const TfToken cesiumIonServerApplicationId;
/// \brief "cesium:ionServerBinding"
///
/// CesiumIonRasterOverlay, CesiumTileset
const TfToken cesiumIonServerBinding;
/// \brief "cesium:ionServerUrl"
///
/// CesiumIonServer
const TfToken cesiumIonServerUrl;
/// \brief "cesium:layer"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumLayer;
/// \brief "cesium:layers"
///
/// CesiumWebMapServiceRasterOverlay
const TfToken cesiumLayers;
/// \brief "cesium:loadingDescendantLimit"
///
/// CesiumTileset
const TfToken cesiumLoadingDescendantLimit;
/// \brief "cesium:mainThreadLoadingTimeLimit"
///
/// CesiumTileset
const TfToken cesiumMainThreadLoadingTimeLimit;
/// \brief "cesium:maximumCachedBytes"
///
/// CesiumTileset
const TfToken cesiumMaximumCachedBytes;
/// \brief "cesium:maximumLevel"
///
/// CesiumWebMapServiceRasterOverlay
const TfToken cesiumMaximumLevel;
/// \brief "cesium:maximumScreenSpaceError"
///
/// CesiumRasterOverlay, CesiumTileset
const TfToken cesiumMaximumScreenSpaceError;
/// \brief "cesium:maximumSimultaneousTileLoads"
///
/// CesiumRasterOverlay, CesiumTileset
const TfToken cesiumMaximumSimultaneousTileLoads;
/// \brief "cesium:maximumTextureSize"
///
/// CesiumRasterOverlay
const TfToken cesiumMaximumTextureSize;
/// \brief "cesium:maximumZoomLevel"
///
/// CesiumWebMapTileServiceRasterOverlay, CesiumTileMapServiceRasterOverlay
const TfToken cesiumMaximumZoomLevel;
/// \brief "cesium:minimumLevel"
///
/// CesiumWebMapServiceRasterOverlay
const TfToken cesiumMinimumLevel;
/// \brief "cesium:minimumZoomLevel"
///
/// CesiumWebMapTileServiceRasterOverlay, CesiumTileMapServiceRasterOverlay
const TfToken cesiumMinimumZoomLevel;
/// \brief "cesium:north"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumNorth;
/// \brief "cesium:overlayRenderMethod"
///
/// CesiumPolygonRasterOverlay, CesiumRasterOverlay
const TfToken cesiumOverlayRenderMethod;
/// \brief "cesium:preloadAncestors"
///
/// CesiumTileset
const TfToken cesiumPreloadAncestors;
/// \brief "cesium:preloadSiblings"
///
/// CesiumTileset
const TfToken cesiumPreloadSiblings;
/// \brief "cesium:projectDefaultIonAccessToken"
///
/// CesiumIonServer
const TfToken cesiumProjectDefaultIonAccessToken;
/// \brief "cesium:projectDefaultIonAccessTokenId"
///
/// CesiumIonServer
const TfToken cesiumProjectDefaultIonAccessTokenId;
/// \brief "cesium:rasterOverlayBinding"
///
/// CesiumTileset
const TfToken cesiumRasterOverlayBinding;
/// \brief "cesium:rootTilesX"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumRootTilesX;
/// \brief "cesium:rootTilesY"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumRootTilesY;
/// \brief "cesium:selectedIonServer"
///
/// CesiumData
const TfToken cesiumSelectedIonServer;
/// \brief "cesium:showCreditsOnScreen"
///
/// CesiumRasterOverlay, CesiumTileset
const TfToken cesiumShowCreditsOnScreen;
/// \brief "cesium:smoothNormals"
///
/// CesiumTileset
const TfToken cesiumSmoothNormals;
/// \brief "cesium:sourceType"
///
/// CesiumTileset
const TfToken cesiumSourceType;
/// \brief "cesium:south"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumSouth;
/// \brief "cesium:specifyTileMatrixSetLabels"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumSpecifyTileMatrixSetLabels;
/// \brief "cesium:specifyTilingScheme"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumSpecifyTilingScheme;
/// \brief "cesium:specifyZoomLevels"
///
/// CesiumWebMapTileServiceRasterOverlay, CesiumTileMapServiceRasterOverlay
const TfToken cesiumSpecifyZoomLevels;
/// \brief "cesium:style"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumStyle;
/// \brief "cesium:subTileCacheBytes"
///
/// CesiumRasterOverlay
const TfToken cesiumSubTileCacheBytes;
/// \brief "cesium:suspendUpdate"
///
/// CesiumTileset
const TfToken cesiumSuspendUpdate;
/// \brief "cesium:tileHeight"
///
/// CesiumWebMapServiceRasterOverlay
const TfToken cesiumTileHeight;
/// \brief "cesium:tileMatrixSetId"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumTileMatrixSetId;
/// \brief "cesium:tileMatrixSetLabelPrefix"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumTileMatrixSetLabelPrefix;
/// \brief "cesium:tileMatrixSetLabels"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumTileMatrixSetLabels;
/// \brief "cesium:tileWidth"
///
/// CesiumWebMapServiceRasterOverlay
const TfToken cesiumTileWidth;
/// \brief "cesium:url"
///
/// CesiumWebMapTileServiceRasterOverlay, CesiumTileMapServiceRasterOverlay, CesiumTileset
const TfToken cesiumUrl;
/// \brief "cesium:useWebMercatorProjection"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumUseWebMercatorProjection;
/// \brief "cesium:west"
///
/// CesiumWebMapTileServiceRasterOverlay
const TfToken cesiumWest;
/// \brief "clip"
///
/// Default value for CesiumPolygonRasterOverlay::GetCesiumOverlayRenderMethodAttr(), Possible value for CesiumRasterOverlay::GetOverlayRenderMethodAttr()
const TfToken clip;
/// \brief "ion"
///
/// Possible value for CesiumTileset::GetSourceTypeAttr(), Default value for CesiumTileset::GetSourceTypeAttr()
const TfToken ion;
/// \brief "overlay"
///
/// Possible value for CesiumRasterOverlay::GetOverlayRenderMethodAttr(), Default value for CesiumRasterOverlay::GetOverlayRenderMethodAttr()
const TfToken overlay;
/// \brief "url"
///
/// Possible value for CesiumTileset::GetSourceTypeAttr()
const TfToken url;
/// A vector of all of the tokens listed above.
const std::vector<TfToken> allTokens;
};
/// \var CesiumTokens
///
/// A global variable with static, efficient \link TfToken TfTokens\endlink
/// for use in all public USD API. \sa CesiumTokensType
extern CESIUMUSDSCHEMAS_API TfStaticData<CesiumTokensType> CesiumTokens;
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| 12,816 | C | 31.448101 | 158 | 0.694991 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/tileset.cpp | #include ".//tileset.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumTileset,
TfType::Bases< UsdGeomGprim > >();
// Register the usd prim typename as an alias under UsdSchemaBase. This
// enables one to call
// TfType::Find<UsdSchemaBase>().FindDerivedByName("CesiumTilesetPrim")
// to find TfType<CesiumTileset>, which is how IsA queries are
// answered.
TfType::AddAlias<UsdSchemaBase, CesiumTileset>("CesiumTilesetPrim");
}
/* virtual */
CesiumTileset::~CesiumTileset()
{
}
/* static */
CesiumTileset
CesiumTileset::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumTileset();
}
return CesiumTileset(stage->GetPrimAtPath(path));
}
/* static */
CesiumTileset
CesiumTileset::Define(
const UsdStagePtr &stage, const SdfPath &path)
{
static TfToken usdPrimTypeName("CesiumTilesetPrim");
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumTileset();
}
return CesiumTileset(
stage->DefinePrim(path, usdPrimTypeName));
}
/* virtual */
UsdSchemaKind CesiumTileset::_GetSchemaKind() const
{
return CesiumTileset::schemaKind;
}
/* static */
const TfType &
CesiumTileset::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumTileset>();
return tfType;
}
/* static */
bool
CesiumTileset::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumTileset::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumTileset::GetSourceTypeAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumSourceType);
}
UsdAttribute
CesiumTileset::CreateSourceTypeAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumSourceType,
SdfValueTypeNames->Token,
/* custom = */ false,
SdfVariabilityUniform,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetUrlAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumUrl);
}
UsdAttribute
CesiumTileset::CreateUrlAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumUrl,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetIonAssetIdAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumIonAssetId);
}
UsdAttribute
CesiumTileset::CreateIonAssetIdAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumIonAssetId,
SdfValueTypeNames->Int64,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetIonAccessTokenAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumIonAccessToken);
}
UsdAttribute
CesiumTileset::CreateIonAccessTokenAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumIonAccessToken,
SdfValueTypeNames->String,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetMaximumScreenSpaceErrorAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMaximumScreenSpaceError);
}
UsdAttribute
CesiumTileset::CreateMaximumScreenSpaceErrorAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMaximumScreenSpaceError,
SdfValueTypeNames->Float,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetPreloadAncestorsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumPreloadAncestors);
}
UsdAttribute
CesiumTileset::CreatePreloadAncestorsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumPreloadAncestors,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetPreloadSiblingsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumPreloadSiblings);
}
UsdAttribute
CesiumTileset::CreatePreloadSiblingsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumPreloadSiblings,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetForbidHolesAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumForbidHoles);
}
UsdAttribute
CesiumTileset::CreateForbidHolesAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumForbidHoles,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetMaximumSimultaneousTileLoadsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMaximumSimultaneousTileLoads);
}
UsdAttribute
CesiumTileset::CreateMaximumSimultaneousTileLoadsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMaximumSimultaneousTileLoads,
SdfValueTypeNames->UInt,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetMaximumCachedBytesAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMaximumCachedBytes);
}
UsdAttribute
CesiumTileset::CreateMaximumCachedBytesAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMaximumCachedBytes,
SdfValueTypeNames->UInt64,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetLoadingDescendantLimitAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumLoadingDescendantLimit);
}
UsdAttribute
CesiumTileset::CreateLoadingDescendantLimitAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumLoadingDescendantLimit,
SdfValueTypeNames->UInt,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetEnableFrustumCullingAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumEnableFrustumCulling);
}
UsdAttribute
CesiumTileset::CreateEnableFrustumCullingAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumEnableFrustumCulling,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetEnableFogCullingAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumEnableFogCulling);
}
UsdAttribute
CesiumTileset::CreateEnableFogCullingAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumEnableFogCulling,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetEnforceCulledScreenSpaceErrorAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumEnforceCulledScreenSpaceError);
}
UsdAttribute
CesiumTileset::CreateEnforceCulledScreenSpaceErrorAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumEnforceCulledScreenSpaceError,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetCulledScreenSpaceErrorAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumCulledScreenSpaceError);
}
UsdAttribute
CesiumTileset::CreateCulledScreenSpaceErrorAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumCulledScreenSpaceError,
SdfValueTypeNames->Float,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetSuspendUpdateAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumSuspendUpdate);
}
UsdAttribute
CesiumTileset::CreateSuspendUpdateAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumSuspendUpdate,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetSmoothNormalsAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumSmoothNormals);
}
UsdAttribute
CesiumTileset::CreateSmoothNormalsAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumSmoothNormals,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetShowCreditsOnScreenAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumShowCreditsOnScreen);
}
UsdAttribute
CesiumTileset::CreateShowCreditsOnScreenAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumShowCreditsOnScreen,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumTileset::GetMainThreadLoadingTimeLimitAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumMainThreadLoadingTimeLimit);
}
UsdAttribute
CesiumTileset::CreateMainThreadLoadingTimeLimitAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumMainThreadLoadingTimeLimit,
SdfValueTypeNames->Float,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdRelationship
CesiumTileset::GetGeoreferenceBindingRel() const
{
return GetPrim().GetRelationship(CesiumTokens->cesiumGeoreferenceBinding);
}
UsdRelationship
CesiumTileset::CreateGeoreferenceBindingRel() const
{
return GetPrim().CreateRelationship(CesiumTokens->cesiumGeoreferenceBinding,
/* custom = */ false);
}
UsdRelationship
CesiumTileset::GetIonServerBindingRel() const
{
return GetPrim().GetRelationship(CesiumTokens->cesiumIonServerBinding);
}
UsdRelationship
CesiumTileset::CreateIonServerBindingRel() const
{
return GetPrim().CreateRelationship(CesiumTokens->cesiumIonServerBinding,
/* custom = */ false);
}
UsdRelationship
CesiumTileset::GetRasterOverlayBindingRel() const
{
return GetPrim().GetRelationship(CesiumTokens->cesiumRasterOverlayBinding);
}
UsdRelationship
CesiumTileset::CreateRasterOverlayBindingRel() const
{
return GetPrim().CreateRelationship(CesiumTokens->cesiumRasterOverlayBinding,
/* custom = */ false);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumTileset::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumSourceType,
CesiumTokens->cesiumUrl,
CesiumTokens->cesiumIonAssetId,
CesiumTokens->cesiumIonAccessToken,
CesiumTokens->cesiumMaximumScreenSpaceError,
CesiumTokens->cesiumPreloadAncestors,
CesiumTokens->cesiumPreloadSiblings,
CesiumTokens->cesiumForbidHoles,
CesiumTokens->cesiumMaximumSimultaneousTileLoads,
CesiumTokens->cesiumMaximumCachedBytes,
CesiumTokens->cesiumLoadingDescendantLimit,
CesiumTokens->cesiumEnableFrustumCulling,
CesiumTokens->cesiumEnableFogCulling,
CesiumTokens->cesiumEnforceCulledScreenSpaceError,
CesiumTokens->cesiumCulledScreenSpaceError,
CesiumTokens->cesiumSuspendUpdate,
CesiumTokens->cesiumSmoothNormals,
CesiumTokens->cesiumShowCreditsOnScreen,
CesiumTokens->cesiumMainThreadLoadingTimeLimit,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
UsdGeomGprim::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 15,352 | C++ | 29.522863 | 109 | 0.661477 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapPolygonRasterOverlay.cpp | #include ".//polygonRasterOverlay.h"
#include "pxr/usd/usd/schemaBase.h"
#include "pxr/usd/sdf/primSpec.h"
#include "pxr/usd/usd/pyConversions.h"
#include "pxr/base/tf/pyContainerConversions.h"
#include "pxr/base/tf/pyResultConversions.h"
#include "pxr/base/tf/pyUtils.h"
#include "pxr/base/tf/wrapTypeHelpers.h"
#include <boost/python.hpp>
#include <string>
using namespace boost::python;
PXR_NAMESPACE_USING_DIRECTIVE
namespace {
#define WRAP_CUSTOM \
template <class Cls> static void _CustomWrapCode(Cls &_class)
// fwd decl.
WRAP_CUSTOM;
static UsdAttribute
_CreateInvertSelectionAttr(CesiumPolygonRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateInvertSelectionAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateExcludeSelectedTilesAttr(CesiumPolygonRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateExcludeSelectedTilesAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateCesiumOverlayRenderMethodAttr(CesiumPolygonRasterOverlay &self,
object defaultVal, bool writeSparsely) {
return self.CreateCesiumOverlayRenderMethodAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Token), writeSparsely);
}
static std::string
_Repr(const CesiumPolygonRasterOverlay &self)
{
std::string primRepr = TfPyRepr(self.GetPrim());
return TfStringPrintf(
"CesiumUsdSchemas.PolygonRasterOverlay(%s)",
primRepr.c_str());
}
} // anonymous namespace
void wrapCesiumPolygonRasterOverlay()
{
typedef CesiumPolygonRasterOverlay This;
class_<This, bases<CesiumRasterOverlay> >
cls("PolygonRasterOverlay");
cls
.def(init<UsdPrim>(arg("prim")))
.def(init<UsdSchemaBase const&>(arg("schemaObj")))
.def(TfTypePythonClass())
.def("Get", &This::Get, (arg("stage"), arg("path")))
.staticmethod("Get")
.def("Define", &This::Define, (arg("stage"), arg("path")))
.staticmethod("Define")
.def("GetSchemaAttributeNames",
&This::GetSchemaAttributeNames,
arg("includeInherited")=true,
return_value_policy<TfPySequenceToList>())
.staticmethod("GetSchemaAttributeNames")
.def("_GetStaticTfType", (TfType const &(*)()) TfType::Find<This>,
return_value_policy<return_by_value>())
.staticmethod("_GetStaticTfType")
.def(!self)
.def("GetInvertSelectionAttr",
&This::GetInvertSelectionAttr)
.def("CreateInvertSelectionAttr",
&_CreateInvertSelectionAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetExcludeSelectedTilesAttr",
&This::GetExcludeSelectedTilesAttr)
.def("CreateExcludeSelectedTilesAttr",
&_CreateExcludeSelectedTilesAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetCesiumOverlayRenderMethodAttr",
&This::GetCesiumOverlayRenderMethodAttr)
.def("CreateCesiumOverlayRenderMethodAttr",
&_CreateCesiumOverlayRenderMethodAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetCartographicPolygonBindingRel",
&This::GetCartographicPolygonBindingRel)
.def("CreateCartographicPolygonBindingRel",
&This::CreateCartographicPolygonBindingRel)
.def("__repr__", ::_Repr)
;
_CustomWrapCode(cls);
}
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator. The entry point for your custom code should look
// minimally like the following:
//
// WRAP_CUSTOM {
// _class
// .def("MyCustomMethod", ...)
// ;
// }
//
// Of course any other ancillary or support code may be provided.
//
// Just remember to wrap code in the appropriate delimiters:
// 'namespace {', '}'.
//
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
namespace {
WRAP_CUSTOM {
}
}
| 4,491 | C++ | 29.147651 | 81 | 0.617457 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapTokens.cpp | // GENERATED FILE. DO NOT EDIT.
#include <boost/python/class.hpp>
#include ".//tokens.h"
PXR_NAMESPACE_USING_DIRECTIVE
namespace {
// Helper to return a static token as a string. We wrap tokens as Python
// strings and for some reason simply wrapping the token using def_readonly
// bypasses to-Python conversion, leading to the error that there's no
// Python type for the C++ TfToken type. So we wrap this functor instead.
class _WrapStaticToken {
public:
_WrapStaticToken(const TfToken* token) : _token(token) { }
std::string operator()() const
{
return _token->GetString();
}
private:
const TfToken* _token;
};
template <typename T>
void
_AddToken(T& cls, const char* name, const TfToken& token)
{
cls.add_static_property(name,
boost::python::make_function(
_WrapStaticToken(&token),
boost::python::return_value_policy<
boost::python::return_by_value>(),
boost::mpl::vector1<std::string>()));
}
} // anonymous
void wrapCesiumTokens()
{
boost::python::class_<CesiumTokensType, boost::noncopyable>
cls("Tokens", boost::python::no_init);
_AddToken(cls, "cesiumAlpha", CesiumTokens->cesiumAlpha);
_AddToken(cls, "cesiumAnchorAdjustOrientationForGlobeWhenMoving", CesiumTokens->cesiumAnchorAdjustOrientationForGlobeWhenMoving);
_AddToken(cls, "cesiumAnchorDetectTransformChanges", CesiumTokens->cesiumAnchorDetectTransformChanges);
_AddToken(cls, "cesiumAnchorGeoreferenceBinding", CesiumTokens->cesiumAnchorGeoreferenceBinding);
_AddToken(cls, "cesiumAnchorHeight", CesiumTokens->cesiumAnchorHeight);
_AddToken(cls, "cesiumAnchorLatitude", CesiumTokens->cesiumAnchorLatitude);
_AddToken(cls, "cesiumAnchorLongitude", CesiumTokens->cesiumAnchorLongitude);
_AddToken(cls, "cesiumAnchorPosition", CesiumTokens->cesiumAnchorPosition);
_AddToken(cls, "cesiumBaseUrl", CesiumTokens->cesiumBaseUrl);
_AddToken(cls, "cesiumCartographicPolygonBinding", CesiumTokens->cesiumCartographicPolygonBinding);
_AddToken(cls, "cesiumCulledScreenSpaceError", CesiumTokens->cesiumCulledScreenSpaceError);
_AddToken(cls, "cesiumDebugDisableGeometryPool", CesiumTokens->cesiumDebugDisableGeometryPool);
_AddToken(cls, "cesiumDebugDisableGeoreferencing", CesiumTokens->cesiumDebugDisableGeoreferencing);
_AddToken(cls, "cesiumDebugDisableMaterialPool", CesiumTokens->cesiumDebugDisableMaterialPool);
_AddToken(cls, "cesiumDebugDisableMaterials", CesiumTokens->cesiumDebugDisableMaterials);
_AddToken(cls, "cesiumDebugDisableTexturePool", CesiumTokens->cesiumDebugDisableTexturePool);
_AddToken(cls, "cesiumDebugDisableTextures", CesiumTokens->cesiumDebugDisableTextures);
_AddToken(cls, "cesiumDebugGeometryPoolInitialCapacity", CesiumTokens->cesiumDebugGeometryPoolInitialCapacity);
_AddToken(cls, "cesiumDebugMaterialPoolInitialCapacity", CesiumTokens->cesiumDebugMaterialPoolInitialCapacity);
_AddToken(cls, "cesiumDebugRandomColors", CesiumTokens->cesiumDebugRandomColors);
_AddToken(cls, "cesiumDebugTexturePoolInitialCapacity", CesiumTokens->cesiumDebugTexturePoolInitialCapacity);
_AddToken(cls, "cesiumDisplayName", CesiumTokens->cesiumDisplayName);
_AddToken(cls, "cesiumEast", CesiumTokens->cesiumEast);
_AddToken(cls, "cesiumEcefToUsdTransform", CesiumTokens->cesiumEcefToUsdTransform);
_AddToken(cls, "cesiumEnableFogCulling", CesiumTokens->cesiumEnableFogCulling);
_AddToken(cls, "cesiumEnableFrustumCulling", CesiumTokens->cesiumEnableFrustumCulling);
_AddToken(cls, "cesiumEnforceCulledScreenSpaceError", CesiumTokens->cesiumEnforceCulledScreenSpaceError);
_AddToken(cls, "cesiumExcludeSelectedTiles", CesiumTokens->cesiumExcludeSelectedTiles);
_AddToken(cls, "cesiumForbidHoles", CesiumTokens->cesiumForbidHoles);
_AddToken(cls, "cesiumFormat", CesiumTokens->cesiumFormat);
_AddToken(cls, "cesiumGeoreferenceBinding", CesiumTokens->cesiumGeoreferenceBinding);
_AddToken(cls, "cesiumGeoreferenceOriginHeight", CesiumTokens->cesiumGeoreferenceOriginHeight);
_AddToken(cls, "cesiumGeoreferenceOriginLatitude", CesiumTokens->cesiumGeoreferenceOriginLatitude);
_AddToken(cls, "cesiumGeoreferenceOriginLongitude", CesiumTokens->cesiumGeoreferenceOriginLongitude);
_AddToken(cls, "cesiumInvertSelection", CesiumTokens->cesiumInvertSelection);
_AddToken(cls, "cesiumIonAccessToken", CesiumTokens->cesiumIonAccessToken);
_AddToken(cls, "cesiumIonAssetId", CesiumTokens->cesiumIonAssetId);
_AddToken(cls, "cesiumIonServerApiUrl", CesiumTokens->cesiumIonServerApiUrl);
_AddToken(cls, "cesiumIonServerApplicationId", CesiumTokens->cesiumIonServerApplicationId);
_AddToken(cls, "cesiumIonServerBinding", CesiumTokens->cesiumIonServerBinding);
_AddToken(cls, "cesiumIonServerUrl", CesiumTokens->cesiumIonServerUrl);
_AddToken(cls, "cesiumLayer", CesiumTokens->cesiumLayer);
_AddToken(cls, "cesiumLayers", CesiumTokens->cesiumLayers);
_AddToken(cls, "cesiumLoadingDescendantLimit", CesiumTokens->cesiumLoadingDescendantLimit);
_AddToken(cls, "cesiumMainThreadLoadingTimeLimit", CesiumTokens->cesiumMainThreadLoadingTimeLimit);
_AddToken(cls, "cesiumMaximumCachedBytes", CesiumTokens->cesiumMaximumCachedBytes);
_AddToken(cls, "cesiumMaximumLevel", CesiumTokens->cesiumMaximumLevel);
_AddToken(cls, "cesiumMaximumScreenSpaceError", CesiumTokens->cesiumMaximumScreenSpaceError);
_AddToken(cls, "cesiumMaximumSimultaneousTileLoads", CesiumTokens->cesiumMaximumSimultaneousTileLoads);
_AddToken(cls, "cesiumMaximumTextureSize", CesiumTokens->cesiumMaximumTextureSize);
_AddToken(cls, "cesiumMaximumZoomLevel", CesiumTokens->cesiumMaximumZoomLevel);
_AddToken(cls, "cesiumMinimumLevel", CesiumTokens->cesiumMinimumLevel);
_AddToken(cls, "cesiumMinimumZoomLevel", CesiumTokens->cesiumMinimumZoomLevel);
_AddToken(cls, "cesiumNorth", CesiumTokens->cesiumNorth);
_AddToken(cls, "cesiumOverlayRenderMethod", CesiumTokens->cesiumOverlayRenderMethod);
_AddToken(cls, "cesiumPreloadAncestors", CesiumTokens->cesiumPreloadAncestors);
_AddToken(cls, "cesiumPreloadSiblings", CesiumTokens->cesiumPreloadSiblings);
_AddToken(cls, "cesiumProjectDefaultIonAccessToken", CesiumTokens->cesiumProjectDefaultIonAccessToken);
_AddToken(cls, "cesiumProjectDefaultIonAccessTokenId", CesiumTokens->cesiumProjectDefaultIonAccessTokenId);
_AddToken(cls, "cesiumRasterOverlayBinding", CesiumTokens->cesiumRasterOverlayBinding);
_AddToken(cls, "cesiumRootTilesX", CesiumTokens->cesiumRootTilesX);
_AddToken(cls, "cesiumRootTilesY", CesiumTokens->cesiumRootTilesY);
_AddToken(cls, "cesiumSelectedIonServer", CesiumTokens->cesiumSelectedIonServer);
_AddToken(cls, "cesiumShowCreditsOnScreen", CesiumTokens->cesiumShowCreditsOnScreen);
_AddToken(cls, "cesiumSmoothNormals", CesiumTokens->cesiumSmoothNormals);
_AddToken(cls, "cesiumSourceType", CesiumTokens->cesiumSourceType);
_AddToken(cls, "cesiumSouth", CesiumTokens->cesiumSouth);
_AddToken(cls, "cesiumSpecifyTileMatrixSetLabels", CesiumTokens->cesiumSpecifyTileMatrixSetLabels);
_AddToken(cls, "cesiumSpecifyTilingScheme", CesiumTokens->cesiumSpecifyTilingScheme);
_AddToken(cls, "cesiumSpecifyZoomLevels", CesiumTokens->cesiumSpecifyZoomLevels);
_AddToken(cls, "cesiumStyle", CesiumTokens->cesiumStyle);
_AddToken(cls, "cesiumSubTileCacheBytes", CesiumTokens->cesiumSubTileCacheBytes);
_AddToken(cls, "cesiumSuspendUpdate", CesiumTokens->cesiumSuspendUpdate);
_AddToken(cls, "cesiumTileHeight", CesiumTokens->cesiumTileHeight);
_AddToken(cls, "cesiumTileMatrixSetId", CesiumTokens->cesiumTileMatrixSetId);
_AddToken(cls, "cesiumTileMatrixSetLabelPrefix", CesiumTokens->cesiumTileMatrixSetLabelPrefix);
_AddToken(cls, "cesiumTileMatrixSetLabels", CesiumTokens->cesiumTileMatrixSetLabels);
_AddToken(cls, "cesiumTileWidth", CesiumTokens->cesiumTileWidth);
_AddToken(cls, "cesiumUrl", CesiumTokens->cesiumUrl);
_AddToken(cls, "cesiumUseWebMercatorProjection", CesiumTokens->cesiumUseWebMercatorProjection);
_AddToken(cls, "cesiumWest", CesiumTokens->cesiumWest);
_AddToken(cls, "clip", CesiumTokens->clip);
_AddToken(cls, "ion", CesiumTokens->ion);
_AddToken(cls, "overlay", CesiumTokens->overlay);
_AddToken(cls, "url", CesiumTokens->url);
}
| 8,498 | C++ | 64.376923 | 133 | 0.772182 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/ionServer.h | #ifndef CESIUMUSDSCHEMAS_GENERATED_IONSERVER_H
#define CESIUMUSDSCHEMAS_GENERATED_IONSERVER_H
/// \file CesiumUsdSchemas/ionServer.h
#include "pxr/pxr.h"
#include ".//api.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/usd/prim.h"
#include "pxr/usd/usd/stage.h"
#include ".//tokens.h"
#include "pxr/base/vt/value.h"
#include "pxr/base/gf/vec3d.h"
#include "pxr/base/gf/vec3f.h"
#include "pxr/base/gf/matrix4d.h"
#include "pxr/base/tf/token.h"
#include "pxr/base/tf/type.h"
PXR_NAMESPACE_OPEN_SCOPE
class SdfAssetPath;
// -------------------------------------------------------------------------- //
// CESIUMIONSERVERPRIM //
// -------------------------------------------------------------------------- //
/// \class CesiumIonServer
///
/// Stores metadata related to Cesium ion server connections for tilesets.
///
class CesiumIonServer : public UsdTyped
{
public:
/// Compile time constant representing what kind of schema this class is.
///
/// \sa UsdSchemaKind
static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
/// Construct a CesiumIonServer on UsdPrim \p prim .
/// Equivalent to CesiumIonServer::Get(prim.GetStage(), prim.GetPath())
/// for a \em valid \p prim, but will not immediately throw an error for
/// an invalid \p prim
explicit CesiumIonServer(const UsdPrim& prim=UsdPrim())
: UsdTyped(prim)
{
}
/// Construct a CesiumIonServer on the prim held by \p schemaObj .
/// Should be preferred over CesiumIonServer(schemaObj.GetPrim()),
/// as it preserves SchemaBase state.
explicit CesiumIonServer(const UsdSchemaBase& schemaObj)
: UsdTyped(schemaObj)
{
}
/// Destructor.
CESIUMUSDSCHEMAS_API
virtual ~CesiumIonServer();
/// Return a vector of names of all pre-declared attributes for this schema
/// class and all its ancestor classes. Does not include attributes that
/// may be authored by custom/extended methods of the schemas involved.
CESIUMUSDSCHEMAS_API
static const TfTokenVector &
GetSchemaAttributeNames(bool includeInherited=true);
/// Return a CesiumIonServer holding the prim adhering to this
/// schema at \p path on \p stage. If no prim exists at \p path on
/// \p stage, or if the prim at that path does not adhere to this schema,
/// return an invalid schema object. This is shorthand for the following:
///
/// \code
/// CesiumIonServer(stage->GetPrimAtPath(path));
/// \endcode
///
CESIUMUSDSCHEMAS_API
static CesiumIonServer
Get(const UsdStagePtr &stage, const SdfPath &path);
/// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
/// is defined (according to UsdPrim::IsDefined()) on this stage.
///
/// If a prim adhering to this schema at \p path is already defined on this
/// stage, return that prim. Otherwise author an \a SdfPrimSpec with
/// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
/// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
/// with \p specifier == \a SdfSpecifierDef and empty typeName at the
/// current EditTarget for any nonexistent, or existing but not \a Defined
/// ancestors.
///
/// The given \a path must be an absolute prim path that does not contain
/// any variant selections.
///
/// If it is impossible to author any of the necessary PrimSpecs, (for
/// example, in case \a path cannot map to the current UsdEditTarget's
/// namespace) issue an error and return an invalid \a UsdPrim.
///
/// Note that this method may return a defined prim whose typeName does not
/// specify this schema class, in case a stronger typeName opinion overrides
/// the opinion at the current EditTarget.
///
CESIUMUSDSCHEMAS_API
static CesiumIonServer
Define(const UsdStagePtr &stage, const SdfPath &path);
protected:
/// Returns the kind of schema this class belongs to.
///
/// \sa UsdSchemaKind
CESIUMUSDSCHEMAS_API
UsdSchemaKind _GetSchemaKind() const override;
private:
// needs to invoke _GetStaticTfType.
friend class UsdSchemaRegistry;
CESIUMUSDSCHEMAS_API
static const TfType &_GetStaticTfType();
static bool _IsTypedSchema();
// override SchemaBase virtuals.
CESIUMUSDSCHEMAS_API
const TfType &_GetTfType() const override;
public:
// --------------------------------------------------------------------- //
// DISPLAYNAME
// --------------------------------------------------------------------- //
/// The name to display for this server.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:displayName` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetDisplayNameAttr() const;
/// See GetDisplayNameAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateDisplayNameAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// IONSERVERURL
// --------------------------------------------------------------------- //
/// The base URL for the Cesium ion Server.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:ionServerUrl` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetIonServerUrlAttr() const;
/// See GetIonServerUrlAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateIonServerUrlAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// IONSERVERAPIURL
// --------------------------------------------------------------------- //
/// The base URL for the Cesium ion Server API.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:ionServerApiUrl` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetIonServerApiUrlAttr() const;
/// See GetIonServerApiUrlAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateIonServerApiUrlAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// IONSERVERAPPLICATIONID
// --------------------------------------------------------------------- //
/// The application ID for the Cesium ion Server connection.
///
/// | ||
/// | -- | -- |
/// | Declaration | `int64 cesium:ionServerApplicationId` |
/// | C++ Type | int64_t |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Int64 |
CESIUMUSDSCHEMAS_API
UsdAttribute GetIonServerApplicationIdAttr() const;
/// See GetIonServerApplicationIdAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateIonServerApplicationIdAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// PROJECTDEFAULTIONACCESSTOKEN
// --------------------------------------------------------------------- //
/// A string representing the token for accessing Cesium ion assets.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:projectDefaultIonAccessToken = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetProjectDefaultIonAccessTokenAttr() const;
/// See GetProjectDefaultIonAccessTokenAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateProjectDefaultIonAccessTokenAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// --------------------------------------------------------------------- //
// PROJECTDEFAULTIONACCESSTOKENID
// --------------------------------------------------------------------- //
/// A string representing the token ID for accessing Cesium ion assets.
///
/// | ||
/// | -- | -- |
/// | Declaration | `string cesium:projectDefaultIonAccessTokenId = ""` |
/// | C++ Type | std::string |
/// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
CESIUMUSDSCHEMAS_API
UsdAttribute GetProjectDefaultIonAccessTokenIdAttr() const;
/// See GetProjectDefaultIonAccessTokenIdAttr(), and also
/// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
/// If specified, author \p defaultValue as the attribute's default,
/// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
/// the default for \p writeSparsely is \c false.
CESIUMUSDSCHEMAS_API
UsdAttribute CreateProjectDefaultIonAccessTokenIdAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
public:
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator.
//
// Just remember to:
// - Close the class declaration with };
// - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
// - Close the include guard with #endif
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
};
PXR_NAMESPACE_CLOSE_SCOPE
#endif
| 11,156 | C | 39.423913 | 131 | 0.594299 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/wrapData.cpp | #include ".//data.h"
#include "pxr/usd/usd/schemaBase.h"
#include "pxr/usd/sdf/primSpec.h"
#include "pxr/usd/usd/pyConversions.h"
#include "pxr/base/tf/pyContainerConversions.h"
#include "pxr/base/tf/pyResultConversions.h"
#include "pxr/base/tf/pyUtils.h"
#include "pxr/base/tf/wrapTypeHelpers.h"
#include <boost/python.hpp>
#include <string>
using namespace boost::python;
PXR_NAMESPACE_USING_DIRECTIVE
namespace {
#define WRAP_CUSTOM \
template <class Cls> static void _CustomWrapCode(Cls &_class)
// fwd decl.
WRAP_CUSTOM;
static UsdAttribute
_CreateDebugDisableMaterialsAttr(CesiumData &self,
object defaultVal, bool writeSparsely) {
return self.CreateDebugDisableMaterialsAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateDebugDisableTexturesAttr(CesiumData &self,
object defaultVal, bool writeSparsely) {
return self.CreateDebugDisableTexturesAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateDebugDisableGeometryPoolAttr(CesiumData &self,
object defaultVal, bool writeSparsely) {
return self.CreateDebugDisableGeometryPoolAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateDebugDisableMaterialPoolAttr(CesiumData &self,
object defaultVal, bool writeSparsely) {
return self.CreateDebugDisableMaterialPoolAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateDebugDisableTexturePoolAttr(CesiumData &self,
object defaultVal, bool writeSparsely) {
return self.CreateDebugDisableTexturePoolAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateDebugGeometryPoolInitialCapacityAttr(CesiumData &self,
object defaultVal, bool writeSparsely) {
return self.CreateDebugGeometryPoolInitialCapacityAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->UInt64), writeSparsely);
}
static UsdAttribute
_CreateDebugMaterialPoolInitialCapacityAttr(CesiumData &self,
object defaultVal, bool writeSparsely) {
return self.CreateDebugMaterialPoolInitialCapacityAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->UInt64), writeSparsely);
}
static UsdAttribute
_CreateDebugTexturePoolInitialCapacityAttr(CesiumData &self,
object defaultVal, bool writeSparsely) {
return self.CreateDebugTexturePoolInitialCapacityAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->UInt64), writeSparsely);
}
static UsdAttribute
_CreateDebugRandomColorsAttr(CesiumData &self,
object defaultVal, bool writeSparsely) {
return self.CreateDebugRandomColorsAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static UsdAttribute
_CreateDebugDisableGeoreferencingAttr(CesiumData &self,
object defaultVal, bool writeSparsely) {
return self.CreateDebugDisableGeoreferencingAttr(
UsdPythonToSdfType(defaultVal, SdfValueTypeNames->Bool), writeSparsely);
}
static std::string
_Repr(const CesiumData &self)
{
std::string primRepr = TfPyRepr(self.GetPrim());
return TfStringPrintf(
"CesiumUsdSchemas.Data(%s)",
primRepr.c_str());
}
} // anonymous namespace
void wrapCesiumData()
{
typedef CesiumData This;
class_<This, bases<UsdTyped> >
cls("Data");
cls
.def(init<UsdPrim>(arg("prim")))
.def(init<UsdSchemaBase const&>(arg("schemaObj")))
.def(TfTypePythonClass())
.def("Get", &This::Get, (arg("stage"), arg("path")))
.staticmethod("Get")
.def("Define", &This::Define, (arg("stage"), arg("path")))
.staticmethod("Define")
.def("GetSchemaAttributeNames",
&This::GetSchemaAttributeNames,
arg("includeInherited")=true,
return_value_policy<TfPySequenceToList>())
.staticmethod("GetSchemaAttributeNames")
.def("_GetStaticTfType", (TfType const &(*)()) TfType::Find<This>,
return_value_policy<return_by_value>())
.staticmethod("_GetStaticTfType")
.def(!self)
.def("GetDebugDisableMaterialsAttr",
&This::GetDebugDisableMaterialsAttr)
.def("CreateDebugDisableMaterialsAttr",
&_CreateDebugDisableMaterialsAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetDebugDisableTexturesAttr",
&This::GetDebugDisableTexturesAttr)
.def("CreateDebugDisableTexturesAttr",
&_CreateDebugDisableTexturesAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetDebugDisableGeometryPoolAttr",
&This::GetDebugDisableGeometryPoolAttr)
.def("CreateDebugDisableGeometryPoolAttr",
&_CreateDebugDisableGeometryPoolAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetDebugDisableMaterialPoolAttr",
&This::GetDebugDisableMaterialPoolAttr)
.def("CreateDebugDisableMaterialPoolAttr",
&_CreateDebugDisableMaterialPoolAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetDebugDisableTexturePoolAttr",
&This::GetDebugDisableTexturePoolAttr)
.def("CreateDebugDisableTexturePoolAttr",
&_CreateDebugDisableTexturePoolAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetDebugGeometryPoolInitialCapacityAttr",
&This::GetDebugGeometryPoolInitialCapacityAttr)
.def("CreateDebugGeometryPoolInitialCapacityAttr",
&_CreateDebugGeometryPoolInitialCapacityAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetDebugMaterialPoolInitialCapacityAttr",
&This::GetDebugMaterialPoolInitialCapacityAttr)
.def("CreateDebugMaterialPoolInitialCapacityAttr",
&_CreateDebugMaterialPoolInitialCapacityAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetDebugTexturePoolInitialCapacityAttr",
&This::GetDebugTexturePoolInitialCapacityAttr)
.def("CreateDebugTexturePoolInitialCapacityAttr",
&_CreateDebugTexturePoolInitialCapacityAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetDebugRandomColorsAttr",
&This::GetDebugRandomColorsAttr)
.def("CreateDebugRandomColorsAttr",
&_CreateDebugRandomColorsAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetDebugDisableGeoreferencingAttr",
&This::GetDebugDisableGeoreferencingAttr)
.def("CreateDebugDisableGeoreferencingAttr",
&_CreateDebugDisableGeoreferencingAttr,
(arg("defaultValue")=object(),
arg("writeSparsely")=false))
.def("GetSelectedIonServerRel",
&This::GetSelectedIonServerRel)
.def("CreateSelectedIonServerRel",
&This::CreateSelectedIonServerRel)
.def("__repr__", ::_Repr)
;
_CustomWrapCode(cls);
}
// ===================================================================== //
// Feel free to add custom code below this line, it will be preserved by
// the code generator. The entry point for your custom code should look
// minimally like the following:
//
// WRAP_CUSTOM {
// _class
// .def("MyCustomMethod", ...)
// ;
// }
//
// Of course any other ancillary or support code may be provided.
//
// Just remember to wrap code in the appropriate delimiters:
// 'namespace {', '}'.
//
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
namespace {
WRAP_CUSTOM {
}
}
| 8,609 | C++ | 33.858299 | 82 | 0.630503 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/polygonRasterOverlay.cpp | #include ".//polygonRasterOverlay.h"
#include "pxr/usd/usd/schemaRegistry.h"
#include "pxr/usd/usd/typed.h"
#include "pxr/usd/sdf/types.h"
#include "pxr/usd/sdf/assetPath.h"
PXR_NAMESPACE_OPEN_SCOPE
// Register the schema with the TfType system.
TF_REGISTRY_FUNCTION(TfType)
{
TfType::Define<CesiumPolygonRasterOverlay,
TfType::Bases< CesiumRasterOverlay > >();
// Register the usd prim typename as an alias under UsdSchemaBase. This
// enables one to call
// TfType::Find<UsdSchemaBase>().FindDerivedByName("CesiumPolygonRasterOverlayPrim")
// to find TfType<CesiumPolygonRasterOverlay>, which is how IsA queries are
// answered.
TfType::AddAlias<UsdSchemaBase, CesiumPolygonRasterOverlay>("CesiumPolygonRasterOverlayPrim");
}
/* virtual */
CesiumPolygonRasterOverlay::~CesiumPolygonRasterOverlay()
{
}
/* static */
CesiumPolygonRasterOverlay
CesiumPolygonRasterOverlay::Get(const UsdStagePtr &stage, const SdfPath &path)
{
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumPolygonRasterOverlay();
}
return CesiumPolygonRasterOverlay(stage->GetPrimAtPath(path));
}
/* static */
CesiumPolygonRasterOverlay
CesiumPolygonRasterOverlay::Define(
const UsdStagePtr &stage, const SdfPath &path)
{
static TfToken usdPrimTypeName("CesiumPolygonRasterOverlayPrim");
if (!stage) {
TF_CODING_ERROR("Invalid stage");
return CesiumPolygonRasterOverlay();
}
return CesiumPolygonRasterOverlay(
stage->DefinePrim(path, usdPrimTypeName));
}
/* virtual */
UsdSchemaKind CesiumPolygonRasterOverlay::_GetSchemaKind() const
{
return CesiumPolygonRasterOverlay::schemaKind;
}
/* static */
const TfType &
CesiumPolygonRasterOverlay::_GetStaticTfType()
{
static TfType tfType = TfType::Find<CesiumPolygonRasterOverlay>();
return tfType;
}
/* static */
bool
CesiumPolygonRasterOverlay::_IsTypedSchema()
{
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>();
return isTyped;
}
/* virtual */
const TfType &
CesiumPolygonRasterOverlay::_GetTfType() const
{
return _GetStaticTfType();
}
UsdAttribute
CesiumPolygonRasterOverlay::GetInvertSelectionAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumInvertSelection);
}
UsdAttribute
CesiumPolygonRasterOverlay::CreateInvertSelectionAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumInvertSelection,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumPolygonRasterOverlay::GetExcludeSelectedTilesAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumExcludeSelectedTiles);
}
UsdAttribute
CesiumPolygonRasterOverlay::CreateExcludeSelectedTilesAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumExcludeSelectedTiles,
SdfValueTypeNames->Bool,
/* custom = */ false,
SdfVariabilityVarying,
defaultValue,
writeSparsely);
}
UsdAttribute
CesiumPolygonRasterOverlay::GetCesiumOverlayRenderMethodAttr() const
{
return GetPrim().GetAttribute(CesiumTokens->cesiumOverlayRenderMethod);
}
UsdAttribute
CesiumPolygonRasterOverlay::CreateCesiumOverlayRenderMethodAttr(VtValue const &defaultValue, bool writeSparsely) const
{
return UsdSchemaBase::_CreateAttr(CesiumTokens->cesiumOverlayRenderMethod,
SdfValueTypeNames->Token,
/* custom = */ false,
SdfVariabilityUniform,
defaultValue,
writeSparsely);
}
UsdRelationship
CesiumPolygonRasterOverlay::GetCartographicPolygonBindingRel() const
{
return GetPrim().GetRelationship(CesiumTokens->cesiumCartographicPolygonBinding);
}
UsdRelationship
CesiumPolygonRasterOverlay::CreateCartographicPolygonBindingRel() const
{
return GetPrim().CreateRelationship(CesiumTokens->cesiumCartographicPolygonBinding,
/* custom = */ false);
}
namespace {
static inline TfTokenVector
_ConcatenateAttributeNames(const TfTokenVector& left,const TfTokenVector& right)
{
TfTokenVector result;
result.reserve(left.size() + right.size());
result.insert(result.end(), left.begin(), left.end());
result.insert(result.end(), right.begin(), right.end());
return result;
}
}
/*static*/
const TfTokenVector&
CesiumPolygonRasterOverlay::GetSchemaAttributeNames(bool includeInherited)
{
static TfTokenVector localNames = {
CesiumTokens->cesiumInvertSelection,
CesiumTokens->cesiumExcludeSelectedTiles,
CesiumTokens->cesiumOverlayRenderMethod,
};
static TfTokenVector allNames =
_ConcatenateAttributeNames(
CesiumRasterOverlay::GetSchemaAttributeNames(true),
localNames);
if (includeInherited)
return allNames;
else
return localNames;
}
PXR_NAMESPACE_CLOSE_SCOPE
// ===================================================================== //
// Feel free to add custom code below this line. It will be preserved by
// the code generator.
//
// Just remember to wrap code in the appropriate delimiters:
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'.
// ===================================================================== //
// --(BEGIN CUSTOM CODE)--
| 5,592 | C++ | 28.592592 | 118 | 0.690808 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/tokens.cpp | #include ".//tokens.h"
PXR_NAMESPACE_OPEN_SCOPE
CesiumTokensType::CesiumTokensType() :
cesiumAlpha("cesium:alpha", TfToken::Immortal),
cesiumAnchorAdjustOrientationForGlobeWhenMoving("cesium:anchor:adjustOrientationForGlobeWhenMoving", TfToken::Immortal),
cesiumAnchorDetectTransformChanges("cesium:anchor:detectTransformChanges", TfToken::Immortal),
cesiumAnchorGeoreferenceBinding("cesium:anchor:georeferenceBinding", TfToken::Immortal),
cesiumAnchorHeight("cesium:anchor:height", TfToken::Immortal),
cesiumAnchorLatitude("cesium:anchor:latitude", TfToken::Immortal),
cesiumAnchorLongitude("cesium:anchor:longitude", TfToken::Immortal),
cesiumAnchorPosition("cesium:anchor:position", TfToken::Immortal),
cesiumBaseUrl("cesium:baseUrl", TfToken::Immortal),
cesiumCartographicPolygonBinding("cesium:cartographicPolygonBinding", TfToken::Immortal),
cesiumCulledScreenSpaceError("cesium:culledScreenSpaceError", TfToken::Immortal),
cesiumDebugDisableGeometryPool("cesium:debug:disableGeometryPool", TfToken::Immortal),
cesiumDebugDisableGeoreferencing("cesium:debug:disableGeoreferencing", TfToken::Immortal),
cesiumDebugDisableMaterialPool("cesium:debug:disableMaterialPool", TfToken::Immortal),
cesiumDebugDisableMaterials("cesium:debug:disableMaterials", TfToken::Immortal),
cesiumDebugDisableTexturePool("cesium:debug:disableTexturePool", TfToken::Immortal),
cesiumDebugDisableTextures("cesium:debug:disableTextures", TfToken::Immortal),
cesiumDebugGeometryPoolInitialCapacity("cesium:debug:geometryPoolInitialCapacity", TfToken::Immortal),
cesiumDebugMaterialPoolInitialCapacity("cesium:debug:materialPoolInitialCapacity", TfToken::Immortal),
cesiumDebugRandomColors("cesium:debug:randomColors", TfToken::Immortal),
cesiumDebugTexturePoolInitialCapacity("cesium:debug:texturePoolInitialCapacity", TfToken::Immortal),
cesiumDisplayName("cesium:displayName", TfToken::Immortal),
cesiumEast("cesium:east", TfToken::Immortal),
cesiumEcefToUsdTransform("cesium:ecefToUsdTransform", TfToken::Immortal),
cesiumEnableFogCulling("cesium:enableFogCulling", TfToken::Immortal),
cesiumEnableFrustumCulling("cesium:enableFrustumCulling", TfToken::Immortal),
cesiumEnforceCulledScreenSpaceError("cesium:enforceCulledScreenSpaceError", TfToken::Immortal),
cesiumExcludeSelectedTiles("cesium:excludeSelectedTiles", TfToken::Immortal),
cesiumForbidHoles("cesium:forbidHoles", TfToken::Immortal),
cesiumFormat("cesium:format", TfToken::Immortal),
cesiumGeoreferenceBinding("cesium:georeferenceBinding", TfToken::Immortal),
cesiumGeoreferenceOriginHeight("cesium:georeferenceOrigin:height", TfToken::Immortal),
cesiumGeoreferenceOriginLatitude("cesium:georeferenceOrigin:latitude", TfToken::Immortal),
cesiumGeoreferenceOriginLongitude("cesium:georeferenceOrigin:longitude", TfToken::Immortal),
cesiumInvertSelection("cesium:invertSelection", TfToken::Immortal),
cesiumIonAccessToken("cesium:ionAccessToken", TfToken::Immortal),
cesiumIonAssetId("cesium:ionAssetId", TfToken::Immortal),
cesiumIonServerApiUrl("cesium:ionServerApiUrl", TfToken::Immortal),
cesiumIonServerApplicationId("cesium:ionServerApplicationId", TfToken::Immortal),
cesiumIonServerBinding("cesium:ionServerBinding", TfToken::Immortal),
cesiumIonServerUrl("cesium:ionServerUrl", TfToken::Immortal),
cesiumLayer("cesium:layer", TfToken::Immortal),
cesiumLayers("cesium:layers", TfToken::Immortal),
cesiumLoadingDescendantLimit("cesium:loadingDescendantLimit", TfToken::Immortal),
cesiumMainThreadLoadingTimeLimit("cesium:mainThreadLoadingTimeLimit", TfToken::Immortal),
cesiumMaximumCachedBytes("cesium:maximumCachedBytes", TfToken::Immortal),
cesiumMaximumLevel("cesium:maximumLevel", TfToken::Immortal),
cesiumMaximumScreenSpaceError("cesium:maximumScreenSpaceError", TfToken::Immortal),
cesiumMaximumSimultaneousTileLoads("cesium:maximumSimultaneousTileLoads", TfToken::Immortal),
cesiumMaximumTextureSize("cesium:maximumTextureSize", TfToken::Immortal),
cesiumMaximumZoomLevel("cesium:maximumZoomLevel", TfToken::Immortal),
cesiumMinimumLevel("cesium:minimumLevel", TfToken::Immortal),
cesiumMinimumZoomLevel("cesium:minimumZoomLevel", TfToken::Immortal),
cesiumNorth("cesium:north", TfToken::Immortal),
cesiumOverlayRenderMethod("cesium:overlayRenderMethod", TfToken::Immortal),
cesiumPreloadAncestors("cesium:preloadAncestors", TfToken::Immortal),
cesiumPreloadSiblings("cesium:preloadSiblings", TfToken::Immortal),
cesiumProjectDefaultIonAccessToken("cesium:projectDefaultIonAccessToken", TfToken::Immortal),
cesiumProjectDefaultIonAccessTokenId("cesium:projectDefaultIonAccessTokenId", TfToken::Immortal),
cesiumRasterOverlayBinding("cesium:rasterOverlayBinding", TfToken::Immortal),
cesiumRootTilesX("cesium:rootTilesX", TfToken::Immortal),
cesiumRootTilesY("cesium:rootTilesY", TfToken::Immortal),
cesiumSelectedIonServer("cesium:selectedIonServer", TfToken::Immortal),
cesiumShowCreditsOnScreen("cesium:showCreditsOnScreen", TfToken::Immortal),
cesiumSmoothNormals("cesium:smoothNormals", TfToken::Immortal),
cesiumSourceType("cesium:sourceType", TfToken::Immortal),
cesiumSouth("cesium:south", TfToken::Immortal),
cesiumSpecifyTileMatrixSetLabels("cesium:specifyTileMatrixSetLabels", TfToken::Immortal),
cesiumSpecifyTilingScheme("cesium:specifyTilingScheme", TfToken::Immortal),
cesiumSpecifyZoomLevels("cesium:specifyZoomLevels", TfToken::Immortal),
cesiumStyle("cesium:style", TfToken::Immortal),
cesiumSubTileCacheBytes("cesium:subTileCacheBytes", TfToken::Immortal),
cesiumSuspendUpdate("cesium:suspendUpdate", TfToken::Immortal),
cesiumTileHeight("cesium:tileHeight", TfToken::Immortal),
cesiumTileMatrixSetId("cesium:tileMatrixSetId", TfToken::Immortal),
cesiumTileMatrixSetLabelPrefix("cesium:tileMatrixSetLabelPrefix", TfToken::Immortal),
cesiumTileMatrixSetLabels("cesium:tileMatrixSetLabels", TfToken::Immortal),
cesiumTileWidth("cesium:tileWidth", TfToken::Immortal),
cesiumUrl("cesium:url", TfToken::Immortal),
cesiumUseWebMercatorProjection("cesium:useWebMercatorProjection", TfToken::Immortal),
cesiumWest("cesium:west", TfToken::Immortal),
clip("clip", TfToken::Immortal),
ion("ion", TfToken::Immortal),
overlay("overlay", TfToken::Immortal),
url("url", TfToken::Immortal),
allTokens({
cesiumAlpha,
cesiumAnchorAdjustOrientationForGlobeWhenMoving,
cesiumAnchorDetectTransformChanges,
cesiumAnchorGeoreferenceBinding,
cesiumAnchorHeight,
cesiumAnchorLatitude,
cesiumAnchorLongitude,
cesiumAnchorPosition,
cesiumBaseUrl,
cesiumCartographicPolygonBinding,
cesiumCulledScreenSpaceError,
cesiumDebugDisableGeometryPool,
cesiumDebugDisableGeoreferencing,
cesiumDebugDisableMaterialPool,
cesiumDebugDisableMaterials,
cesiumDebugDisableTexturePool,
cesiumDebugDisableTextures,
cesiumDebugGeometryPoolInitialCapacity,
cesiumDebugMaterialPoolInitialCapacity,
cesiumDebugRandomColors,
cesiumDebugTexturePoolInitialCapacity,
cesiumDisplayName,
cesiumEast,
cesiumEcefToUsdTransform,
cesiumEnableFogCulling,
cesiumEnableFrustumCulling,
cesiumEnforceCulledScreenSpaceError,
cesiumExcludeSelectedTiles,
cesiumForbidHoles,
cesiumFormat,
cesiumGeoreferenceBinding,
cesiumGeoreferenceOriginHeight,
cesiumGeoreferenceOriginLatitude,
cesiumGeoreferenceOriginLongitude,
cesiumInvertSelection,
cesiumIonAccessToken,
cesiumIonAssetId,
cesiumIonServerApiUrl,
cesiumIonServerApplicationId,
cesiumIonServerBinding,
cesiumIonServerUrl,
cesiumLayer,
cesiumLayers,
cesiumLoadingDescendantLimit,
cesiumMainThreadLoadingTimeLimit,
cesiumMaximumCachedBytes,
cesiumMaximumLevel,
cesiumMaximumScreenSpaceError,
cesiumMaximumSimultaneousTileLoads,
cesiumMaximumTextureSize,
cesiumMaximumZoomLevel,
cesiumMinimumLevel,
cesiumMinimumZoomLevel,
cesiumNorth,
cesiumOverlayRenderMethod,
cesiumPreloadAncestors,
cesiumPreloadSiblings,
cesiumProjectDefaultIonAccessToken,
cesiumProjectDefaultIonAccessTokenId,
cesiumRasterOverlayBinding,
cesiumRootTilesX,
cesiumRootTilesY,
cesiumSelectedIonServer,
cesiumShowCreditsOnScreen,
cesiumSmoothNormals,
cesiumSourceType,
cesiumSouth,
cesiumSpecifyTileMatrixSetLabels,
cesiumSpecifyTilingScheme,
cesiumSpecifyZoomLevels,
cesiumStyle,
cesiumSubTileCacheBytes,
cesiumSuspendUpdate,
cesiumTileHeight,
cesiumTileMatrixSetId,
cesiumTileMatrixSetLabelPrefix,
cesiumTileMatrixSetLabels,
cesiumTileWidth,
cesiumUrl,
cesiumUseWebMercatorProjection,
cesiumWest,
clip,
ion,
overlay,
url
})
{
}
TfStaticData<CesiumTokensType> CesiumTokens;
PXR_NAMESPACE_CLOSE_SCOPE
| 9,367 | C++ | 49.913043 | 124 | 0.766094 |
CesiumGS/cesium-omniverse/src/plugins/CesiumUsdSchemas/src/CesiumUsdSchemas/moduleDeps.cpp | #include "pxr/pxr.h"
#include "pxr/base/tf/registryManager.h"
#include "pxr/base/tf/scriptModuleLoader.h"
#include "pxr/base/tf/token.h"
#include <vector>
PXR_NAMESPACE_OPEN_SCOPE
TF_REGISTRY_FUNCTION(TfScriptModuleLoader) {
// List of direct dependencies for this library.
const std::vector<TfToken> reqs = {
TfToken("sdf"),
TfToken("tf"),
TfToken("usd"),
TfToken("vt"),
TfToken("usdGeom"),
};
TfScriptModuleLoader::GetInstance().
RegisterLibrary(TfToken("CesiumUsdSchemas"), TfToken("cesium.usd.plugins.CesiumUsdSchemas"), reqs);
}
PXR_NAMESPACE_CLOSE_SCOPE
| 628 | C++ | 25.208332 | 107 | 0.675159 |
CesiumGS/cesium-omniverse/src/public/CesiumOmniverse.cpp | #define CARB_EXPORTS
#include "cesium/omniverse/CesiumOmniverse.h"
#include "cesium/omniverse/AssetRegistry.h"
#include "cesium/omniverse/CesiumIonServerManager.h"
#include "cesium/omniverse/CesiumIonSession.h"
#include "cesium/omniverse/Context.h"
#include "cesium/omniverse/FabricUtil.h"
#include "cesium/omniverse/OmniData.h"
#include "cesium/omniverse/OmniIonServer.h"
#include "cesium/omniverse/OmniTileset.h"
#include "cesium/omniverse/UsdUtil.h"
#include "cesium/omniverse/Viewport.h"
#include <CesiumGeospatial/Cartographic.h>
#include <CesiumUtility/CreditSystem.h>
#include <carb/PluginUtils.h>
#include <omni/fabric/IFabric.h>
#include <omni/kit/IApp.h>
#include <gsl/span>
namespace cesium::omniverse {
class CesiumOmniversePlugin final : public ICesiumOmniverseInterface {
protected:
void onStartup(const char* cesiumExtensionLocation) noexcept override {
_pContext = std::make_unique<Context>(cesiumExtensionLocation);
}
void onShutdown() noexcept override {
_pContext = nullptr;
}
void reloadTileset(const char* tilesetPath) noexcept override {
const auto pTileset = _pContext->getAssetRegistry().getTileset(pxr::SdfPath(tilesetPath));
if (pTileset) {
pTileset->reload();
}
}
void onUpdateFrame(const ViewportApi* viewports, uint64_t count, bool waitForLoadingTiles) noexcept override {
const auto span = gsl::span<const Viewport>(reinterpret_cast<const Viewport*>(viewports), count);
_pContext->onUpdateFrame(span, waitForLoadingTiles);
}
void onUsdStageChanged(long stageId) noexcept override {
_pContext->onUsdStageChanged(stageId);
}
void connectToIon() noexcept override {
_pContext->getCesiumIonServerManager().connectToIon();
}
std::optional<std::shared_ptr<CesiumIonSession>> getSession() noexcept override {
return _pContext->getCesiumIonServerManager().getCurrentIonSession();
}
std::string getServerPath() noexcept override {
const auto pIonServer = _pContext->getCesiumIonServerManager().getCurrentIonServer();
if (!pIonServer) {
return "";
}
return pIonServer->getPath().GetString();
}
std::vector<std::shared_ptr<CesiumIonSession>> getSessions() noexcept override {
const auto& ionServers = _pContext->getAssetRegistry().getIonServers();
std::vector<std::shared_ptr<CesiumIonSession>> result;
result.reserve(ionServers.size());
for (const auto& pIonServer : ionServers) {
result.push_back(pIonServer->getSession());
}
return result;
}
std::vector<std::string> getServerPaths() noexcept override {
const auto& ionServers = _pContext->getAssetRegistry().getIonServers();
std::vector<std::string> result;
result.reserve(ionServers.size());
for (const auto& pIonServer : ionServers) {
result.push_back(pIonServer->getPath().GetString());
}
return result;
}
SetDefaultTokenResult getSetDefaultTokenResult() noexcept override {
return _pContext->getCesiumIonServerManager().getSetDefaultTokenResult();
}
bool isDefaultTokenSet() noexcept override {
return _pContext->getCesiumIonServerManager().isDefaultTokenSet();
}
void createToken(const char* name) noexcept override {
_pContext->getCesiumIonServerManager().createToken(name);
}
void selectToken(const char* id, const char* token) noexcept override {
CesiumIonClient::Token t{id, "", token};
_pContext->getCesiumIonServerManager().selectToken(t);
}
void specifyToken(const char* token) noexcept override {
_pContext->getCesiumIonServerManager().specifyToken(token);
}
std::optional<AssetTroubleshootingDetails> getAssetTroubleshootingDetails() noexcept override {
return _pContext->getCesiumIonServerManager().getAssetTroubleshootingDetails();
}
std::optional<TokenTroubleshootingDetails> getAssetTokenTroubleshootingDetails() noexcept override {
return _pContext->getCesiumIonServerManager().getAssetTokenTroubleshootingDetails();
}
std::optional<TokenTroubleshootingDetails> getDefaultTokenTroubleshootingDetails() noexcept override {
return _pContext->getCesiumIonServerManager().getDefaultTokenTroubleshootingDetails();
}
void updateTroubleshootingDetails(
const char* tilesetPath,
int64_t tilesetIonAssetId,
uint64_t tokenEventId,
uint64_t assetEventId) noexcept override {
return _pContext->getCesiumIonServerManager().updateTroubleshootingDetails(
pxr::SdfPath(tilesetPath), tilesetIonAssetId, tokenEventId, assetEventId);
}
void updateTroubleshootingDetails(
const char* tilesetPath,
int64_t tilesetIonAssetId,
int64_t rasterOverlayIonAssetId,
uint64_t tokenEventId,
uint64_t assetEventId) noexcept override {
return _pContext->getCesiumIonServerManager().updateTroubleshootingDetails(
pxr::SdfPath(tilesetPath), tilesetIonAssetId, rasterOverlayIonAssetId, tokenEventId, assetEventId);
}
std::string printFabricStage() noexcept override {
return FabricUtil::printFabricStage(_pContext->getFabricStage());
}
RenderStatistics getRenderStatistics() noexcept override {
return _pContext->getRenderStatistics();
}
bool creditsAvailable() noexcept override {
return _pContext->getCreditSystem()->getCreditsToShowThisFrame().size() > 0;
}
std::vector<std::pair<std::string, bool>> getCredits() noexcept override {
const auto& pCreditSystem = _pContext->getCreditSystem();
const auto& credits = pCreditSystem->getCreditsToShowThisFrame();
std::vector<std::pair<std::string, bool>> result;
result.reserve(credits.size());
for (const auto& item : credits) {
const auto showOnScreen = pCreditSystem->shouldBeShownOnScreen(item);
result.emplace_back(pCreditSystem->getHtml(item), showOnScreen);
}
return result;
}
void creditsStartNextFrame() noexcept override {
return _pContext->getCreditSystem()->startNextFrame();
}
bool isTracingEnabled() noexcept override {
#if CESIUM_TRACING_ENABLED
return true;
#else
return false;
#endif
}
void clearAccessorCache() override {
_pContext->clearAccessorCache();
}
private:
std::unique_ptr<Context> _pContext;
};
} // namespace cesium::omniverse
const struct carb::PluginImplDesc pluginImplDesc = {
"cesium.omniverse.plugin",
"Cesium Omniverse Carbonite Plugin.",
"Cesium",
carb::PluginHotReload::eDisabled,
"dev"};
#ifdef CESIUM_OMNI_CLANG
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
#endif
CARB_PLUGIN_IMPL(pluginImplDesc, cesium::omniverse::CesiumOmniversePlugin)
CARB_PLUGIN_IMPL_DEPS(omni::fabric::IFabric, omni::kit::IApp, carb::settings::ISettings)
#ifdef CESIUM_OMNI_CLANG
#pragma clang diagnostic pop
#endif
void fillInterface([[maybe_unused]] cesium::omniverse::CesiumOmniversePlugin& iface) {}
| 7,245 | C++ | 32.391705 | 114 | 0.704348 |
CesiumGS/cesium-omniverse/exts/cesium.powertools/cesium/powertools/extension.py | from functools import partial
import asyncio
from typing import Optional, List
import logging
import omni.ext
import omni.ui as ui
import omni.kit.ui
from .powertools_window import CesiumPowertoolsWindow
from cesium.omniverse.utils import wait_n_frames, dock_window_async
from cesium.omniverse.install import WheelInfo, WheelInstaller
class CesiumPowertoolsExtension(omni.ext.IExt):
def __init__(self):
super().__init__()
self._logger = logging.getLogger(__name__)
self._powertools_window: Optional[CesiumPowertoolsWindow] = None
self._install_py_dependencies()
def on_startup(self):
self._logger.info("Starting Cesium Power Tools...")
self._setup_menus()
self._show_and_dock_startup_windows()
def on_shutdown(self):
self._destroy_powertools_window()
def _setup_menus(self):
ui.Workspace.set_show_window_fn(
CesiumPowertoolsWindow.WINDOW_NAME, partial(self._show_powertools_window, None)
)
editor_menu = omni.kit.ui.get_editor_menu()
if editor_menu:
editor_menu.add_item(
CesiumPowertoolsWindow.MENU_PATH, self._show_powertools_window, toggle=True, value=True
)
def _show_and_dock_startup_windows(self):
ui.Workspace.show_window(CesiumPowertoolsWindow.WINDOW_NAME)
asyncio.ensure_future(dock_window_async(self._powertools_window, target="Property"))
def _destroy_powertools_window(self):
if self._powertools_window is not None:
self._powertools_window.destroy()
self._powertools_window = None
async def _destroy_window_async(self, path):
# Wait one frame, this is due to the one frame defer in Window::_moveToMainOSWindow()
await wait_n_frames(1)
if path is CesiumPowertoolsWindow.MENU_PATH:
self._destroy_powertools_window()
def _visibility_changed_fn(self, path, visible):
editor_menu = omni.kit.ui.get_editor_menu()
if editor_menu:
editor_menu.set_value(path, visible)
if not visible:
asyncio.ensure_future(self._destroy_window_async(path))
def _show_powertools_window(self, _menu, value):
if value:
self._powertools_window = CesiumPowertoolsWindow(width=300, height=400)
self._powertools_window.set_visibility_changed_fn(
partial(self._visibility_changed_fn, CesiumPowertoolsWindow.MENU_PATH)
)
elif self._powertools_window is not None:
self._powertools_window.visible = False
def _install_py_dependencies(self):
vendor_wheels: List[WheelInfo] = [
WheelInfo(
module="pyproj",
windows_whl="pyproj-3.6.0-cp310-cp310-win_amd64.whl",
linux_x64_whl="pyproj-3.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
linux_aarch_whl="pyproj-3.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
)
]
for w in vendor_wheels:
installer = WheelInstaller(w, extension_module="cesium.powertools")
if not installer.install():
self._logger.error(f"Could not install wheel for {w.module}")
| 3,271 | Python | 34.565217 | 108 | 0.646897 |
CesiumGS/cesium-omniverse/exts/cesium.powertools/cesium/powertools/__init__.py | from .extension import * # noqa: F401 F403
| 44 | Python | 21.499989 | 43 | 0.704545 |
CesiumGS/cesium-omniverse/exts/cesium.powertools/cesium/powertools/powertools_window.py | import logging
import omni.ui as ui
from typing import Callable, Optional, List
from cesium.omniverse.ui import CesiumOmniverseDebugWindow
from .georefhelper.georef_helper_window import CesiumGeorefHelperWindow
from .utils import (
extend_far_plane,
save_carb_settings,
save_fabric_stage,
set_sunstudy_from_georef,
)
import os
from functools import partial
from .benchmarking.load_timer_window import CesiumLoadTimerWindow
powertools_extension_location = os.path.join(os.path.dirname(__file__), "../../")
class PowertoolsAction:
def __init__(self, title: str, action: Callable):
self._title = title
self._action = action
self._button: Optional[ui.Button] = None
def destroy(self):
if self._button is not None:
self._button.destroy()
self._button = None
def button(self):
if self._button is None:
self._button = ui.Button(self._title, height=0, clicked_fn=self._action)
return self._button
class CesiumPowertoolsWindow(ui.Window):
WINDOW_NAME = "Cesium Power Tools"
MENU_PATH = f"Window/Cesium/{WINDOW_NAME}"
def __init__(self, **kwargs):
super().__init__(CesiumPowertoolsWindow.WINDOW_NAME, **kwargs)
self._logger = logging.getLogger(__name__)
# You do not necessarily need to create an action function in this window class. If you have a function
# in another window or class, you can absolutely call that instead from here.
self._actions: List[PowertoolsAction] = [
PowertoolsAction("Open Cesium Debugging Window", CesiumOmniverseDebugWindow.show_window),
PowertoolsAction("Open Cesium Georeference Helper Window", CesiumGeorefHelperWindow.create_window),
PowertoolsAction("Open Cesium Load Timer Window", CesiumLoadTimerWindow.create_window),
PowertoolsAction("Extend Far Plane", extend_far_plane),
PowertoolsAction("Save Carb Settings", partial(save_carb_settings, powertools_extension_location)),
PowertoolsAction("Save Fabric Stage", partial(save_fabric_stage, powertools_extension_location)),
PowertoolsAction("Set Sun Study from Georef", set_sunstudy_from_georef),
]
self.frame.set_build_fn(self._build_fn)
def destroy(self) -> None:
for action in self._actions:
action.destroy()
self._actions.clear()
super().destroy()
def _build_fn(self):
with ui.ScrollingFrame():
with ui.VStack(spacing=4):
for action in self._actions:
action.button()
| 2,623 | Python | 35.444444 | 111 | 0.666794 |
CesiumGS/cesium-omniverse/exts/cesium.powertools/cesium/powertools/benchmarking/load_timer_window.py | import logging
import omni.ui as ui
import carb.events
import omni.kit.app as app
from typing import List
from cesium.omniverse.ui.models.space_delimited_number_model import SpaceDelimitedNumberModel
from cesium.omniverse.utils.cesium_interface import CesiumInterfaceManager
from datetime import datetime
from cesium.omniverse.usdUtils import get_tileset_paths
class CesiumLoadTimerWindow(ui.Window):
WINDOW_NAME = "Cesium Load Timer"
_logger: logging.Logger
_last_tiles_loading_worker = 0
def __init__(self, **kwargs):
super().__init__(CesiumLoadTimerWindow.WINDOW_NAME, **kwargs)
self._logger = logging.getLogger(__name__)
self._timer_active = False
self._tiles_loading_worker_model: SpaceDelimitedNumberModel = SpaceDelimitedNumberModel(0)
self._load_time_seconds_model: SpaceDelimitedNumberModel = SpaceDelimitedNumberModel(0)
self._past_results_model: ui.SimpleStringModel = ui.SimpleStringModel("")
self._subscriptions: List[carb.events.ISubscription] = []
self._setup_subscriptions()
# Set the function that is called to build widgets when the window is visible
self.frame.set_build_fn(self._build_fn)
self.set_visibility_changed_fn(self._visibility_changed_fn)
def destroy(self):
self._remove_subscriptions()
super().destroy()
def __del__(self):
self.destroy()
def _visibility_changed_fn(self, visible):
if not visible:
self._remove_subscriptions()
def _setup_subscriptions(self):
update_stream = app.get_app().get_update_event_stream()
self._subscriptions.append(
update_stream.create_subscription_to_pop(self._on_update_frame, name="on_update_frame")
)
def _remove_subscriptions(self):
for subscription in self._subscriptions:
subscription.unsubscribe()
self._subscriptions.clear()
def _on_update_frame(self, _e: carb.events.IEvent):
if not self.visible or not self._timer_active:
return
with CesiumInterfaceManager() as interface:
render_statistics = interface.get_render_statistics()
# Loading worker count has changed from last frame, so update the timer
if render_statistics.tiles_loading_worker != self._last_tiles_loading_worker:
# Register a new end-time and calculate the total elapsed time in seconds
self._end_time = datetime.now()
time_elapsed = self._end_time - self._start_time
self._load_time_seconds_model.set_value(time_elapsed.total_seconds())
# If 30 sucessive frames with zero tiles loading occurs, we assume loading has finished
if render_statistics.tiles_loading_worker == 0:
self._zero_counter += 1
if self._zero_counter >= 30:
self._end_load_timer() # Cancel the timer after 30 successful 0 tile frames
else:
self._zero_counter = 0
# Store the number of tile workers for use in the next update cycle
self._last_tiles_loading_worker = render_statistics.tiles_loading_worker
self._tiles_loading_worker_model.set_value(render_statistics.tiles_loading_worker)
def _start_load_timer(self):
self._start_time = datetime.now()
self._end_time = datetime.now()
self._timer_active = True
self._zero_counter = 0
with CesiumInterfaceManager() as interface:
tileset_paths = get_tileset_paths()
for tileset_path in tileset_paths:
interface.reload_tileset(tileset_path)
def _end_load_timer(self):
self._timer_active = False
result_str = f"{self._load_time_seconds_model}\n" + self._past_results_model.get_value_as_string()
self._past_results_model.set_value(result_str)
@staticmethod
def create_window():
return CesiumLoadTimerWindow(width=300, height=370)
def _build_fn(self):
"""Builds out the UI"""
with ui.VStack(spacing=4):
ui.Label(
"This tool records the amount of time taken to reload all tilesets in the stage",
word_wrap=True,
)
def reload_all_tilesets():
self._start_load_timer()
ui.Button("Reload all Tilesets", height=20, clicked_fn=reload_all_tilesets)
ui.Label(
"The timer automatically completes when no tiles are queued to load for 30 successive frames",
word_wrap=True,
)
for label, model in [
("Tiles loading (worker)", self._tiles_loading_worker_model),
("Load time (s)", self._load_time_seconds_model),
]:
with ui.HStack(height=0):
ui.Label(label, height=0)
ui.StringField(model=model, height=0, read_only=True)
ui.Label("Past results:", height=0)
ui.StringField(model=self._past_results_model, multiline=True, height=150)
| 5,135 | Python | 36.764706 | 110 | 0.627653 |
CesiumGS/cesium-omniverse/exts/cesium.powertools/cesium/powertools/georefhelper/georef_helper_window.py | import logging
import omni.ui as ui
import omni.usd
from .proj import epsg_to_ecef, epsg_to_wgs84, get_crs_name_from_epsg
import math
from cesium.omniverse.utils.custom_fields import string_field_with_label, int_field_with_label, float_field_with_label
from pxr import Sdf
class CesiumGeorefHelperWindow(ui.Window):
WINDOW_NAME = "Cesium Georeference Helper"
_logger: logging.Logger
def __init__(self, **kwargs):
super().__init__(CesiumGeorefHelperWindow.WINDOW_NAME, **kwargs)
self._logger = logging.getLogger(__name__)
# Set the function that is called to build widgets when the window is visible
self.frame.set_build_fn(self._build_fn)
def destroy(self):
# It will destroy all the children
super().destroy()
def __del__(self):
self.destroy()
@staticmethod
def create_window():
return CesiumGeorefHelperWindow(width=250, height=600)
def _convert_coordinates(self):
# Get the CRS and check if it is valid, adjust UI values accordingly
crs = get_crs_name_from_epsg(self._epsg_model.get_value_as_int())
if crs is None:
self._epsg_name_model.set_value("Invalid EPSG Code")
self._wgs84_latitude_model.set_value(math.nan)
self._wgs84_longitude_model.set_value(math.nan)
self._wgs84_height_model.set_value(math.nan)
self._ecef_x_model.set_value(math.nan)
self._ecef_y_model.set_value(math.nan)
self._ecef_z_model.set_value(math.nan)
return
self._epsg_name_model.set_value(crs)
# Convert coords to WGS84 and set in UI
wgs84_coords = epsg_to_wgs84(
self._epsg_model.as_string,
self._easting_model.as_float,
self._northing_model.as_float,
self._elevation_model.as_float,
)
self._wgs84_latitude_model.set_value(wgs84_coords[0])
self._wgs84_longitude_model.set_value(wgs84_coords[1])
self._wgs84_height_model.set_value(wgs84_coords[2])
# Convert coords to ECEF and set in UI
ecef_coords = epsg_to_ecef(
self._epsg_model.as_string,
self._easting_model.as_float,
self._northing_model.as_float,
self._elevation_model.as_float,
)
self._ecef_x_model.set_value(ecef_coords[0])
self._ecef_y_model.set_value(ecef_coords[1])
self._ecef_z_model.set_value(ecef_coords[2])
def _set_georeference_prim(self):
if math.isnan(self._wgs84_latitude_model.get_value_as_float()):
self._logger.warning("Cannot set CesiumGeoreference to NaN")
return
stage = omni.usd.get_context().get_stage()
cesium_prim = stage.GetPrimAtPath("/CesiumGeoreference")
cesium_prim.GetAttribute("cesium:georeferenceOrigin:latitude").Set(
self._wgs84_latitude_model.get_value_as_float()
)
cesium_prim.GetAttribute("cesium:georeferenceOrigin:longitude").Set(
self._wgs84_longitude_model.get_value_as_float()
)
cesium_prim.GetAttribute("cesium:georeferenceOrigin:height").Set(
self._wgs84_height_model.get_value_as_float()
)
@staticmethod
def set_georef_from_environment():
stage = omni.usd.get_context().get_stage()
environment_prim = stage.GetPrimAtPath("/Environment")
cesium_prim = stage.GetPrimAtPath("/CesiumGeoreference")
lat_attr = environment_prim.GetAttribute("location:latitude")
long_attr = environment_prim.GetAttribute("location:longitude")
if lat_attr and long_attr:
cesium_prim.GetAttribute("cesium:georeferenceOrigin:latitude").Set(lat_attr.Get())
cesium_prim.GetAttribute("cesium:georeferenceOrigin:longitude").Set(long_attr.Get())
cesium_prim.GetAttribute("cesium:georeferenceOrigin:height").Set(0.0)
else:
logger = logging.getLogger(__name__)
logger.warning(
"Cannot set CesiumGeoreference as environment prim does not have latitude or longitude attributes"
)
@staticmethod
def set_georef_from_anchor():
logger = logging.getLogger(__name__)
stage = omni.usd.get_context().get_stage()
cesium_prim = stage.GetPrimAtPath("/CesiumGeoreference")
if not cesium_prim.IsValid():
logger.error("No CesiumGeoreference found")
return
selection = omni.usd.get_context().get_selection().get_selected_prim_paths()
for prim_path in selection:
prim = stage.GetPrimAtPath(prim_path)
latitude = prim.GetAttribute("cesium:anchor:latitude").Get()
longitude = prim.GetAttribute("cesium:anchor:longitude").Get()
height = prim.GetAttribute("cesium:anchor:height").Get()
if latitude is not None and longitude is not None and height is not None:
cesium_prim.GetAttribute("cesium:georeferenceOrigin:latitude").Set(latitude)
cesium_prim.GetAttribute("cesium:georeferenceOrigin:longitude").Set(longitude)
cesium_prim.GetAttribute("cesium:georeferenceOrigin:height").Set(height)
return
logger.error("Please select a prim with a globe anchor")
def _build_fn(self):
"""Builds out the UI buttons and their handlers."""
with ui.VStack(spacing=4):
label_style = {"Label": {"font_size": 16}}
ui.Label(
"Enter coordinates in any EPSG CRS to convert them to ECEF and WGS84",
word_wrap=True,
style=label_style,
)
ui.Spacer(height=10)
ui.Label("Your Project Details:", style=label_style)
# TODO: Precision issues to resolve
def on_coordinate_update(event):
self._convert_coordinates()
# Define the SimpleValueModels for the UI
self._epsg_model = ui.SimpleIntModel(28356)
self._epsg_name_model = ui.SimpleStringModel("")
self._easting_model = ui.SimpleFloatModel(503000.0)
self._northing_model = ui.SimpleFloatModel(6950000.0)
self._elevation_model = ui.SimpleFloatModel(0.0)
# Add the value changed callbacks
self._epsg_model.add_value_changed_fn(on_coordinate_update)
self._easting_model.add_value_changed_fn(on_coordinate_update)
self._northing_model.add_value_changed_fn(on_coordinate_update)
self._elevation_model.add_value_changed_fn(on_coordinate_update)
# TODO: Make EPSG an autocomplete field
int_field_with_label("EPSG Code", model=self._epsg_model)
string_field_with_label("EPSG Name", model=self._epsg_name_model, enabled=False)
float_field_with_label("Easting / X", model=self._easting_model)
float_field_with_label("Northing / Y", model=self._northing_model)
float_field_with_label("Elevation / Z", model=self._elevation_model)
ui.Spacer(height=10)
# TODO: It would be nice to be able to copy these fields, or potentially have two way editing
ui.Label("WGS84 Results:", style=label_style)
self._wgs84_latitude_model = ui.SimpleFloatModel(0.0)
self._wgs84_longitude_model = ui.SimpleFloatModel(0.0)
self._wgs84_height_model = ui.SimpleFloatModel(0.0)
float_field_with_label("Latitude", model=self._wgs84_latitude_model, enabled=False)
float_field_with_label("Longitude", model=self._wgs84_longitude_model, enabled=False)
float_field_with_label("Elevation", model=self._wgs84_height_model, enabled=False)
ui.Spacer(height=10)
ui.Label("ECEF Results:", style=label_style)
self._ecef_x_model = ui.SimpleFloatModel(0.0)
self._ecef_y_model = ui.SimpleFloatModel(0.0)
self._ecef_z_model = ui.SimpleFloatModel(0.0)
float_field_with_label("X", model=self._ecef_x_model, enabled=False)
float_field_with_label("Y", model=self._ecef_y_model, enabled=False)
float_field_with_label("Z", model=self._ecef_z_model, enabled=False)
ui.Button("Set Georeference from EPSG", height=20, clicked_fn=self._set_georeference_prim)
ui.Button(
"Set Georeference from Environment Prim", height=20, clicked_fn=self.set_georef_from_environment
)
ui.Button("Set Georef from Selected Anchor", height=20, clicked_fn=self.set_georef_from_anchor)
# Do the first conversion
self._convert_coordinates()
| 8,726 | Python | 41.15942 | 118 | 0.628467 |
CesiumGS/cesium-omniverse/exts/cesium.powertools/cesium/powertools/georefhelper/proj.py | ECEF_EPSG = 4978
WGS84_EPSG = 4979
def get_crs_name_from_epsg(epsg_code):
import pyproj
try:
return pyproj.crs.CRS.from_epsg(epsg_code).name
except pyproj.exceptions.CRSError:
return None
def epsg_to_epsg(from_epsg, to_epsg, x, y, z):
import pyproj
from_crs = pyproj.crs.CRS.from_epsg(from_epsg)
to_crs = pyproj.crs.CRS.from_epsg(to_epsg)
# Define the from and to coordinate systems
transformer = pyproj.Transformer.from_crs(from_crs, to_crs)
# Convert ECEF coordinates to longitude, latitude, and height
lat, lon, height = transformer.transform(x, y, z)
return lat, lon, height
def epsg_to_wgs84(from_epsg, x, y, z):
return epsg_to_epsg(from_epsg, WGS84_EPSG, x, y, z)
def epsg_to_ecef(from_epsg, x, y, z):
return epsg_to_epsg(from_epsg, ECEF_EPSG, x, y, z)
def ecef_to_wgs84(x, y, z):
return epsg_to_epsg(ECEF_EPSG, WGS84_EPSG, x, y, z)
def wgs84_to_ecef(x, y, z):
return epsg_to_epsg(WGS84_EPSG, ECEF_EPSG, x, y, z)
| 1,012 | Python | 22.558139 | 65 | 0.658103 |
CesiumGS/cesium-omniverse/exts/cesium.powertools/cesium/powertools/utils/__init__.py | from .utils import * # noqa: F401 F403
| 40 | Python | 19.49999 | 39 | 0.675 |
CesiumGS/cesium-omniverse/exts/cesium.powertools/cesium/powertools/utils/utils.py | import logging
import omni.usd
from omni.kit.viewport.utility import get_active_viewport
from pxr import Gf, UsdGeom, Sdf
import json
import carb.settings
import os
from cesium.omniverse.utils.cesium_interface import CesiumInterfaceManager
from asyncio import ensure_future
# Modified version of ScopedEdit in _build_viewport_cameras in omni.kit.widget.viewport
class ScopedEdit:
def __init__(self, stage):
self.__stage = stage
edit_target = stage.GetEditTarget()
edit_layer = edit_target.GetLayer()
self.__edit_layer = stage.GetSessionLayer()
self.__was_editable = self.__edit_layer.permissionToEdit
if not self.__was_editable:
self.__edit_layer.SetPermissionToEdit(True)
if self.__edit_layer != edit_layer:
stage.SetEditTarget(self.__edit_layer)
self.__edit_target = edit_target
else:
self.__edit_target = None
def __del__(self):
if self.__edit_layer and not self.__was_editable:
self.__edit_layer.SetPermissionToEdit(False)
self.__edit_layer = None
if self.__edit_target:
self.__stage.SetEditTarget(self.__edit_target)
self.__edit_target = None
def extend_far_plane():
stage = omni.usd.get_context().get_stage()
viewport = get_active_viewport()
camera_path = viewport.get_active_camera()
camera = UsdGeom.Camera.Get(stage, camera_path)
assert camera.GetPrim().IsValid()
scoped_edit = ScopedEdit(stage) # noqa: F841
camera.GetClippingRangeAttr().Set(Gf.Vec2f(1.0, 10000000000.0))
def save_carb_settings(powertools_extension_location: str):
carb_settings_path = os.path.join(powertools_extension_location, "carb_settings.txt")
with open(carb_settings_path, "w") as fh:
fh.write(json.dumps(carb.settings.get_settings().get("/"), indent=2))
def save_fabric_stage(powertools_extension_location: str):
with CesiumInterfaceManager() as interface:
fabric_stage_path = os.path.join(powertools_extension_location, "fabric_stage.txt")
with open(fabric_stage_path, "w") as fh:
fh.write(interface.print_fabric_stage())
# Helper function to search for an attribute on a prim, or create it if not present
def get_or_create_attribute(prim, name, type):
attribute = prim.GetAttribute(name)
if not attribute:
attribute = prim.CreateAttribute(name, type)
return attribute
def set_sunstudy_from_georef():
stage = omni.usd.get_context().get_stage()
environment_prim = stage.GetPrimAtPath("/Environment")
cesium_prim = stage.GetPrimAtPath("/CesiumGeoreference")
lat_attr = get_or_create_attribute(environment_prim, "location:latitude", Sdf.ValueTypeNames.Float)
lat_attr.Set(cesium_prim.GetAttribute("cesium:georeferenceOrigin:latitude").Get())
long_attr = get_or_create_attribute(environment_prim, "location:longitude", Sdf.ValueTypeNames.Float)
long_attr.Set(cesium_prim.GetAttribute("cesium:georeferenceOrigin:longitude").Get())
north_attr = get_or_create_attribute(environment_prim, "location:north_orientation", Sdf.ValueTypeNames.Float)
north_attr.Set(90.0) # Always set to 90, otherwise the sun is at the wrong angle
| 3,243 | Python | 37.164705 | 114 | 0.69411 |
CesiumGS/cesium-omniverse/exts/cesium.powertools/doc/README.md | # Cesium for Omniverse Power Tools
This extension provides supporting features and tools that may be useful while developing apps and stages using Cesium for Omniverse, but are provided **on an entirely your milage may vary** basis. All of these tools are considered experimental. If you like a particular tool in this extension, and would like to see it moved to the main Cesium for Omniverse extension, please [feel free to let us know on the Cesium for Omniverse forums](https://community.cesium.com/c/cesium-for-omniverse/14).
## Current Features
### Open Cesium Debugging Window
Easier and quicker way for opening the Cesium Debugging window.
## License
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html). Cesium for Omniverse is free for both commercial and non-commercial use.
| 800 | Markdown | 56.214282 | 495 | 0.78875 |
CesiumGS/cesium-omniverse/exts/cesium.powertools/config/extension.toml | [package]
version = "0.1.0"
category = "simulation"
feature = false
app = false
title = "Cesium for Omniverse Power Tools"
description = "Additional experimental helper features for Cesium for Omniverse."
authors = "Cesium GS Inc."
repository = "https://github.com/CesiumGS/cesium-omniverse"
keywords = [
"cesium",
"omniverse",
"geospatial",
"3D Tiles",
"glTF",
"globe",
"earth",
"simulation",
]
# Paths are relative to the extension folder
readme = "doc/README.md"
icon = "doc/resources/icon.png"
[dependencies]
"cesium.omniverse" = {}
[[python.module]]
name = "cesium.powertools"
[python.pipapi]
archiveDirs = ["vendor"]
| 659 | TOML | 18.999999 | 81 | 0.681335 |
CesiumGS/cesium-omniverse/exts/cesium.usd.plugins/cesium/usd/__init__.py | from .plugins import * # noqa: F401 F403
| 42 | Python | 20.49999 | 41 | 0.690476 |