| 1046 | } |
| 1047 | |
| 1048 | void SDFEditor::addEditPrimitive(bool addToCurrentEdit, bool addToHistory) |
| 1049 | { |
| 1050 | uint32_t basePrimitiveID = kInvalidPrimitiveID; |
| 1051 | if (mUI2D.symmetryPlane.active) |
| 1052 | { |
| 1053 | updateSymmetryPrimitive(); |
| 1054 | basePrimitiveID = mCurrentEdit.pSDFGrid->addPrimitives({mCurrentEdit.primitive, mCurrentEdit.symmetryPrimitive}); |
| 1055 | |
| 1056 | if (addToCurrentEdit) |
| 1057 | { |
| 1058 | mCurrentEdit.primitiveID = basePrimitiveID; |
| 1059 | mCurrentEdit.symmetryPrimitiveID = basePrimitiveID + 1; |
| 1060 | } |
| 1061 | |
| 1062 | if (addToHistory) |
| 1063 | { |
| 1064 | SDFEdit edit; |
| 1065 | edit.gridID = mCurrentEdit.gridID; |
| 1066 | edit.primitiveID = basePrimitiveID; |
| 1067 | |
| 1068 | // Main edit. |
| 1069 | mPerformedSDFEdits.push_back(edit); |
| 1070 | |
| 1071 | // Symmetry edit. |
| 1072 | edit.primitiveID++; |
| 1073 | mPerformedSDFEdits.push_back(edit); |
| 1074 | } |
| 1075 | |
| 1076 | mNonBakedPrimitiveCount += 2; |
| 1077 | } |
| 1078 | else |
| 1079 | { |
| 1080 | basePrimitiveID = mCurrentEdit.pSDFGrid->addPrimitives({mCurrentEdit.primitive}); |
| 1081 | |
| 1082 | if (addToCurrentEdit) |
| 1083 | { |
| 1084 | mCurrentEdit.primitiveID = basePrimitiveID; |
| 1085 | } |
| 1086 | |
| 1087 | if (addToHistory) |
| 1088 | { |
| 1089 | SDFEdit edit; |
| 1090 | edit.gridID = mCurrentEdit.gridID; |
| 1091 | edit.primitiveID = basePrimitiveID; |
| 1092 | mPerformedSDFEdits.push_back(edit); |
| 1093 | } |
| 1094 | |
| 1095 | mNonBakedPrimitiveCount++; |
| 1096 | } |
| 1097 | } |
| 1098 | |
| 1099 | void SDFEditor::removeEditPrimitives() |
| 1100 | { |
nothing calls this directly
no test coverage detected