omni/connect/core/MeshAlgo.h

File members: omni/connect/core/MeshAlgo.h

// SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
//
// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
// property and proprietary rights in and to this material, related
// documentation and any modifications thereto. Any use, reproduction,
// disclosure or distribution of this material and related documentation
// without an express license agreement from NVIDIA CORPORATION or
// its affiliates is strictly prohibited.

#pragma once

#include "Api.h"
#include "PrimvarData.h"

#include <carb/cpp/Optional.h>

#include <pxr/base/gf/vec2f.h>
#include <pxr/base/gf/vec3f.h>
#include <pxr/base/vt/array.h>
#include <pxr/usd/sdf/path.h>
#include <pxr/usd/usd/prim.h>
#include <pxr/usd/usd/stage.h>
#include <pxr/usd/usdGeom/mesh.h>

namespace omni::connect::core
{

OMNICONNECTCORE_API pxr::UsdGeomMesh definePolyMesh(
    pxr::UsdStagePtr stage,
    const pxr::SdfPath& path,
    const pxr::VtIntArray& faceVertexCounts,
    const pxr::VtIntArray& faceVertexIndices,
    const pxr::VtVec3fArray& points,
    carb::cpp::optional<const Vec3fPrimvarData> normals = carb::cpp::nullopt,
    carb::cpp::optional<const Vec2fPrimvarData> uvs = carb::cpp::nullopt,
    carb::cpp::optional<const Vec3fPrimvarData> displayColor = carb::cpp::nullopt,
    carb::cpp::optional<const FloatPrimvarData> displayOpacity = carb::cpp::nullopt
);

OMNICONNECTCORE_API pxr::UsdGeomMesh definePolyMesh(
    pxr::UsdPrim parent,
    const std::string& name,
    const pxr::VtIntArray& faceVertexCounts,
    const pxr::VtIntArray& faceVertexIndices,
    const pxr::VtVec3fArray& points,
    carb::cpp::optional<const Vec3fPrimvarData> normals = carb::cpp::nullopt,
    carb::cpp::optional<const Vec2fPrimvarData> uvs = carb::cpp::nullopt,
    carb::cpp::optional<const Vec3fPrimvarData> displayColor = carb::cpp::nullopt,
    carb::cpp::optional<const FloatPrimvarData> displayOpacity = carb::cpp::nullopt
);

} // namespace omni::connect::core