en:toolworks:docs:apparatus:detail

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:toolworks:docs:apparatus:detail [2021/06/11 13:57] vladiusen:toolworks:docs:apparatus:detail [2022/01/05 13:59] (current) – поправил пункты jispar
Line 1: Line 1:
 ====== Detail ====== ====== Detail ======
  
-Details are the main building data blocks in Apparatus. They are high-level entities (unlike Traits), which support some additional ECS+ functionality like multi-iterating and inheritance.+Details are the main building data blocks in Apparatus. They are high-level entities (unlike [[en:toolworks:docs:apparatus:trait|Traits]]), which support some additional ECS+ functionality like multi-iterating and inheritance.
  
-Details do derive from [[ue>API/Runtime/CoreUObject/UObject/UObject|UObject]] and are subject to garbage collecting and Unreal's general memory model.+Details do derive from [[ue>API/Runtime/CoreUObject/UObject/UObject|UObject]] and are subject to garbage collecting and Unreal's general memory model (unlike Traits which use their own memory organization). 
 + 
 +If you need to change some of the Detail members, you can do it *directly* via members' assignment or calling non-const Detail's methods. No need to re-apply or copy the Detail data again. 
 + 
 +As an optimization of some internal logic, Details can't really be removed from Subjectives. They can only be *disabled*. This is effectively the same thing as removal since [[en:toolworks:docs:apparatus:filter|Filters]] do respect this enabled/disabled state both in including and excluding contexts.
  
 ===== Creating Details ===== ===== Creating Details =====
Line 11: Line 15:
 In order to create a Detail visible in your C++ source code you have to do the following: In order to create a Detail visible in your C++ source code you have to do the following:
  
-- Open the main UE File menu and choose the "New C++ Class..." option: {{ :en:toolworks:docs:apparatus:ue-file-create-cpp-class.png?nolink |}}+  - Open the main UE File menu and choose the "New C++ Class..." option: {{ :en:toolworks:docs:apparatus:ue-file-create-cpp-class.png?nolink |}}
   - In the opened window mark the "Show All Classes" checkbox: {{ :en:toolworks:docs:apparatus:ue-add-show-all-cpp-classes.png?nolink |}}   - In the opened window mark the "Show All Classes" checkbox: {{ :en:toolworks:docs:apparatus:ue-add-show-all-cpp-classes.png?nolink |}}
   - Now you can select any of the base classes available including the Apparatus ones. Choose the Detail as a base class: {{ :en:toolworks:docs:apparatus:ue-create-cpp-detail.png?nolink |}}   - Now you can select any of the base classes available including the Apparatus ones. Choose the Detail as a base class: {{ :en:toolworks:docs:apparatus:ue-create-cpp-detail.png?nolink |}}
   - Click "Next" and you should see a name choosing dialog. Adjust the name of the class as needed and proceed by pressing the green "Create Class" button at the bottom: {{ :en:toolworks:docs:apparatus:ue-name-cpp-detail.png?nolink&600 |}}   - Click "Next" and you should see a name choosing dialog. Adjust the name of the class as needed and proceed by pressing the green "Create Class" button at the bottom: {{ :en:toolworks:docs:apparatus:ue-name-cpp-detail.png?nolink&600 |}}
-  - The new class gets created as a combo of its header (.h) and a source file (.cpp). All in the Source (sub)folder of your project. You should now see them in the IDE of your choice:{{ :en:toolworks:docs:apparatus:vscode-new-mechanical-actor-class-sources.png?nolink |}} +  - The new class gets created as a combo of its header (.h) and a source file (.cpp). All in the Source (sub)folder of your project. You should now see them in the IDE of your choice:{{ :en:toolworks:docs:apparatus:vscode-new-detail-class-sources.png?nolink |}} 
-  - Note that you may have to recompile the project and/or restart the Editor after that. Don't be scared by some possible errors here, regenerate the IDE project, rebuild and start again.+  - Note that you may have to recompile the project and/or restart the Editor after that. Don't be scared by some possible errors here, regenerate the IDE project, rebuild and start again.{{ :en:toolworks:docs:apparatus:vscode-generate-project-files.png?nolink |}}
   - The corresponding file contents should be as:   - The corresponding file contents should be as:
     * ''MyDetail.h'':<code cpp>     * ''MyDetail.h'':<code cpp>
Line 31: Line 35:
  */  */
 UCLASS() UCLASS()
-class APPARATUSMARK_API UMyDetail : public UDetail+class MY_API UMyDetail : public UDetail
 { {
  GENERATED_BODY()  GENERATED_BODY()
Line 37: Line 41:
 }; };
 </code> </code>
-    * ''MyMechanicalActor.cpp'':<code cpp>+    * ''MyDetail.cpp'':<code cpp>
 // Fill out your copyright notice in the Description page of Project Settings. // Fill out your copyright notice in the Description page of Project Settings.
  
Line 44: Line 48:
  
 </code> </code>
-  - Now you can add some data fields to the class as usually in, right in the C++ header:<code cpp>+  - Now you can add some data fields to the class as usually, right in the C++ header:<code cpp>
 float X = 0; float X = 0;
 float Y = 0; float Y = 0;
  • en/toolworks/docs/apparatus/detail.1623409058.txt.gz
  • Last modified: 2021/06/11 13:57
  • by vladius