Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

ShellImporter.h
00001 // Copyright (c) 1998-2014 by Tech Soft 3D, Inc.
00002 //
00003 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
00004 // and considered a trade secret as defined under civil and criminal statutes.
00005 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
00006 // unauthorized use or misappropriation of its trade secrets.  Use of this information
00007 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
00008 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
00009 
00010 #pragma once
00011 
00012 #include "SegmentOrganizer.h"
00013 #include "SmartSuRef.h"
00014 
00015 #include <HUtility.h>
00016 
00017 #include <slapi/model/entities.h>
00018 #include <slapi/model/face.h>
00019 #include <slapi/model/mesh_helper.h>
00020 
00021 #include <vector>
00022 
00023 #include "InheritanceManager.h"
00024 
00025 class ShellImporter
00026 {
00027 public:
00028     ShellImporter(TextureWriter& textureWriter, SegmentOrganizer& SegmentOrganizer, InheritanceManager& inheritanceManager, VisibilityChecker& visibilityChecker);
00029 
00030     bool Import(SUEntitiesRef& entities);
00031 
00032 private:
00033     ShellImporter(const ShellImporter&);
00034     ShellImporter& operator=(const ShellImporter&);
00035 
00036     bool ImportShell(SUFaceRef& suFace);
00037     bool GetFacesListAndPoints(SUMeshHelperRef& meshHelper, std::vector<int>& faces,
00038                                 std::vector<HPoint>& points);
00039     bool GetNormalVectors(SUMeshHelperRef& meshHelper, std::size_t numVertices,
00040                         std::vector<HVector>& normalVectors);
00041     bool GetVertexParameters(SUFaceRef& suFace, SUMeshHelperRef& meshHelper,
00042                             std::size_t numVertices, std::vector<float>& vertexParameters);
00043     bool InsertShell(SUFaceRef& suFace, const std::vector<HPoint>& points,
00044                     const std::vector<int>& faces, const std::vector<HVector>& normalVectors,
00045                     const std::vector<float>& vertexParameters, bool isVisible = true);
00046 
00047 private:
00048     static const std::size_t s_numParametersPerVertex = 3;
00049 
00050     TextureWriter&              m_textureWriter;
00051     InheritanceManager&         m_inheritanceManager;
00052     VisibilityChecker&          m_visibilityChecker;
00053     SegmentOrganizer& m_segmentOrganizer;
00054 };