Example #1
0
 public static void ModelRelease(
     ModelRef modelRef)
 {
     ThrowOut(
         SUModelRelease(
             ref modelRef.intPtr),
         "Could not release model.");
 }
 public static void ModelCreate(
     ModelRef modelRef)
 {
     ThrowOut(
         SUModelCreate(
             out modelRef.intPtr),
         "Could not create model.");
 }
Example #3
0
        private PenetrVueTask(Element element, Sp3dPenTask task)
        {
            if (task == null)
            {
                return;
            }

            initialize_(element);

            Oid = task.Oid;
            UID = task.UID;

            rawLocation_ = (!App.Point3dEqual(task.Location, App.Point3dZero()))
            ?  task.Location :  Cell.Origin;

            long activeModelRef = App.ActiveModelReference.MdlModelRefP();

            if (ModelRef.IsAttachmentOf(App.ActiveModelReference))
            {
                rawLocation_ = App.Point3dScale(rawLocation_, UOR.subPerMaster);
            }

            Rotation = task.Rotation;

            Code = task.Code;
            // разбор типоразмера:
            parseTypeSize(task.Name);

            if (task.XAttrDoc.Root.GetChild("P3DEquipment") != null)
            {
                TaskType = TaskTypeEnum.PipeEquipment;
            }
            else if (task.XAttrDoc.Root.GetChild("P3DHangerPipeSupport") != null &&
                     task.XAttrDoc.Root.GetChild("P3DHangerStdComponent") != null)
            {
                TaskType = TaskTypeEnum.PipeOld;
            }
            else
            {
                TaskType = TaskTypeEnum.Pipe;
            }

            if (TaskType == TaskTypeEnum.Pipe)
            {
                findFlanges();
            }
            else
            {
                findFlangesOld();
            }

            scanInfo();

            // важно в конце - после определения пересечений
            RefPoints[0] = Location;
        }
 public static void ModelSaveToFile(
     ModelRef modelRef,
     string name)
 {
     ThrowOut(
         SUModelSaveToFile(
             modelRef.intPtr,
             name),
         "Could not save model.");
 }
Example #5
0
 public static void ModelGetOptionsManager(
     ModelRef modelRef,
     OptionsManagerRef managerRef)
 {
     ThrowOut(
         SUModelGetOptionsManager(
             modelRef.intPtr,
             out managerRef.intPtr),
         "Could not get options manager.");
 }
Example #6
0
 public static void ModelGetNumComponentDefinitions(
     ModelRef modelRef,
     out long numDefinitions)
 {
     ThrowOut(
         SUModelGetNumComponentDefinitions(
             modelRef.intPtr,
             out numDefinitions),
         "Could not get number of definitions.");
 }
Example #7
0
 public static void ModelCreateFromFile(
     ModelRef modelRef,
     string name)
 {
     ThrowOut(
         SUModelCreateFromFile(
             out modelRef.intPtr,
             name),
         "Could not create model from file.");
 }
 public static void ModelGetCamera(
     ModelRef modelRef,
     CameraRef cameraRef)
 {
     ThrowOut(
         SUModelGetCamera(
             modelRef.intPtr,
             out cameraRef.intPtr),
         "Could not get camera.");
 }
 public static void ModelGetStyles(
     ModelRef modelRef,
     StylesRef stylesRef)
 {
     ThrowOut(
         SUModelGetStyles(
             modelRef.intPtr,
             out stylesRef.intPtr),
         "Could not get styles.");
 }
 public static void ModelGetEntities(
     ModelRef modelRef,
     EntitiesRef entitiesRef)
 {
     ThrowOut(
         SUModelGetEntities(
             modelRef.intPtr,
             out entitiesRef.intPtr),
         "Could not get model entities.");
 }
Example #11
0
 public static void ModelGetNumMaterials(
     ModelRef modelRef,
     out long numMaterials)
 {
     ThrowOut(
         SUModelGetNumMaterials(
             modelRef.intPtr,
             out numMaterials),
         "Could not get number of materials.");
 }
Example #12
0
        public void Init()
        {
            GameModel gameM = new GameModel();

            _gameModel = new ModelRef <GameModel>(gameM);
            Controller.Instantiate <GameController>(gameM, transform);


            UnityEngine.SceneManagement.SceneManager.LoadScene("login");
        }
Example #13
0
 public void EnemyTurn(BodyPart part)
 {
     if (!playerTurn)
     {
         ModelRef.DamagePlayer(part);
     }
     else
     {
         ModelRef.BlockEnemy(part);
     }
 }
            int version); // really an enum, not an int

        public static void ModelSaveToFileWithVersion(
            ModelRef modelRef,
            string name,
            int version)
        {
            ThrowOut(
                SUModelSaveToFileWithVersion(
                    modelRef.intPtr,
                    name, version),
                "Could not save model with version.");
        }
Example #15
0
        public void PlayerTurn(BodyPart part)
        {
            if (playerTurn)
            {
                ModelRef.DamageEnemy(part);
            }
            else
            {
                ModelRef.BlockPlayer(part);
            }

            EnemyTurn(EnemyDecision());
            playerTurn = !playerTurn;
            OnRaiseTurnEvent(new TurnEventArgs(playerTurn));
        }
        public static void ModelAddComponentDefinitions(
            ModelRef modelRef,
            long len,
            ComponentDefinitionRef[] componentDefRefs)
        {
            IntPtr[] intPtrs = new IntPtr[componentDefRefs.Length];

            for (int c = 0; c < intPtrs.Length; ++c)
            {
                intPtrs[c] = componentDefRefs[c].intPtr;
            }

            ThrowOut(
                SUModelAddComponentDefinitions(
                    modelRef.intPtr,
                    len, intPtrs),
                "Could not add definitions.");
        }
Example #17
0
        /// <summary>
        /// Handler for 0x14
        /// </summary>
        /// <param name="input"></param>
        /// <param name="name"></param>
        private ModelRef FragModelRef(BinaryReader input, string name)
        {
            var flags = input.ReadUInt32();

            // Skip this.
            input.ReadUInt32();

            var size1 = input.ReadUInt32();
            var size2 = input.ReadUInt32();

            // Skip this.
            input.ReadUInt32();

            if (0 != (flags & 1))
            {
                input.ReadUInt32();
            }

            if (0 != (flags & 2))
            {
                input.ReadUInt32();
            }

            for (var i = 0; i < size1; i++)
            {
                var e1size = input.ReadUInt32();
                var eldata = new float[e1size];

                for (var j = 0; j < e1size; j++)
                {
                    eldata[input.ReadUInt32()] = input.ReadSingle();
                }

                //var aaa = 1;
            }

            var frags3 = input.ReadInt32(size2);

            // A string, but it seems to be blank?  Skipping it anyway.
            input.ReadBytes(input.ReadInt32()).DecodeString();
            var aa = new ModelRef(name, GetFrag(frags3));

            return(aa);
        }
Example #18
0
        public static void ModelAddMaterials(
            ModelRef modelRef,
            long len,
            MaterialRef[] materialRefs)
        {
            IntPtr[] intPtrs = new IntPtr[materialRefs.Length];

            for (int i = 0; i < intPtrs.Length; ++i)
            {
                intPtrs[i] = materialRefs[i].intPtr;
            }

            ThrowOut(
                SUModelAddMaterials(
                    modelRef.intPtr,
                    len,
                    intPtrs),
                "Could not add materials.");
        }
Example #19
0
        public static void ModelGetMaterials(
            ModelRef modelRef,
            long numRequested,
            MaterialRef[] materialRefs,
            out long numReturned)
        {
            IntPtr[] intPtrs = new IntPtr[numRequested];

            ThrowOut(
                SUModelGetMaterials(
                    modelRef.intPtr,
                    numRequested,
                    intPtrs,
                    out numReturned),
                "Could not get materials.");

            for (int i = 0; i < numReturned; ++i)
            {
                materialRefs[i]        = new MaterialRef();
                materialRefs[i].intPtr = intPtrs[i];
            }
        }
Example #20
0
        public static void ModelGetComponentDefinitions(
            ModelRef modelRef,
            long numRequested,
            ComponentDefinitionRef[] componentDefinitionRefs,
            out long numReturned)
        {
            IntPtr[] intPtrs = new IntPtr[numRequested];

            ThrowOut(
                SUModelGetComponentDefinitions(
                    modelRef.intPtr,
                    numRequested,
                    intPtrs,
                    out numReturned),
                "Could not get component definitions.");

            for (int i = 0; i < numReturned; ++i)
            {
                componentDefinitionRefs[i]        = new ComponentDefinitionRef();
                componentDefinitionRefs[i].intPtr = intPtrs[i];
            }
        }
 public InfoPanelModel(IdentityModel _target)
 {
     target = new ModelRef <IdentityModel>(_target);
 }
Example #22
0
 public bool Equals(ModelRef other) =>
 !(other is null) &&