Ejemplo n.º 1
0
        /// <summary>
        /// Get the Transform Graph for this model
        /// </summary>
        /// <returns>TransformGraph object</returns>
        public TransformGraph GetTransformGraph()
        {
            TransformGraph graph = null;

            if (!string.IsNullOrEmpty(ModelFileName))
            {
                //get the file name to store the geometry 
                string cacheFile = Path.ChangeExtension(ModelFileName, ".xbimGC");
                //if no Geometry file than create it
                if (!File.Exists(cacheFile)) GenerateGeometry(cacheFile);
                //now we have a file read it into the XbimSceneStream
                if (File.Exists(cacheFile))
                {
                    XbimSceneStream scene = new XbimSceneStream(Model, cacheFile);
                    graph = scene.Graph; //the graph holds product boundary box's so we will return it
                    scene.Close();
                }
            }
            return graph;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get the Transform Graph for this model
        /// </summary>
        /// <returns>TransformGraph object</returns>
        public TransformGraph GetTransformGraph()
        {
            TransformGraph graph = null;

            if (!string.IsNullOrEmpty(ModelFileName))
            {
                //get the file name to store the geometry
                string cacheFile = Path.ChangeExtension(ModelFileName, ".xbimGC");
                //if no Geometry file than create it
                if (!File.Exists(cacheFile))
                {
                    GenerateGeometry(cacheFile);
                }
                //now we have a file read it into the XbimSceneStream
                if (File.Exists(cacheFile))
                {
                    XbimSceneStream scene = new XbimSceneStream(Model, cacheFile);
                    graph = scene.Graph; //the graph holds product boundary box's so we will return it
                    scene.Close();
                }
            }
            return(graph);
        }