diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.cpp b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.cpp new file mode 100644 index 0000000..2c9431e --- /dev/null +++ b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.cpp @@ -0,0 +1,479 @@ +//Author-Autodesk Inc. +//Description-This is sample addin. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace adsk::core; +using namespace adsk::fusion; + +const std::string btnCmdIdOnQAT = "demoButtonCommandOnQATCPP"; +const std::string listCmdIdOnQAT = "demoListCommandOnQATCPP"; +const std::string commandIdOnPanel = "demoCommandOnPanelCPP"; +const std::string iconResources = "./resources"; +const std::string selectionInputId = "selectionInput"; +const std::string distanceInputId = "distanceValueCommandInput"; +const std::string panelId = "SolidCreatePanel"; + +Ptr app; +Ptr ui; + +class CommandExecutedHandler : public adsk::core::CommandEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + Ptr firingEvent = eventArgs->firingEvent(); + if (!firingEvent) + return; + + Ptr command = firingEvent->sender(); + if (!command) + return; + + Ptr parentDefinition = command->parentCommandDefinition(); + if (!parentDefinition) + return; + + std::stringstream ss; + ss << "command: " + parentDefinition->id() << " executed successfully"; + + ui->messageBox(ss.str()); + } +}; + +class InputChangedHandler : public adsk::core::InputChangedEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + Ptr firingEvent = eventArgs->firingEvent(); + if (!firingEvent) + return; + + Ptr command = firingEvent->sender(); + if (!command) + return; + + Ptr parentDefinition = command->parentCommandDefinition(); + if (!parentDefinition) + return; + + Ptr cmdInput = eventArgs->input(); + if(!cmdInput) + return; + + if(cmdInput->id() != distanceInputId) + { + std::stringstream ss; + ss << "Input: " << parentDefinition->id() << " changed event triggered"; + ui->messageBox(ss.str()); + } + + if(cmdInput->id() == selectionInputId){ + Ptr inputs = cmdInput->commandInputs(); + Ptr distanceInput = inputs->itemById(distanceInputId); + + Ptr selInput = cmdInput; + if(selInput->selectionCount() > 0){ + Ptr sel = selInput->selection(0); + if(!sel) + return; + + Ptr selPt = sel->point(); + if(!selPt) + return; + + Ptr obj = sel->entity(); + if(!obj) + return; + + Ptr plane; + if(Ptr face = obj) + { + plane = face->geometry(); + } + else if(Ptr constructionPlane = obj) + { + plane = constructionPlane->geometry(); + } + if(!plane) + return; + + distanceInput->setManipulator(selPt, plane->normal()); + distanceInput->expression("10mm * 2"); + distanceInput->isEnabled(true); + distanceInput->isVisible(true); + } + else{ + distanceInput->isEnabled(false); + distanceInput->isVisible(false); + } + } + } +}; + +class CommandCreatedOnQATHandler : public adsk::core::CommandCreatedEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + if (eventArgs) + { + Ptr command = eventArgs->command(); + if (!command) + return; + + Ptr exec = command->execute(); + if (!exec) + return; + exec->add(&onCommandExecuted_); + + if (ui) + ui->messageBox("QAT command created successfully"); + } + } +private: + CommandExecutedHandler onCommandExecuted_; +} onCommandCreatedOnQAT; + +class CommandCreatedOnPanelHandler : public adsk::core::CommandCreatedEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + if (eventArgs) + { + Ptr command = eventArgs->command(); + if (!command) + return; + + command->helpFile("help.html"); + + Ptr exec = command->execute(); + if (!exec) + return; + exec->add(&onCommandExecuted_); + + Ptr inputChanged = command->inputChanged(); + if (!inputChanged) + return; + inputChanged->add(&onInputChanged_); + + // Define the inputs. + Ptr inputs = command->commandInputs(); + if (!inputs) + return; + + inputs->addValueInput("valueInput_", "Value", "cm", ValueInput::createByString("0.0 cm")); + inputs->addBoolValueInput("boolvalueInput_", "Bool", true); + inputs->addStringValueInput("stringValueInput_", "String Value", "Default value"); + Ptr selInput = inputs->addSelectionInput(selectionInputId, "Selection", "Select one"); + if (selInput) + { + selInput->setSelectionLimits(0); + selInput->addSelectionFilter("PlanarFaces"); + selInput->addSelectionFilter("ConstructionPlanes"); + } + + Ptr dropDownCommandInput = inputs->addDropDownCommandInput("dropdownCommandInput", "Drop Down", DropDownStyles::LabeledIconDropDownStyle); + if (dropDownCommandInput) + { + Ptr dropdownItems = dropDownCommandInput->listItems(); + if (!dropdownItems) + return; + dropdownItems->add("ListItem 1", true); + dropdownItems->add("ListItem 2", false); + dropdownItems->add("ListItem 3", false); + } + Ptr dropDownCommandInput2 = inputs->addDropDownCommandInput("dropDownCommandInput2", "Drop Down2", DropDownStyles::CheckBoxDropDownStyle); + if (dropDownCommandInput2) + { + Ptr dropdownItems = dropDownCommandInput2->listItems(); + if (!dropdownItems) + return; + dropdownItems->add("ListItem 1", true); + dropdownItems->add("ListItem 2", true); + dropdownItems->add("ListItem 3", false); + } + inputs->addFloatSliderCommandInput("floatSliderCommandInput", "Slider", "cm", 0.0, 10.0, true); + Ptr buttonRowCommandInput = inputs->addButtonRowCommandInput("buttonRowCommandInput", "Button Row", false); + if (buttonRowCommandInput) + { + Ptr buttonRowItems = buttonRowCommandInput->listItems(); + if (!buttonRowItems) + return; + buttonRowItems->add("ListItem 1", false, iconResources); + buttonRowItems->add("ListItem 2", true, iconResources); + buttonRowItems->add("ListItem 3", false, iconResources); + } + + Ptr distanceInput = inputs->addDistanceValueCommandInput(distanceInputId, "Distance", adsk::core::ValueInput::createByReal(0.0)); + if(distanceInput) + { + distanceInput->isEnabled(false); + distanceInput->isVisible(false); + distanceInput->minimumValue(1.0); + distanceInput->maximumValue(10.0); + } + + Ptr directionInput = inputs->addDirectionCommandInput("directionInput", "Direction"); + if(directionInput) + { + directionInput->setManipulator(Point3D::create(0,0,0), Vector3D::create(1,0,0)); + } + + Ptr directionInput2 = inputs->addDirectionCommandInput("directionInput2", "Direction2", iconResources); + if(directionInput2) + { + directionInput2->setManipulator(Point3D::create(0,0,0), Vector3D::create(0,1,0)); + } + + ui->messageBox("Panel command created successfully"); + } + } +private: + CommandExecutedHandler onCommandExecuted_; + InputChangedHandler onInputChanged_; +} onCommandCreatedOnPanel; + +extern "C" XI_EXPORT bool run(const char* context) +{ + const std::string commandName = "Demo"; + const std::string commandDescription = "Demo Command"; + const std::string commandResources = "./resources"; + + app = Application::get(); + if (!app) + return false; + + ui = app->userInterface(); + if (!ui) + return false; + + Ptr commandDefinitions = ui->commandDefinitions(); + if (!commandDefinitions) + return false; + + // add a button command on Quick Access Toolbar + Ptr toolbars = ui->toolbars(); + if (!toolbars) + return false; + + Ptr toolbarQAT = toolbars->itemById("QAT"); + if (!toolbarQAT) + return false; + + Ptr toolbarControlsQAT = toolbarQAT->controls(); + if (!toolbarControlsQAT) + return false; + Ptr btnCmdToolbarCtlQAT = toolbarControlsQAT->itemById(btnCmdIdOnQAT); + if (!btnCmdToolbarCtlQAT) + { + Ptr btnCmdDefinitionQAT = commandDefinitions->itemById(btnCmdIdOnQAT); + if (!btnCmdDefinitionQAT) + { + btnCmdDefinitionQAT = commandDefinitions->addButtonDefinition(btnCmdIdOnQAT, commandName, commandDescription, commandResources); + + } + + Ptr btnCmdCreatedEvent = btnCmdDefinitionQAT->commandCreated(); + if (!btnCmdCreatedEvent) + return false; + btnCmdCreatedEvent->add(&onCommandCreatedOnQAT); + btnCmdToolbarCtlQAT = toolbarControlsQAT->addCommand(btnCmdDefinitionQAT); + if (!btnCmdToolbarCtlQAT) + return false; + btnCmdToolbarCtlQAT->isVisible(true); + ui->messageBox("A demo button command is successfully added to the Quick Access Toolbar"); + } + + // add a list command on Quick Access Toolbar + Ptr listCmdToolbarCtlQAT = toolbarControlsQAT->itemById(listCmdIdOnQAT); + if (!listCmdToolbarCtlQAT) + { + Ptr listCmdDefinitionQAT = commandDefinitions->itemById(listCmdIdOnQAT); + if (!listCmdDefinitionQAT) + { + listCmdDefinitionQAT = commandDefinitions->addListDefinition(listCmdIdOnQAT, commandName, ListControlDisplayTypes::CheckBoxListType, commandResources); + if (!listCmdDefinitionQAT) + return false; + Ptr listCtlDefinition = listCmdDefinitionQAT->controlDefinition(); + if (!listCtlDefinition) + return false; + Ptr listItems = listCtlDefinition->listItems(); + if (!listItems) + return false; + listItems->add("Demo item 1", true); + listItems->add("Demo item 2", false); + listItems->add("Demo item 3", false); + } + + Ptr listCmdCreatedEvent = listCmdDefinitionQAT->commandCreated(); + if (!listCmdCreatedEvent) + return false; + listCmdCreatedEvent->add(&onCommandCreatedOnQAT); + listCmdToolbarCtlQAT = toolbarControlsQAT->addCommand(listCmdDefinitionQAT); + if (!listCmdToolbarCtlQAT) + return false; + listCmdToolbarCtlQAT->isVisible(true); + ui->messageBox("A demo list command is successfully added to the Quick Access Toolbar"); + } + + // add a command on create panel in modeling workspace + Ptr workspaces = ui->workspaces(); + if (!workspaces) + return false; + Ptr modelingWorkspace = workspaces->itemById("FusionSolidEnvironment"); + if (!modelingWorkspace) + return false; + Ptr toolbarPanels = modelingWorkspace->toolbarPanels(); + if (!toolbarPanels) + return false; + Ptr toolbarPanel = toolbarPanels->itemById(panelId); // add the new command under the CREATE panel + if (!toolbarPanel) + return false; + Ptr toolbarControlsPanel = toolbarPanel->controls(); + if (!toolbarControlsPanel) + return false; + Ptr toolbarControlPanel = toolbarControlsPanel->itemById(commandIdOnPanel); + if (!toolbarControlPanel) + { + Ptr commandDefinitionPanel = commandDefinitions->itemById(commandIdOnPanel); + if (!commandDefinitionPanel) + { + commandDefinitionPanel = commandDefinitions->addButtonDefinition(commandIdOnPanel, commandName, commandDescription, commandResources); + } + Ptr cmdCreatedEvent = commandDefinitionPanel->commandCreated(); + if (!cmdCreatedEvent) + return false; + cmdCreatedEvent->add(&onCommandCreatedOnPanel); + toolbarControlPanel = toolbarControlsPanel->addCommand(commandDefinitionPanel); + if (toolbarControlPanel) + toolbarControlPanel->isVisible(true); + ui->messageBox("A demo command is successfully added to the create panel in modeling workspace"); + } + + return true; +} + +extern "C" XI_EXPORT bool stop(const char* context) +{ + if (!ui) + return false; + + // Get controls and command definitions + Ptr toolbars = ui->toolbars(); + if (!toolbars) + return false; + Ptr toolbarQAT = toolbars->itemById("QAT"); + if (!toolbarQAT) + return false; + Ptr toolbarControlsQAT = toolbarQAT->controls(); + if (!toolbarControlsQAT) + return false; + Ptr btnCmdToolbarCtlQAT = toolbarControlsQAT->itemById(btnCmdIdOnQAT); + Ptr listCmdToolbarCtlQAT = toolbarControlsQAT->itemById(listCmdIdOnQAT); + Ptr commandDefinitions = ui->commandDefinitions(); + if (!commandDefinitions) + return false; + Ptr btnCmdDefinitionQAT = commandDefinitions->itemById(btnCmdIdOnQAT); + Ptr listCmdDefinitionQAT = commandDefinitions->itemById(listCmdIdOnQAT); + Ptr workspaces = ui->workspaces(); + if (!workspaces) + return false; + Ptr modelingWorkspace = workspaces->itemById("FusionSolidEnvironment"); + if (!modelingWorkspace) + return false; + Ptr toolbarPanels = modelingWorkspace->toolbarPanels(); + if (!toolbarPanels) + return false; + Ptr toolbarPanel = toolbarPanels->itemById(panelId); + if (!toolbarPanel) + return false; + Ptr toolbarControlsPanel = toolbarPanel->controls(); + if (!toolbarControlsPanel) + return false; + Ptr toolbarControlPanel = toolbarControlsPanel->itemById(commandIdOnPanel); + Ptr commandDefinitionPanel = commandDefinitions->itemById(commandIdOnPanel); + + // Delete controls and associated command definitions + if (btnCmdToolbarCtlQAT) + btnCmdToolbarCtlQAT->deleteMe(); + if (listCmdToolbarCtlQAT) + listCmdToolbarCtlQAT->deleteMe(); + if (btnCmdDefinitionQAT) + btnCmdDefinitionQAT->deleteMe(); + if (listCmdToolbarCtlQAT) + listCmdToolbarCtlQAT->deleteMe(); + if (toolbarControlPanel) + toolbarControlPanel->deleteMe(); + if (commandDefinitionPanel) + commandDefinitionPanel->deleteMe(); + + return true; +} + + +#ifdef XI_WIN + +#include + +BOOL APIENTRY DllMain(HMODULE hmodule, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +#endif // XI_WIN diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.dll b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.dll new file mode 100644 index 0000000..8548a62 Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.dll differ diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.dylib b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.dylib new file mode 100644 index 0000000..fd18258 Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.dylib differ diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.manifest b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.manifest new file mode 100644 index 0000000..740877d --- /dev/null +++ b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.manifest @@ -0,0 +1,14 @@ +{ + "autodeskProduct": "Fusion360", + "type": "addin", + "author": "Autodesk Inc.", + "description": { + "": "This is sample addin." + }, + "supportedOS": "windows|mac", + "id": "48f0023c-5c4f-4c64-9030-5d644cd9ee2a", + "version": "", + "runOnStartup": false, + "sourcewindows": "AddInSample.vcxproj", + "sourcemac": "AddInSample.xcodeproj" +} \ No newline at end of file diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.vcxproj b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.vcxproj new file mode 100644 index 0000000..cc0d5ef --- /dev/null +++ b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {D7CBB035-8CC0-4576-9C72-5076E079586B} + Win32Proj + AddInSample + + + + DynamicLibrary + true + v110 + Unicode + + + DynamicLibrary + false + v110 + true + Unicode + + + + + + + + + + + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/include + + + Windows + true + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/lib + core.lib;fusion.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/include + + + Windows + true + true + true + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/lib + core.lib;fusion.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + NotUsing + NotUsing + + + + + true + true + + + + + + diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.xcodeproj/project.pbxproj b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..38551c7 --- /dev/null +++ b/usr/autodesk/CPP/AddInSamples/AddInSample/AddInSample.xcodeproj/project.pbxproj @@ -0,0 +1,267 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2BB196C61AD5940800164CD3 /* AddInSample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB196C51AD5940800164CD3 /* AddInSample.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2BB196BE1AD586AA00164CD3 /* AddInSample.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = AddInSample.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + 2BB196C51AD5940800164CD3 /* AddInSample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AddInSample.cpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2BB196BB1AD586AA00164CD3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2BB196B51AD586AA00164CD3 = { + isa = PBXGroup; + children = ( + 2BB196C51AD5940800164CD3 /* AddInSample.cpp */, + 2BB196BF1AD586AA00164CD3 /* Products */, + ); + sourceTree = ""; + }; + 2BB196BF1AD586AA00164CD3 /* Products */ = { + isa = PBXGroup; + children = ( + 2BB196BE1AD586AA00164CD3 /* AddInSample.dylib */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2BB196BC1AD586AA00164CD3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2BB196BD1AD586AA00164CD3 /* AddInSample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "AddInSample" */; + buildPhases = ( + 2BB196BA1AD586AA00164CD3 /* Sources */, + 2BB196BB1AD586AA00164CD3 /* Frameworks */, + 2BB196BC1AD586AA00164CD3 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AddInSample; + productName = AddInSample; + productReference = 2BB196BE1AD586AA00164CD3 /* AddInSample.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2BB196B61AD586AA00164CD3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = Autodesk; + }; + buildConfigurationList = 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "AddInSample" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 2BB196B51AD586AA00164CD3; + productRefGroup = 2BB196BF1AD586AA00164CD3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2BB196BD1AD586AA00164CD3 /* AddInSample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 2BB196BA1AD586AA00164CD3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2BB196C61AD5940800164CD3 /* AddInSample.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2BB196C01AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/include", + ); + LIBRARY_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 2BB196C11AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/include", + ); + LIBRARY_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + SDKROOT = macosx; + }; + name = Release; + }; + 2BB196C31AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/core.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/fusion.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Debug; + }; + 2BB196C41AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/core.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/fusion.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "AddInSample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C01AD586AA00164CD3 /* Debug */, + 2BB196C11AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "AddInSample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C31AD586AA00164CD3 /* Debug */, + 2BB196C41AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2BB196B61AD586AA00164CD3 /* Project object */; +} diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/help.html b/usr/autodesk/CPP/AddInSamples/AddInSample/help.html new file mode 100644 index 0000000..78dc63d --- /dev/null +++ b/usr/autodesk/CPP/AddInSamples/AddInSample/help.html @@ -0,0 +1,6 @@ + + + +This is help file of this addin. + + \ No newline at end of file diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/resources/16x16-dark.png b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/16x16-dark.png new file mode 100644 index 0000000..f975a3a Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/16x16-dark.png differ diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/resources/16x16-disabled.png b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/16x16-disabled.png new file mode 100644 index 0000000..1deb309 Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/resources/16x16.png b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/16x16.png new file mode 100644 index 0000000..7bf7e0f Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/16x16.png differ diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/resources/32x32-dark.png b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/32x32-dark.png new file mode 100644 index 0000000..992c4d7 Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/32x32-dark.png differ diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/resources/32x32-disabled.png b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/32x32-disabled.png new file mode 100644 index 0000000..992c4d7 Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/32x32-disabled.png differ diff --git a/usr/autodesk/CPP/AddInSamples/AddInSample/resources/32x32.png b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/32x32.png new file mode 100644 index 0000000..d72912d Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/AddInSample/resources/32x32.png differ diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/GearEnglish.png b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/GearEnglish.png new file mode 100644 index 0000000..b7190fd Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/GearEnglish.png differ diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/GearMetric.png b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/GearMetric.png new file mode 100644 index 0000000..844b3ee Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/GearMetric.png differ diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/16x16.png b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/16x16.png new file mode 100644 index 0000000..c12e374 Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/16x16.png differ diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/16x16@2x.png b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/16x16@2x.png new file mode 100644 index 0000000..efa3cd1 Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/16x16@2x.png differ diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/32x32.png b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/32x32.png new file mode 100644 index 0000000..efa3cd1 Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/32x32.png differ diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/32x32@2x.png b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/32x32@2x.png new file mode 100644 index 0000000..1fd0d3d Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/SpurGear/Resources/SpurGear/32x32@2x.png differ diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.cpp b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.cpp new file mode 100644 index 0000000..22a5451 --- /dev/null +++ b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.cpp @@ -0,0 +1,1287 @@ +/************************************************************************************** + Author-Brian Ekins + Description-Creates a spur gear component. + + AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. AUTODESK SPECIFICALLY + DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. + AUTODESK, INC. DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE + UNINTERRUPTED OR ERROR FREE. +***************************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#define _USE_MATH_DEFINES +#include +#include + + +#if defined(_WINDOWS) || defined(_WIN32) || defined(_WIN64) +#include +#else +#include +#endif + +using namespace adsk::core; +using namespace adsk::fusion; + + +// Globals +Ptr _app; +Ptr _ui; +std::string _units = ""; + +// Global command input declarations. +Ptr _imgInputEnglish; +Ptr _imgInputMetric; +Ptr _standard; +Ptr _pressureAngle; +Ptr _pressureAngleCustom; +Ptr _backlash; +Ptr _diaPitch; +Ptr _module; +Ptr _numTeeth; +Ptr _rootFilletRad; +Ptr _thickness; +Ptr _holeDiam; +Ptr _pitchDiam; +Ptr _errMessage; + +bool getCommandInputValue(Ptr commandInput, std::string unitType, double *value); +bool is_digits(const std::string &str); +Ptr drawGear(Ptr design, double diametralPitch, int numTeeth, double thickness, double rootFilletRad, double pressureAngle, double backlash, double holeDiam); + + +bool checkReturn(Ptr returnObj) +{ + if (returnObj) + return true; + else + if (_app && _ui) + { + std::string errDesc; + _app->getLastError(&errDesc); + _ui->messageBox(errDesc); + return false; + } + else + return false; +} + +// Event handler for the execute event. +class GearCommandExecuteEventHandler : public adsk::core::CommandEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + double diaPitch = 0.0; + if( _standard->selectedItem()->name() == "English") + { + diaPitch = _diaPitch->value(); + } + else if (_standard->selectedItem()->name() == "Metric") + { + diaPitch = 25.4 / _module->value(); + } + + // Save the current values as attributes. + Ptr des = _app->activeProduct(); + Ptr attribs = des->attributes(); + attribs->add("SpurGear", "standard", _standard->selectedItem()->name()); + attribs->add("SpurGear", "pressureAngle", _pressureAngle->selectedItem()->name()); + attribs->add("SpurGear", "pressureAngleCustom", std::to_string(_pressureAngleCustom->value())); + attribs->add("SpurGear", "diaPitch", std::to_string(diaPitch)); + attribs->add("SpurGear", "numTeeth", _numTeeth->value()); + attribs->add("SpurGear", "rootFilletRad", std::to_string(_rootFilletRad->value())); + attribs->add("SpurGear", "thickness", std::to_string(_thickness->value())); + attribs->add("SpurGear", "holeDiam", std::to_string(_holeDiam->value())); + attribs->add("SpurGear", "backlash", std::to_string(_backlash->value())); + + // Get the current values. + double pressureAngle = 0.0; + if (_pressureAngle->selectedItem()->name() == "Custom") + { + pressureAngle = _pressureAngleCustom->value(); + } + else + { + if (_pressureAngle->selectedItem()->name() == "14.5 deg") + { + pressureAngle = 14.5 * (M_PI/180.0); + } + else if (_pressureAngle->selectedItem()->name() == "20 deg") + { + pressureAngle = 20.0 * (M_PI/180.0); + } + else if (_pressureAngle->selectedItem()->name() == "25 deg") + { + pressureAngle = 25.0 * (M_PI/180); + } + } + + int numTeeth = std::stoi(_numTeeth->value()); + double rootFilletRad = _rootFilletRad->value(); + double thickness = _thickness->value(); + double holeDiam = _holeDiam->value(); + double backlash = _backlash->value(); + + // Create the gear. + Ptr gearComp; + gearComp = drawGear(des, diaPitch, numTeeth, thickness, rootFilletRad, pressureAngle, backlash, holeDiam); + + if (gearComp) + { + std::string desc = ""; + if (_standard->selectedItem()->name() == "English") + { + desc = "Spur Gear; Diametrial Pitch: " + std::to_string(diaPitch) + "; "; + } + else if (_standard->selectedItem()->name() == "Metric") + { + desc = "Spur Gear; Module: " + std::to_string(25.4 / diaPitch) + "; "; + } + + desc += "Num Teeth: " + std::to_string(numTeeth) + "; "; + desc += "Pressure Angle: " + std::to_string(pressureAngle * (180/M_PI)) + "; "; + + desc += "Backlash: " + des->unitsManager()->formatInternalValue(backlash, _units, true); + gearComp->description(desc); + } + else + { + eventArgs->executeFailed(true); + eventArgs->executeFailedMessage("Unexpected failure while constructing the gear."); + } + } +} _gearCommandExecute; + + +class GearCommandInputChangedHandler : public adsk::core::InputChangedEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + Ptr changedInput = eventArgs->input(); + + if (changedInput->id() == "standard") + { + if (_standard->selectedItem()->name() == "English") + { + _imgInputMetric->isVisible(false); + _imgInputEnglish->isVisible(true); + + _diaPitch->isVisible(true); + _module->isVisible(false); + + _diaPitch->value(25.4 / _module->value()); + + _units = "in"; + } + else if (_standard->selectedItem()->name() == "Metric") + { + _imgInputMetric->isVisible(true); + _imgInputEnglish->isVisible(false); + + _diaPitch->isVisible(false); + _module->isVisible(true); + + _module->value(25.4 / _diaPitch->value()); + + _units = "mm"; + } + + // Set each one to it's current value because otherwised if the user + // has edited it, the value won't update in the dialog because + // apparently it remembers the units when the value was edited. + // Setting the value using the API resets this. + _backlash->value(_backlash->value()); + _backlash->unitType(_units); + _rootFilletRad->value(_rootFilletRad->value()); + _rootFilletRad->unitType(_units); + _thickness->value(_thickness->value()); + _thickness->unitType(_units); + _holeDiam->value(_holeDiam->value()); + _holeDiam->unitType(_units); + } + + // Update the pitch diameter value. + double diaPitch = 0; + if (_standard->selectedItem()->name() == "English") + { + double value; + if (getCommandInputValue(_diaPitch, "", &value)) + { + diaPitch = value; + } + } + else if (_standard->selectedItem()->name() == "Metric") + { + double value; + if (getCommandInputValue(_module, "", &value)) + { + diaPitch = 25.4 / value; + } + } + + if (diaPitch != 0) + { + if (is_digits(_numTeeth->value())) + { + double numTeeth = std::stoi(_numTeeth->value()); + double pitchDia = numTeeth/diaPitch; + + // The pitch dia has been calculated in inches, but this expects cm as the input units. + Ptr des = _app->activeProduct(); + std::string pitchDiaText = des->unitsManager()->formatInternalValue(pitchDia * 2.54, _units, true); + _pitchDiam->text(pitchDiaText); + } + else + { + _pitchDiam->text(""); + } + } + else + { + _pitchDiam->text(""); + } + + if (changedInput->id() == "pressureAngle") + { + if (_pressureAngle->selectedItem()->name() == "Custom") + { + _pressureAngleCustom->isVisible(true); + } + else + { + _pressureAngleCustom->isVisible(false); + } + } + } +} _gearCommandInputChanged; + + +class GearCommandValidateInputsEventHandler : public adsk::core::ValidateInputsEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + _errMessage->text(""); + + // Verify that at lesat 4 teath are specified. + int numTeeth; + if (!is_digits(_numTeeth->value())) + { + _errMessage->text("The number of teeth must be a whole number."); + eventArgs->areInputsValid(false); + return; + } + else + { + numTeeth = std::stoi(_numTeeth->value()); + } + + if (numTeeth < 4) + { + _errMessage->text("The number of teeth must be 4 or more."); + eventArgs->areInputsValid(false); + return; + } + + // Calculate some of the gear sizes to use in validation. + double diaPitch = 0.0; + if (_standard->selectedItem()->name() == "English") + { + double value; + if (!getCommandInputValue(_diaPitch, "", &value)) + { + eventArgs->areInputsValid(false); + return; + } + else + { + diaPitch = value; + } + } + else if (_standard->selectedItem()->name() == "Metric") + { + double value; + if (!getCommandInputValue(_module, "", &value)) + { + eventArgs->areInputsValid(false); + return; + } + else + { + diaPitch = 25.4 / value; + } + } + + double diametralPitch = diaPitch / 2.54; + double pitchDia = numTeeth / diametralPitch; + + double dedendum; + if (diametralPitch < (20.0 *(M_PI/180.0))-0.000001) + { + dedendum = 1.157 / diametralPitch; + } + else + { + double circularPitch = M_PI / diametralPitch; + if (circularPitch >= 20.0) + { + dedendum = 1.25 / diametralPitch; + } + else + { + dedendum = (1.2 / diametralPitch) + (.002 * 2.54); + } + } + + double rootDia = pitchDia - (2.0 * dedendum); + + double pressureAngle = 0.0; + if (_pressureAngle->selectedItem()->name() == "Custom") + { + pressureAngle = _pressureAngleCustom->value(); + } + else + { + if (_pressureAngle->selectedItem()->name() == "14.5 deg") + pressureAngle = 14.5 * (M_PI/180.0); + else if (_pressureAngle->selectedItem()->name() == "20 deg") + pressureAngle = 20.0 * (M_PI/180.0); + else if (_pressureAngle->selectedItem()->name() == "25 deg") + pressureAngle = 25.0 * (M_PI/180.0); + } + + double baseCircleDia = pitchDia * cos(pressureAngle); + double baseCircleCircumference = 2.0 * M_PI * (baseCircleDia / 2.0); + + Ptr des = _app->activeProduct(); + + double holeDiam; + double value; + if (!getCommandInputValue(_holeDiam, _units, &value)) + { + eventArgs->areInputsValid(false); + return; + } + else + { + holeDiam = value; + } + + if (holeDiam >= (rootDia - 0.01)) + { + _errMessage->text("The center hole diameter is too large. It must be less than " + des->unitsManager()->formatInternalValue(rootDia - 0.01, _units, true)); + eventArgs->areInputsValid(false); + return; + } + + double toothThickness = baseCircleCircumference / (numTeeth * 2); + if (_rootFilletRad->value() > toothThickness * 0.4) + { + _errMessage->text("The root fillet radius is too large. It must be less than " + des->unitsManager()->formatInternalValue(toothThickness * 0.4, _units, true)); + eventArgs->areInputsValid(false); + return; + } + } +} _gearCommandValidateInputs; + + +class SpurGearCommandCreatedEventHandler : public adsk::core::CommandCreatedEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + // Verify that a Fusion design is active. + Ptr des = _app->activeProduct(); + if (!checkReturn(des)) + { + _ui->messageBox("A Fusion design must be active when invoking this command."); + return; + } + + std::string defaultUnits = des->unitsManager()->defaultLengthUnits(); + + // Determine whether to use inches or millimeters as the intial default. + if (defaultUnits == "in" || defaultUnits == "ft") + { + _units = "in"; + } + else + { + _units = "mm"; + } + + // Define the default values and get the previous values from the attributes. + std::string standard; + if (_units == "in") + { + standard = "English"; + } + else + { + standard = "Metric"; + } + + Ptr standardAttrib = des->attributes()->itemByName("SpurGear", "standard"); + if (checkReturn(standardAttrib)) + standard = standardAttrib->value(); + + if (standard == "English") + { + _units = "in"; + } + else + { + _units = "mm"; + } + + std::string pressureAngle = "20 deg"; + Ptr pressureAngleAttrib = des->attributes()->itemByName("SpurGear", "pressureAngle"); + if (checkReturn(pressureAngleAttrib)) + { + pressureAngle = pressureAngleAttrib->value(); + } + + double pressureAngleCustom = 20 * (M_PI/180.0); + Ptr pressureAngleCustomAttrib = des->attributes()->itemByName("SpurGear", "pressureAngleCustom"); + if (checkReturn(pressureAngleCustomAttrib)) + { + pressureAngleCustom = std::stod(pressureAngleCustomAttrib->value()); + } + + std::string diaPitch = "2"; + Ptr diaPitchAttrib = des->attributes()->itemByName("SpurGear", "diaPitch"); + if (checkReturn(diaPitchAttrib)) + { + diaPitch = diaPitchAttrib->value(); + } + double metricModule = 25.4 / std::stod(diaPitch); + + std::string backlash = "0"; + Ptr backlashAttrib = des->attributes()->itemByName("SpurGear", "backlash"); + if (checkReturn(backlashAttrib)) + backlash = backlashAttrib->value(); + + std::string numTeeth = "24"; + Ptr numTeethAttrib = des->attributes()->itemByName("SpurGear", "numTeeth"); + if (checkReturn(numTeethAttrib)) + numTeeth = numTeethAttrib->value(); + + std::string rootFilletRad = std::to_string(.0625 * 2.54); + Ptr rootFilletRadAttrib = des->attributes()->itemByName("SpurGear", "rootFilletRad"); + if (checkReturn(rootFilletRadAttrib)) + rootFilletRad = rootFilletRadAttrib->value(); + + std::string thickness = std::to_string(0.5 * 2.54); + Ptr thicknessAttrib = des->attributes()->itemByName("SpurGear", "thickness"); + if (checkReturn(thicknessAttrib)) + thickness = thicknessAttrib->value(); + + std::string holeDiam = std::to_string(0.5 * 2.54); + Ptr holeDiamAttrib = des->attributes()->itemByName("SpurGear", "holeDiam"); + if (checkReturn(holeDiamAttrib)) + holeDiam = holeDiamAttrib->value(); + + Ptr cmd = eventArgs->command(); + cmd->isExecutedWhenPreEmpted(false); + Ptr inputs = cmd->commandInputs(); + if (!checkReturn(inputs)) + return; + + // Define the command dialog. + _imgInputEnglish = inputs->addImageCommandInput("gearImageEnglish", "", "Resources/GearEnglish.png"); + if (!checkReturn(_imgInputEnglish)) + return; + _imgInputEnglish->isFullWidth(true); + + _imgInputMetric = inputs->addImageCommandInput("gearImageMetric", "", "Resources/GearMetric.png"); + if (!checkReturn(_imgInputMetric)) + return; + _imgInputMetric->isFullWidth(true); + + _standard = inputs->addDropDownCommandInput("standard", "Standard", TextListDropDownStyle); + if (!checkReturn(_standard)) + return; + + if (standard == "English") + { + _standard->listItems()->add("English", true); + _standard->listItems()->add("Metric", false); + _imgInputMetric->isVisible(false); + } + else + { + _standard->listItems()->add("English", false); + _standard->listItems()->add("Metric", true); + _imgInputEnglish->isVisible(false); + } + + _pressureAngle = inputs->addDropDownCommandInput("pressureAngle", "Pressure Angle", TextListDropDownStyle); + if (!checkReturn(_pressureAngle)) + return; + + if (pressureAngle == "14.5 deg") + { + _pressureAngle->listItems()->add("14.5 deg", true); + } + else + { + _pressureAngle->listItems()->add("14.5 deg", false); + } + + if (pressureAngle == "20 deg") + { + _pressureAngle->listItems()->add("20 deg", true); + } + else + { + _pressureAngle->listItems()->add("20 deg", false); + } + + if (pressureAngle == "25 deg") + { + _pressureAngle->listItems()->add("25 deg", true); + } + else + { + _pressureAngle->listItems()->add("25 deg", false); + } + + if (pressureAngle == "Custom") + { + _pressureAngle->listItems()->add("Custom", true); + } + else + { + _pressureAngle->listItems()->add("Custom", false); + } + + _pressureAngleCustom = inputs->addValueInput("pressureAngleCustom", "Custom Angle", "deg", ValueInput::createByReal(pressureAngleCustom)); + if (!checkReturn(_pressureAngleCustom)) + return; + if (pressureAngle != "Custom") + { + _pressureAngleCustom->isVisible(false); + } + + _diaPitch = inputs->addValueInput("diaPitch", "Diametral Pitch", "", ValueInput::createByString(diaPitch)) ; + + _module = inputs->addValueInput("module", "Module", "", ValueInput::createByReal(metricModule)) ; + if (!checkReturn(_module)) + return; + + if (standard == "English") + { + _module->isVisible(false); + } + else if (standard == "Metric") + { + _diaPitch->isVisible(false); + } + + _numTeeth = inputs->addStringValueInput("numTeeth", "Number of Teeth", numTeeth); + if (!checkReturn(_pressureAngleCustom)) + return; + + _backlash = inputs->addValueInput("backlash", "Backlash", _units, ValueInput::createByReal(std::stod(backlash))); + if (!checkReturn(_backlash)) + return; + + _rootFilletRad = inputs->addValueInput("rootFilletRad", "Root Fillet Radius", _units, ValueInput::createByReal(std::stod(rootFilletRad))); + if (!checkReturn(_rootFilletRad)) + return; + + _thickness = inputs->addValueInput("thickness", "Gear Thickness", _units, ValueInput::createByReal(std::stod(thickness))); + if (!checkReturn(_thickness)) + return; + + _holeDiam = inputs->addValueInput("holeDiam", "Hole Diameter", _units,ValueInput::createByReal(std::stod(holeDiam))); + if (!checkReturn(_holeDiam)) + return; + + _pitchDiam = inputs->addTextBoxCommandInput("pitchDiam", "Pitch Diameter", "", 1, true); + if (!checkReturn(_pitchDiam)) + return; + + _errMessage = inputs->addTextBoxCommandInput("errMessage", "", "", 2, true); + if (!checkReturn(_errMessage)) + return; + _errMessage->isFullWidth(true); + + // Connect to the command related events. + Ptr inputChangedEvent = cmd->inputChanged(); + if (!inputChangedEvent) + return; + bool isOk = inputChangedEvent->add(&_gearCommandInputChanged); + if (!isOk) + return; + + Ptr validateInputsEvent = cmd->validateInputs(); + if (!validateInputsEvent) + return; + isOk = validateInputsEvent->add(&_gearCommandValidateInputs); + if (!isOk) + return; + + Ptr executeEvent = cmd->execute(); + if (!executeEvent) + return; + isOk = executeEvent->add(&_gearCommandExecute); + if (!isOk) + return; + } +} _gearCommandCreated; + + +extern "C" XI_EXPORT bool run(const char* context) +{ + _app = Application::get(); + if (!_app) + return false; + + _ui = _app->userInterface(); + if (!_ui) + return false; + + // Create a command definition and add a button to the CREATE panel. + Ptr cmdDef = _ui->commandDefinitions()->addButtonDefinition("adskSpurGearCPPAddIn", "Spur Gear", "Creates a spur gear component", "Resources/SpurGear"); + if (!checkReturn(cmdDef)) + return false; + + Ptr createPanel = _ui->allToolbarPanels()->itemById("SolidCreatePanel"); + if (!checkReturn(createPanel)) + return false; + + Ptr gearButton = createPanel->controls()->addCommand(cmdDef); + if (!checkReturn(gearButton)) + return false; + + // Connect to the command created event. + Ptr commandCreatedEvent = cmdDef->commandCreated(); + if (!checkReturn(commandCreatedEvent)) + return false; + + bool isOk = commandCreatedEvent->add(&_gearCommandCreated); + if (!isOk) + return false; + + std::string strContext = context; + if (strContext.find("IsApplicationStartup", 0) != std::string::npos) + { + if (strContext.find("false", 0) != std::string::npos) + { + _ui->messageBox("The \"Spur Gear\" command has been added\nto the CREATE panel of the MODEL workspace."); + } + } + + return true; +} + +extern "C" XI_EXPORT bool stop(const char* context) +{ + Ptr createPanel = _ui->allToolbarPanels()->itemById("SolidCreatePanel"); + if (!checkReturn(createPanel)) + return false; + + Ptr gearButton = createPanel->controls()->itemById("adskSpurGearCPPAddIn"); + if (checkReturn(gearButton)) + gearButton->deleteMe(); + + Ptr cmdDef = _ui->commandDefinitions()->itemById("adskSpurGearCPPAddIn"); + if (checkReturn(cmdDef)) + cmdDef->deleteMe(); + + return true; +} + + +bool is_digits(const std::string &str) +{ + return str.find_first_not_of("0123456789") == std::string::npos; +} + + +/* + * Verfies that a value command input has a valid expression and returns the + * value if it does. Otherwise it returns False. This works around a + * problem where when you get the value from a ValueCommandInput it causes the + * current expression to be evaluated and updates the display. Some new functionality + * is being added in the future to the ValueCommandInput object that will make + * this easier and should make this function obsolete. + */ +bool getCommandInputValue(Ptr commandInput, std::string unitType, double *value) +{ + Ptr valCommandInput = commandInput; + if (!commandInput) + { + *value = 0; + return false; + } + + // Verify that the expression is valid. + Ptr des = _app->activeProduct(); + Ptr unitsMgr = des->unitsManager(); + + if (unitsMgr->isValidExpression(valCommandInput->expression(), unitType)) + { + *value = unitsMgr->evaluateExpression(valCommandInput->expression(), unitType); + return true; + } + else + { + *value = 0; + return false; + } +} + + +// Calculate points along an involute curve. +Ptr involutePoint(double baseCircleRadius, double distFromCenterToInvolutePoint) +{ + // Calculate the other side of the right-angle triangle defined by the base circle and the current distance radius. + // This is also the length of the involute chord as it comes off of the base circle. + double triangleSide = sqrt(pow(distFromCenterToInvolutePoint, 2.0) - pow(baseCircleRadius, 2.0)); + + // Calculate the angle of the involute. + double alpha = triangleSide / baseCircleRadius; + + // Calculate the angle where the current involute point is. + double theta = alpha - acos(baseCircleRadius / distFromCenterToInvolutePoint); + + // Calculate the coordinates of the involute point. + double x = distFromCenterToInvolutePoint * cos(theta); + double y = distFromCenterToInvolutePoint * sin(theta); + + // Create a point to return. + return( adsk::core::Point3D::create(x, y, 0) ); +} + + +// Builds a spur gear. +Ptr drawGear(Ptr design, double diametralPitch, int numTeeth, double thickness, double rootFilletRad, double pressureAngle, double backlash, double holeDiam) +{ + // The diametral pitch is specified in inches but everthing + // here expects all distances to be in centimeters, so convert + // for the gear creation. + diametralPitch = diametralPitch / 2.54; + + // Compute the various values for a gear. + double pitchDia = (double)numTeeth / diametralPitch; + + //addendum = 1.0 / diametralPitch + double dedendum; + if (diametralPitch < (20 *(M_PI/180.0))-0.000001) + { + dedendum = 1.157 / diametralPitch; + } + else + { + double circularPitch = M_PI / diametralPitch; + if (circularPitch >= 20.0) + { + dedendum = 1.25 / diametralPitch; + } + else + { + dedendum = (1.2 / diametralPitch) + (.002 * 2.54); + } + } + + double rootDia = pitchDia - (2.0 * dedendum); + + double baseCircleDia = pitchDia * cos(pressureAngle); + double outsideDia = (double)(numTeeth + 2) / diametralPitch; + + // Create a new component by creating an occurrence. + Ptr occs = design->rootComponent()->occurrences(); + if (!checkReturn(occs)) + return nullptr; + + Ptr mat = adsk::core::Matrix3D::create(); + if (!checkReturn(mat)) + return nullptr; + + Ptr newOcc = occs->addNewComponent(mat); + if (!checkReturn(newOcc)) + return nullptr; + + Ptr newComp = newOcc->component(); + if (!checkReturn(newComp)) + return nullptr; + + // Create a new sketch. + Ptr sketches = newComp->sketches(); + if (!checkReturn(sketches)) + return nullptr; + + Ptr xyPlane = newComp->xYConstructionPlane(); + if (!checkReturn(xyPlane)) + return nullptr; + + Ptr baseSketch = sketches->add(xyPlane); + if (!checkReturn(xyPlane)) + return nullptr; + + // Draw a circle for the base. + baseSketch->sketchCurves()->sketchCircles()->addByCenterRadius(adsk::core::Point3D::create(0,0,0), rootDia/2.0); + if (!checkReturn(baseSketch)) + return nullptr; + + // Draw a circle for the center hole, if the value is greater than 0. + Ptr prof = nullptr; + if (holeDiam - (_app->pointTolerance() * 2) > 0) + { + Ptr circ = baseSketch->sketchCurves()->sketchCircles()->addByCenterRadius(adsk::core::Point3D::create(0,0,0), holeDiam/2.0); + if (!checkReturn(circ)) + return nullptr; + + // Find the profile that uses both circles. + for (Ptr tempProf : baseSketch->profiles()) + { + if (tempProf->profileLoops()->count() == 2) + { + prof = tempProf; + break; + } + } + } + else + { + // Use the single profile. + prof = baseSketch->profiles()->item(0); + } + + if (!checkReturn(prof)) + return nullptr; + + //////// Extrude the circle to create the base of the gear. + + // Create an extrusion input to be able to define the input needed for an extrusion + // while specifying the profile and that a new component is to be created + Ptr extrudes = newComp->features()->extrudeFeatures(); + if (!checkReturn(extrudes)) + return nullptr; + + Ptr extInput = extrudes->createInput(prof, NewBodyFeatureOperation); + if (!checkReturn(extInput)) + return nullptr; + + // Define that the extent is a distance extent of 5 cm. + Ptr distance = adsk::core::ValueInput::createByReal(thickness); + if (!checkReturn(distance)) + return nullptr; + + bool result = extInput->setDistanceExtent(false, distance); + if (!result) + return nullptr; + + // Create the extrusion. + Ptr baseExtrude = extrudes->add(extInput); + if (!checkReturn(baseExtrude)) + return nullptr; + + // Create a second sketch for the tooth. + Ptr toothSketch = sketches->add(xyPlane); + if (!checkReturn(toothSketch)) + return nullptr; + + // Calculate points along the involute curve. + int involutePointCount = 15; + double involuteIntersectionRadius = baseCircleDia / 2.0; + Ptr *involutePoints = new Ptr[involutePointCount]; + std::unique_ptr[]> involutePointsDeleter(involutePoints); + double involuteSize = (outsideDia - baseCircleDia) / 2.0; + for (int i=0; i newPoint = involutePoint(baseCircleDia / 2.0, involuteIntersectionRadius); + involutePoints[i] = newPoint; + } + + // Get the point along the tooth that's at the pictch diameter and then + // calculate the angle to that point. + Ptr pitchInvolutePoint = involutePoint(baseCircleDia / 2.0, pitchDia / 2.0); + double pitchPointAngle = atan(pitchInvolutePoint->y() / pitchInvolutePoint->x()); + + // Determine the angle defined by the tooth thickness as measured at + // the pitch diameter circle. + double toothThicknessAngle = (2.0 * M_PI) / (2.0 * (double)numTeeth); + + // Determine the angle needed for the specified backlash. + double backlashAngle = (backlash / (pitchDia / 2.0)) * 0.25; + + // Determine the angle to rotate the curve. + double rotateAngle = -((toothThicknessAngle/2.0) + pitchPointAngle - backlashAngle); + + // Rotate the involute so the middle of the tooth lies on the x axis. + double cosAngle = cos(rotateAngle); + double sinAngle = sin(rotateAngle); + for (int i=0; ix() * cosAngle - involutePoints[i]->y() * sinAngle; + double newY = involutePoints[i]->x() * sinAngle + involutePoints[i]->y() * cosAngle; + involutePoints[i] = adsk::core::Point3D::create(newX, newY, 0); + } + + // Create a new set of points with a negated y. This effectively mirrors the original + // points about the X axis. + Ptr *involute2Points = new Ptr[involutePointCount]; + std::unique_ptr[]> involute2PointsDeleter(involute2Points); + for (int i=0; ix(), -involutePoints[i]->y(), 0); + } + + double *curve1Angle = new double[involutePointCount]; + std::unique_ptr curve1AngleDeleter(curve1Angle); + for (int i=0; iy() / involutePoints[i]->x()); + } + + double *curve2Angle = new double[involutePointCount]; + std::unique_ptr curve2AngleDeleter(curve2Angle); + for (int i=0; iy() / involute2Points[i]->x()); + } + + toothSketch->isComputeDeferred(true); + + // Create and load an object collection with the points. + Ptr pointSet = adsk::core::ObjectCollection::create(); + for (int i=0; iadd(involutePoints[i]); + } + + // Create the first spline. + Ptr spline1 = toothSketch->sketchCurves()->sketchFittedSplines()->add(pointSet); + if (!checkReturn(spline1)) + return nullptr; + + // Add the involute points for the second spline to an ObjectCollection. + pointSet = adsk::core::ObjectCollection::create(); + for (int i=0; iadd(involute2Points[i]); + } + + // Create the second spline. + Ptr spline2 = toothSketch->sketchCurves()->sketchFittedSplines()->add(pointSet); + if (!checkReturn(spline2)) + return nullptr; + + // Draw the arc for the top of the tooth. + Ptr midPoint = adsk::core::Point3D::create((outsideDia / 2.0), 0, 0); + Ptr topArc = toothSketch->sketchCurves()->sketchArcs()->addByThreePoints(spline1->endSketchPoint(), midPoint, spline2->endSketchPoint()); + if (!checkReturn(topArc)) + return nullptr; + + // Check to see if involute goes down to the root or not. If not, then + // create lines to connect the involute to the root. + if (baseCircleDia < rootDia) + { + Ptr bottomLine = toothSketch->sketchCurves()->sketchLines()->addByTwoPoints(spline2->startSketchPoint(), spline1->startSketchPoint()); + if (!checkReturn(bottomLine)) + return nullptr; + } + else + { + Ptr rootPoint1 = adsk::core::Point3D::create((rootDia / 2 - 0.001) * cos(curve1Angle[0] ), (rootDia / 2) * sin(curve1Angle[0]), 0); + Ptr line1 = toothSketch->sketchCurves()->sketchLines()->addByTwoPoints(rootPoint1, spline1->startSketchPoint()); + if (!checkReturn(line1)) + return nullptr; + + Ptr rootPoint2 = adsk::core::Point3D::create((rootDia / 2 - 0.001) * cos(curve2Angle[0]), (rootDia / 2) * sin(curve2Angle[0]), 0); + Ptr line2 = toothSketch->sketchCurves()->sketchLines()->addByTwoPoints(rootPoint2, spline2->startSketchPoint()); + if (!checkReturn(line2)) + return nullptr; + + Ptr bottomLine = toothSketch->sketchCurves()->sketchLines()->addByTwoPoints(line1->startSketchPoint(), line2->startSketchPoint()); + if (!checkReturn(bottomLine)) + return nullptr; + + // Make the lines tangent to the spline so the root fillet will behave correctly. + if (!line1->isFixed(true)) + return nullptr; + + if (!line2->isFixed(true)) + return nullptr; + + Ptr geomConstraints = toothSketch->geometricConstraints(); + if (!checkReturn(geomConstraints)) + return nullptr; + + Ptr tangent = geomConstraints->addTangent(spline1, line1); + if (!checkReturn(tangent)) + return nullptr; + + tangent = geomConstraints->addTangent(spline2, line2); + if (!checkReturn(tangent)) + return nullptr; + } + + toothSketch->isComputeDeferred(false); + + ////// Extrude the tooth. + + // Get the profile defined by the tooth. + prof = toothSketch->profiles()->item(0); + if (!checkReturn(prof)) + return nullptr; + + // Create an extrusion input to be able to define the input needed for an extrusion + // while specifying the profile and that a new component is to be created + extInput = extrudes->createInput(prof, JoinFeatureOperation); + if (!checkReturn(extInput)) + return nullptr; + + // Define that the extent is a distance extent of 5 cm. + distance = adsk::core::ValueInput::createByReal(thickness); + if (!checkReturn(distance)) + return nullptr; + + result = extInput->setDistanceExtent(false, distance); + if (!result) + return nullptr; + + // Create the extrusion. + Ptr toothExtrude = extrudes->add(extInput); + if (!checkReturn(toothExtrude)) + return nullptr; + + Ptr baseFillet; + if (rootFilletRad > 0) + { + ////// Find the edges between the base cylinder and the tooth. + + // Get the outer cylindrical face from the base extrusion by checking the number + // of edges and if it's 2 get the other one. + Ptr cylFace = baseExtrude->sideFaces()->item(0); + if (cylFace->edges()->count() == 2) + { + cylFace = baseExtrude->sideFaces()->item(1); + } + if (!checkReturn(cylFace)) + return nullptr; + + // Get the two linear edges, which are the connection between the cylinder and tooth. + Ptr edges = adsk::core::ObjectCollection::create(); + for (Ptr edge : cylFace->edges()) + { + Ptr tempLine = edge->geometry(); + if (tempLine) + { + edges->add(edge); + } + } + + // Create a fillet input to be able to define the input needed for a fillet. + Ptr fillets = newComp->features()->filletFeatures(); + if (!checkReturn(fillets)) + return nullptr; + + Ptr filletInput = fillets->createInput(); + if (!checkReturn(filletInput)) + return nullptr; + + // Define that the extent is a distance extent of 5 cm. + Ptr radius = adsk::core::ValueInput::createByReal(rootFilletRad); + if (!checkReturn(radius)) + return nullptr; + + result = filletInput->addConstantRadiusEdgeSet(edges, radius, false); + if (!result) + return nullptr; + + // Create the extrusion. + baseFillet = fillets->add(filletInput); + if (!checkReturn(baseFillet)) + return nullptr; + } + + // Create a pattern of the tooth extrude and the base fillet. + Ptr circularPatterns = newComp->features()->circularPatternFeatures(); + if (!checkReturn(circularPatterns)) + return nullptr; + + Ptr entities = adsk::core::ObjectCollection::create(); + entities->add(toothExtrude); + if (baseFillet) + { + entities->add(baseFillet); + } + + Ptr cylFace = baseExtrude->sideFaces()->item(0); + if (!checkReturn(cylFace)) + return nullptr; + + Ptr patternInput = circularPatterns->createInput(entities, cylFace); + if (!checkReturn(patternInput)) + return nullptr; + + Ptr numTeethInput = adsk::core::ValueInput::createByString(std::to_string(numTeeth)); + if (!checkReturn(numTeethInput)) + return nullptr; + + patternInput->quantity(numTeethInput); + patternInput->patternComputeOption(adsk::fusion::PatternComputeOptions::IdenticalPatternCompute); + Ptr pattern = circularPatterns->add(patternInput); + if (!checkReturn(pattern)) + return nullptr; + + // Create an extra sketch that contains a circle of the diametral pitch. + Ptr diametralPitchSketch = sketches->add(xyPlane); + if (!checkReturn(diametralPitchSketch)) + return nullptr; + + Ptr diametralPitchCircle = diametralPitchSketch->sketchCurves()->sketchCircles()->addByCenterRadius(adsk::core::Point3D::create(0,0,0), pitchDia/2.0); + if (!checkReturn(diametralPitchCircle)) + return nullptr; + + diametralPitchCircle->isConstruction(true); + diametralPitchCircle->isFixed(true); + + // Group everything used to create the gear in the timeline. + Ptr timelineGroups = design->timeline()->timelineGroups(); + if (!checkReturn(timelineGroups)) + return nullptr; + + int newOccIndex = newOcc->timelineObject()->index(); + int pitchSketchIndex = diametralPitchSketch->timelineObject()->index(); + + Ptr timelineGroup = timelineGroups->add(newOccIndex, pitchSketchIndex); + if (!checkReturn(timelineGroup)) + return nullptr; + + timelineGroup->name("Spur Gear"); + + // Add an attribute to the component with all of the input values. This might + // be used in the future to be able to edit the gear. + std::string gearValues = "{"; + gearValues += "'pressureAngle': '" + std::to_string(pressureAngle) + "',"; + gearValues += "'numTeeth': '" + std::to_string(numTeeth) + "',"; + gearValues += "'backlash': '" + std::to_string(backlash) + "',"; + gearValues += "'holeDiam': '" + std::to_string(holeDiam) + "',"; + gearValues += "'thickness': '" + std::to_string(thickness) + "',"; + gearValues += "'rootFilletRad': '" + std::to_string(rootFilletRad) + "',"; + gearValues += "'diametralPitch': '" + std::to_string(diametralPitch * 2.54) + "'}"; + Ptr attrib = newComp->attributes()->add("SpurGear", "Values", gearValues); + if (!checkReturn(attrib)) + return nullptr; + + // Set the name of the component. + newComp->name("Spur Gear (" + std::to_string(numTeeth) + " teeth)"); + + return newComp; +} + + + +#ifdef XI_WIN + +#include + +BOOL APIENTRY DllMain(HMODULE hmodule, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +#endif // XI_WIN diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.dll b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.dll new file mode 100644 index 0000000..5569e6b Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.dll differ diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.dylib b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.dylib new file mode 100644 index 0000000..4382305 Binary files /dev/null and b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.dylib differ diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.manifest b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.manifest new file mode 100644 index 0000000..7024506 --- /dev/null +++ b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.manifest @@ -0,0 +1,15 @@ +{ + "autodeskProduct": "Fusion360", + "type": "addin", + "author": "", + "description": { + "": "" + }, + "supportedOS": "windows|mac", + "editEnabled": true, + "id": "0892cd63-96ba-473f-8600-aee5547d8205", + "version": "", + "runOnStartup": false, + "sourcewindows": "SpurGear.vcxproj", + "sourcemac": "SpurGear.xcodeproj" +} \ No newline at end of file diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.vcxproj b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.vcxproj new file mode 100644 index 0000000..8219d58 --- /dev/null +++ b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {D7CBB035-8CC0-4576-9C72-5076E079586B} + Win32Proj + SpurGear + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/include + + + Windows + true + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/lib + core.lib;fusion.lib;cam.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/include + + + Windows + true + true + true + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/lib + core.lib;fusion.lib;cam.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + NotUsing + NotUsing + + + + + true + true + + + + + + \ No newline at end of file diff --git a/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.xcodeproj/project.pbxproj b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c707caa --- /dev/null +++ b/usr/autodesk/CPP/AddInSamples/SpurGear/SpurGear.xcodeproj/project.pbxproj @@ -0,0 +1,269 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2BB196C61AD5940800164CD3 /* SpurGear.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB196C51AD5940800164CD3 /* SpurGear.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2BB196BE1AD586AA00164CD3 /* SpurGear.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = SpurGear.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + 2BB196C51AD5940800164CD3 /* SpurGear.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpurGear.cpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2BB196BB1AD586AA00164CD3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2BB196B51AD586AA00164CD3 = { + isa = PBXGroup; + children = ( + 2BB196C51AD5940800164CD3 /* SpurGear.cpp */, + 2BB196BF1AD586AA00164CD3 /* Products */, + ); + sourceTree = ""; + }; + 2BB196BF1AD586AA00164CD3 /* Products */ = { + isa = PBXGroup; + children = ( + 2BB196BE1AD586AA00164CD3 /* SpurGear.dylib */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2BB196BC1AD586AA00164CD3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2BB196BD1AD586AA00164CD3 /* SpurGear */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "SpurGear" */; + buildPhases = ( + 2BB196BA1AD586AA00164CD3 /* Sources */, + 2BB196BB1AD586AA00164CD3 /* Frameworks */, + 2BB196BC1AD586AA00164CD3 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SpurGear; + productName = SpurGear; + productReference = 2BB196BE1AD586AA00164CD3 /* SpurGear.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2BB196B61AD586AA00164CD3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = Autodesk; + }; + buildConfigurationList = 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "SpurGear" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 2BB196B51AD586AA00164CD3; + productRefGroup = 2BB196BF1AD586AA00164CD3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2BB196BD1AD586AA00164CD3 /* SpurGear */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 2BB196BA1AD586AA00164CD3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2BB196C61AD5940800164CD3 /* SpurGear.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2BB196C01AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/include", + ); + LIBRARY_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 2BB196C11AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/include", + ); + LIBRARY_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + SDKROOT = macosx; + }; + name = Release; + }; + 2BB196C31AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/core.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/fusion.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/cam.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Debug; + }; + 2BB196C41AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/core.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/fusion.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/cam.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "SpurGear" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C01AD586AA00164CD3 /* Debug */, + 2BB196C11AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "SpurGear" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C31AD586AA00164CD3 /* Debug */, + 2BB196C41AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2BB196B61AD586AA00164CD3 /* Project object */; +} diff --git a/usr/autodesk/CPP/Default/DEFAULT.cpp b/usr/autodesk/CPP/Default/DEFAULT.cpp new file mode 100644 index 0000000..729fcfa --- /dev/null +++ b/usr/autodesk/CPP/Default/DEFAULT.cpp @@ -0,0 +1,45 @@ + +#include +#include +#include + +using namespace adsk::core; +using namespace adsk::fusion; +using namespace adsk::cam; + +Ptr app; +Ptr ui; + +extern "C" XI_EXPORT bool run(const char* context) +{ + app = Application::get(); + if (!app) + return false; + + ui = app->userInterface(); + if (!ui) + return false; + + ui->messageBox("Hello script"); + + return true; +} + +#ifdef XI_WIN + +#include + +BOOL APIENTRY DllMain(HMODULE hmodule, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +#endif // XI_WIN diff --git a/usr/autodesk/CPP/Default/DEFAULT.dll b/usr/autodesk/CPP/Default/DEFAULT.dll new file mode 100644 index 0000000..104c860 Binary files /dev/null and b/usr/autodesk/CPP/Default/DEFAULT.dll differ diff --git a/usr/autodesk/CPP/Default/DEFAULT.dylib b/usr/autodesk/CPP/Default/DEFAULT.dylib new file mode 100644 index 0000000..c648927 Binary files /dev/null and b/usr/autodesk/CPP/Default/DEFAULT.dylib differ diff --git a/usr/autodesk/CPP/Default/DEFAULT.manifest b/usr/autodesk/CPP/Default/DEFAULT.manifest new file mode 100644 index 0000000..9907a3b --- /dev/null +++ b/usr/autodesk/CPP/Default/DEFAULT.manifest @@ -0,0 +1,10 @@ +{ + "autodeskProduct":"Fusion360", + "type":"script", + "author":"Autodesk Inc.", + "description":{ + "":"This is sample script." + }, + "supportedOS":"windows|mac", + "editEnabled": true +} \ No newline at end of file diff --git a/usr/autodesk/CPP/Default/DEFAULT.vcxproj b/usr/autodesk/CPP/Default/DEFAULT.vcxproj new file mode 100644 index 0000000..48df10c --- /dev/null +++ b/usr/autodesk/CPP/Default/DEFAULT.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {D7CBB035-8CC0-4576-9C72-5076E079586B} + Win32Proj + DEFAULT + + + + DynamicLibrary + true + v110 + Unicode + + + DynamicLibrary + false + v110 + true + Unicode + + + + + + + + + + + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + ../include + + + Windows + true + ../lib + core.lib;fusion.lib;cam.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + ../include + + + Windows + true + true + true + ../lib + core.lib;fusion.lib;cam.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + NotUsing + NotUsing + + + + + true + true + + + + + + \ No newline at end of file diff --git a/usr/autodesk/CPP/Default/DEFAULT.xcodeproj/project.pbxproj b/usr/autodesk/CPP/Default/DEFAULT.xcodeproj/project.pbxproj new file mode 100644 index 0000000..fdf8ba5 --- /dev/null +++ b/usr/autodesk/CPP/Default/DEFAULT.xcodeproj/project.pbxproj @@ -0,0 +1,269 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2BB196C61AD5940800164CD3 /* DEFAULT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB196C51AD5940800164CD3 /* DEFAULT.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2BB196BE1AD586AA00164CD3 /* DEFAULT.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "DEFAULT.dylib"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2BB196C51AD5940800164CD3 /* DEFAULT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "DEFAULT.cpp"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2BB196BB1AD586AA00164CD3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2BB196B51AD586AA00164CD3 = { + isa = PBXGroup; + children = ( + 2BB196C51AD5940800164CD3 /* DEFAULT.cpp */, + 2BB196BF1AD586AA00164CD3 /* Products */, + ); + sourceTree = ""; + }; + 2BB196BF1AD586AA00164CD3 /* Products */ = { + isa = PBXGroup; + children = ( + 2BB196BE1AD586AA00164CD3 /* DEFAULT.dylib */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2BB196BC1AD586AA00164CD3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2BB196BD1AD586AA00164CD3 /* DEFAULT */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "DEFAULT" */; + buildPhases = ( + 2BB196BA1AD586AA00164CD3 /* Sources */, + 2BB196BB1AD586AA00164CD3 /* Frameworks */, + 2BB196BC1AD586AA00164CD3 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "DEFAULT"; + productName = "DEFAULT"; + productReference = 2BB196BE1AD586AA00164CD3 /* DEFAULT.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2BB196B61AD586AA00164CD3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = Autodesk; + }; + buildConfigurationList = 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "DEFAULT" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 2BB196B51AD586AA00164CD3; + productRefGroup = 2BB196BF1AD586AA00164CD3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2BB196BD1AD586AA00164CD3 /* DEFAULT */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 2BB196BA1AD586AA00164CD3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2BB196C61AD5940800164CD3 /* DEFAULT.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2BB196C01AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$SRCROOT/../include", + ); + LIBRARY_SEARCH_PATHS = "$SRCROOT/../lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 2BB196C11AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$SRCROOT/../include", + ); + LIBRARY_SEARCH_PATHS = "$SRCROOT/../lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + SDKROOT = macosx; + }; + name = Release; + }; + 2BB196C31AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$SRCROOT/../lib/core.dylib", + "$SRCROOT/../lib/fusion.dylib", + "$SRCROOT/../lib/cam.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Debug; + }; + 2BB196C41AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$SRCROOT/../lib/core.dylib", + "$SRCROOT/../lib/fusion.dylib", + "$SRCROOT/../lib/cam.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "DEFAULT" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C01AD586AA00164CD3 /* Debug */, + 2BB196C11AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "DEFAULT" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C31AD586AA00164CD3 /* Debug */, + 2BB196C41AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2BB196B61AD586AA00164CD3 /* Project object */; +} diff --git a/usr/autodesk/CPP/DefaultAddIn/DEFAULT.cpp b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.cpp new file mode 100644 index 0000000..27255ac --- /dev/null +++ b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.cpp @@ -0,0 +1,58 @@ + +#include +#include +#include + + +using namespace adsk::core; +using namespace adsk::fusion; +using namespace adsk::cam; + +Ptr app; +Ptr ui; + +extern "C" XI_EXPORT bool run(const char* context) +{ + app = Application::get(); + if (!app) + return false; + + ui = app->userInterface(); + if (!ui) + return false; + + ui->messageBox("Hello addin"); + + return true; +} + +extern "C" XI_EXPORT bool stop(const char* context) +{ + if (ui) + { + ui->messageBox("Stop addin"); + ui = nullptr; + } + + return true; +} + + +#ifdef XI_WIN + +#include + +BOOL APIENTRY DllMain(HMODULE hmodule, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +#endif // XI_WIN diff --git a/usr/autodesk/CPP/DefaultAddIn/DEFAULT.dll b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.dll new file mode 100644 index 0000000..2be29f2 Binary files /dev/null and b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.dll differ diff --git a/usr/autodesk/CPP/DefaultAddIn/DEFAULT.dylib b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.dylib new file mode 100644 index 0000000..72804a2 Binary files /dev/null and b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.dylib differ diff --git a/usr/autodesk/CPP/DefaultAddIn/DEFAULT.manifest b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.manifest new file mode 100644 index 0000000..5861b21 --- /dev/null +++ b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.manifest @@ -0,0 +1,10 @@ +{ + "autodeskProduct":"Fusion360", + "type":"addin", + "author":"Autodesk Inc.", + "description":{ + "":"This is sample script." + }, + "supportedOS":"windows|mac", + "editEnabled": true +} \ No newline at end of file diff --git a/usr/autodesk/CPP/DefaultAddIn/DEFAULT.vcxproj b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.vcxproj new file mode 100644 index 0000000..48df10c --- /dev/null +++ b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {D7CBB035-8CC0-4576-9C72-5076E079586B} + Win32Proj + DEFAULT + + + + DynamicLibrary + true + v110 + Unicode + + + DynamicLibrary + false + v110 + true + Unicode + + + + + + + + + + + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + ../include + + + Windows + true + ../lib + core.lib;fusion.lib;cam.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + ../include + + + Windows + true + true + true + ../lib + core.lib;fusion.lib;cam.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + NotUsing + NotUsing + + + + + true + true + + + + + + \ No newline at end of file diff --git a/usr/autodesk/CPP/DefaultAddIn/DEFAULT.xcodeproj/project.pbxproj b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.xcodeproj/project.pbxproj new file mode 100644 index 0000000..17a5465 --- /dev/null +++ b/usr/autodesk/CPP/DefaultAddIn/DEFAULT.xcodeproj/project.pbxproj @@ -0,0 +1,269 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2BB196C61AD5940800164CD3 /* DEFAULT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB196C51AD5940800164CD3 /* DEFAULT.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2BB196BE1AD586AA00164CD3 /* DEFAULT.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = DEFAULT.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + 2BB196C51AD5940800164CD3 /* DEFAULT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DEFAULT.cpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2BB196BB1AD586AA00164CD3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2BB196B51AD586AA00164CD3 = { + isa = PBXGroup; + children = ( + 2BB196C51AD5940800164CD3 /* DEFAULT.cpp */, + 2BB196BF1AD586AA00164CD3 /* Products */, + ); + sourceTree = ""; + }; + 2BB196BF1AD586AA00164CD3 /* Products */ = { + isa = PBXGroup; + children = ( + 2BB196BE1AD586AA00164CD3 /* DEFAULT.dylib */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2BB196BC1AD586AA00164CD3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2BB196BD1AD586AA00164CD3 /* DEFAULT */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "DEFAULT" */; + buildPhases = ( + 2BB196BA1AD586AA00164CD3 /* Sources */, + 2BB196BB1AD586AA00164CD3 /* Frameworks */, + 2BB196BC1AD586AA00164CD3 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DEFAULT; + productName = DEFAULT; + productReference = 2BB196BE1AD586AA00164CD3 /* DEFAULT.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2BB196B61AD586AA00164CD3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = Autodesk; + }; + buildConfigurationList = 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "DEFAULT" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 2BB196B51AD586AA00164CD3; + productRefGroup = 2BB196BF1AD586AA00164CD3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2BB196BD1AD586AA00164CD3 /* DEFAULT */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 2BB196BA1AD586AA00164CD3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2BB196C61AD5940800164CD3 /* DEFAULT.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2BB196C01AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$SRCROOT/../include", + ); + LIBRARY_SEARCH_PATHS = "$SRCROOT/../lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 2BB196C11AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$SRCROOT/../include", + ); + LIBRARY_SEARCH_PATHS = "$SRCROOT/../lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + SDKROOT = macosx; + }; + name = Release; + }; + 2BB196C31AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$SRCROOT/../lib/core.dylib", + "$SRCROOT/../lib/fusion.dylib", + "$SRCROOT/../lib/cam.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Debug; + }; + 2BB196C41AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$SRCROOT/../lib/core.dylib", + "$SRCROOT/../lib/fusion.dylib", + "$SRCROOT/../lib/cam.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "DEFAULT" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C01AD586AA00164CD3 /* Debug */, + 2BB196C11AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "DEFAULT" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C31AD586AA00164CD3 /* Debug */, + 2BB196C41AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2BB196B61AD586AA00164CD3 /* Project object */; +} diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.cpp b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.cpp new file mode 100644 index 0000000..6b1bcc3 --- /dev/null +++ b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.cpp @@ -0,0 +1,1537 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using namespace adsk::core; +using namespace adsk::fusion; +using namespace adsk::cam; + +namespace { + const double pi = 4.0* atan(1.0); +} + +Ptr _app; +Ptr _ui; +Ptr _des; +Ptr _cgGroups; +Ptr _anchorPt; + +// Global +const std::string _commandId = "CustomGraphicsSample_CPP"; +const std::string _colorEffect_solid_id = "SolidColorEfect"; +const std::string _colorEffect_basicMaterial_id = "BasicMaterialColorEffect"; +const std::string _colorEffect_appearance_id = "AppearanceColorEffect"; +const std::string _colorEffect_vertex_id = "VertexColorEffect"; +const std::string _pointSetImage = "resources/16x16.png"; +const std::string _solidLine_id = "Solid Line"; +const std::string _centerLine_id = "Center Line"; +const std::string _dashedLine_id = "Dashed Line"; +const std::string _dotLine_id = "Dot Line"; +const std::string _phantomLine_id = "Phantom Line"; +const std::string _tracksLine_id = "Tracks Line"; +const std::string _zigZagLine_id = "ZigZag Line"; +int _numTeeth = 5; +double _thickness = 0.5 * 2.54; +double _scaleFactor = 10; // _scaleFactor is used to limit the size of pixel-scaled model + +// Global command inputs +Ptr _customGraphicsObj; +Ptr _colorEffects; +Ptr _red; +Ptr _green; +Ptr _blue; +Ptr _opacity; +Ptr _glossiness; +Ptr _selection; +Ptr _transform; +Ptr _materialLibList; +Ptr _appearanceList; +Ptr _appearanceFilter; +Ptr _coordTable; +Ptr _add; +Ptr _addStrip; +Ptr _delete; +Ptr _isLineStrip; +Ptr _lineStylePattern; +Ptr _lineStyleWeight; +Ptr _lineStyleScale; + +Ptr _viewPlacementGroup; +Ptr _viewCorner; +Ptr _viewScaleGroup; +Ptr _pixelScale; +Ptr _billboardingGroup; +Ptr _billboardingStyle; + +Ptr _text; +Ptr _textSize; +Ptr _textStyle; +Ptr _textFont; + +// Create the command definition. +static Ptr createCommandDefinition() +{ + Ptr commandDefinitions = _ui->commandDefinitions(); + if (!commandDefinitions) + return nullptr; + + // Be fault tolerant in case the command is already added. + Ptr cmDef = commandDefinitions->itemById(_commandId); + if (!cmDef) + { + cmDef = commandDefinitions->addButtonDefinition(_commandId, + "CustomGraphicsSample", + "Custom Graphics Sample"); + } + + return cmDef; +} + +// Add a row representing a coordinate (x, y, z) +static void addRow(Ptr tableInput) +{ + if (!tableInput) + return; + + static size_t rowNumber = 0; + std::stringstream rowId; + rowId << rowNumber; + Ptr tableChildInputs = tableInput->commandInputs(); + Ptr xValueInput = tableChildInputs->addValueInput(tableInput->id() + "_x" + rowId.str(), "Value", "cm", ValueInput::createByReal(static_cast(rowNumber))); + Ptr yValueInput = tableChildInputs->addValueInput(tableInput->id() + "_y" + rowId.str(), "Value", "cm", ValueInput::createByReal(static_cast(rowNumber))); + Ptr zValueInput = tableChildInputs->addValueInput(tableInput->id() + "_z" + rowId.str(), "Value", "cm", ValueInput::createByReal(static_cast(rowNumber))); + + int row = tableInput->rowCount(); + tableInput->addCommandInput(xValueInput, row, 0); + tableInput->addCommandInput(yValueInput, row, 1); + tableInput->addCommandInput(zValueInput, row, 2); + + rowNumber = rowNumber + 1; +} + +static void addLineStrip(Ptr tableInput) +{ + if (!tableInput) + return; + + static size_t stripNumber = 0; + std::stringstream stripId; + stripId << stripNumber; + + Ptr tableChildInputs = tableInput->commandInputs(); + Ptr strInput = tableChildInputs->addStringValueInput(tableInput->id() + "_strip" + stripId.str(), "Line Strip", "-- Line Strip --"); + if (!strInput) + return; + strInput->isReadOnly(true); + + int row = tableInput->rowCount(); + tableInput->addCommandInput(strInput, row, 0, 0, 2); + + stripNumber = stripNumber + 1; +} + +static void replaceItems(Ptr cmdInput, std::vector newItems) +{ + if (!cmdInput) + return; + Ptr listItems = cmdInput->listItems(); + if (!listItems) + return; + listItems->clear(); + Ptr itemNone = listItems->add("None", true); + if (!itemNone) + return; + itemNone->isSelected(true); + + if (newItems.size() > 0) { + for (std::string str : newItems) { + listItems->add(str, false); + } + if (listItems->count() > 1) { + Ptr item1 = listItems->item(1); + Ptr item0 = listItems->item(0); // item "None" + if (!item1 || !item0) + return; + item1->isSelected(true); + item0->deleteMe(); + } + } +} + +static std::vector getAppearancesFromLib(const std::string& libName, const std::string& filterExp) +{ + std::vector appearanceList; + + static std::map> appearanceMap; + if (appearanceMap.find(libName) != appearanceMap.end()) { + appearanceList = appearanceMap[libName]; + } + else { + if (!_app) + return std::vector(); + + // get appearances according to libName + Ptr matLibs = _app->materialLibraries(); + if (!matLibs) + return std::vector(); + Ptr matLib = matLibs->itemByName(libName); + if (!matLib) + return std::vector(); + Ptr appearances = matLib->appearances(); + if (!appearances) + return std::vector(); + + for (int i = 0; i < appearances->count(); ++i) { + if(Ptr appear = appearances->item(i)) + appearanceList.push_back(appear->name()); + } + appearanceMap[libName] = appearanceList; + } + + // apply filter + std::string lowerFilterExp(filterExp); + if (!filterExp.empty()) { + std::transform(filterExp.begin(), filterExp.end(), lowerFilterExp.begin(), ::tolower); + std::vector filteredList; + for (std::string appearanceName : appearanceList) { + std::string lowerName(appearanceName); + std::transform(appearanceName.begin(), appearanceName.end(), lowerName.begin(), ::tolower); + if (lowerName.find(lowerFilterExp) != std::string::npos) { + filteredList.push_back(appearanceName); + } + } + appearanceList = filteredList; + } + + return appearanceList; +} + +static bool hasAppearance(Ptr lib) +{ + if (!lib) + return false; + Ptr appearances = lib->appearances(); + if (!appearances || appearances->count() == 0) + return false; + + return true; +} + +static std::vector getMaterialLibNames() +{ + if (!_app) + return std::vector(); + Ptr libs = _app->materialLibraries(); + if (!libs) + return std::vector(); + + std::vector libNames; + for (int i = 0; i < libs->count(); ++i) { + if (Ptr lib = libs->item(i)) { + if (hasAppearance(lib)) { + libNames.push_back(lib->name()); + } + } + } + return libNames; +} + +static Ptr getAppearance(const std::string& libName, const std::string& appearanceName) +{ + if (appearanceName.empty() || appearanceName == "None" || !_app) + return nullptr; + + if (!_des) + return nullptr; + + Ptr appearances = _des->appearances(); + if (appearances) { + Ptr appearance = appearances->itemByName(appearanceName); + if (appearance) + return appearance; + } + + Ptr libs = _app->materialLibraries(); + if (!libs) + return nullptr; + Ptr lib = libs->itemByName(libName); + if (!lib) + return nullptr; + appearances = lib->appearances(); + if (!appearances) + return nullptr; + Ptr appearance = appearances->itemByName(appearanceName); + return appearance; +} + +static void applyLinesProperties(Ptr cgLines) +{ + if (!cgLines) + return; + if (_lineStylePattern && _lineStylePattern->selectedItem()) { + if (_lineStylePattern->selectedItem()->name() == _solidLine_id) + cgLines->lineStylePattern(continuousLineStylePattern); + else if (_lineStylePattern->selectedItem()->name() == _centerLine_id) + cgLines->lineStylePattern(centerLineStylePattern); + else if (_lineStylePattern->selectedItem()->name() == _dashedLine_id) + cgLines->lineStylePattern(dashedLineStylePattern); + else if (_lineStylePattern->selectedItem()->name() == _dotLine_id) + cgLines->lineStylePattern(dotLineStylePattern); + else if (_lineStylePattern->selectedItem()->name() == _dashedLine_id) + cgLines->lineStylePattern(dashedLineStylePattern); + else if (_lineStylePattern->selectedItem()->name() == _phantomLine_id) + cgLines->lineStylePattern(phantomLineStylePattern); + else if (_lineStylePattern->selectedItem()->name() == _tracksLine_id) + cgLines->lineStylePattern(tracksLineStylePattern); + else if (_lineStylePattern->selectedItem()->name() == _zigZagLine_id) + cgLines->lineStylePattern(zigzagLineStylePattern); + } + + if (_lineStyleWeight) + cgLines->weight(static_cast(_lineStyleWeight->valueOne())); + if (_lineStyleScale) + cgLines->lineStyleScale(static_cast(_lineStyleScale->valueOne())); +} + +static void applyColorEffect(Ptr cgEnt) +{ + if (!_des) + return; + if (!_colorEffects) + return; + + Ptr selected = _colorEffects->selectedItem(); + if (!selected) + return; + + std::string colorEffectName = selected->name(); + Ptr colorEffect = nullptr; + if (colorEffectName == _colorEffect_solid_id) { + int red = 255, green = 0, blue = 0; + if (_red) + red = _red->valueOne(); + if (_green) + green = _green->valueOne(); + if (_blue) + blue = _blue->valueOne(); + + if (Ptr solidColor = Color::create(red, green, blue, 255)) { + colorEffect = CustomGraphicsSolidColorEffect::create(solidColor); + } + } + else if (colorEffectName == _colorEffect_basicMaterial_id) { + Ptr diffuseColor = Color::create(0, 255, 0, 255); + Ptr ambientColor = Color::create(255, 0, 0, 255); + Ptr specularColor = Color::create(0, 0, 255, 255); + Ptr emissiveColor = Color::create(0, 0, 0, 255); + double glossiness = 5.0, opacity = 1.0; + if (_glossiness) + glossiness = _glossiness->valueOne(); + if (_opacity) + opacity = _opacity->valueOne(); + if (diffuseColor && ambientColor && specularColor && emissiveColor) { + colorEffect = CustomGraphicsBasicMaterialColorEffect::create(diffuseColor, ambientColor, specularColor, emissiveColor, glossiness, opacity); + } + } + else if (colorEffectName == _colorEffect_appearance_id) { + if (!_appearanceList || !_materialLibList) + return; + Ptr appearanceSelected = _appearanceList->selectedItem(); + Ptr libSelected = _materialLibList->selectedItem(); + if (!appearanceSelected || !libSelected) + return; + std::string appearanceName = appearanceSelected->name(); + std::string libName = libSelected->name(); + Ptr appearance = getAppearance(libName, appearanceName); + if (appearance) { + Ptr desAppearances = _des->appearances(); + if (!desAppearances) + return; + if (!desAppearances->itemByName(appearanceName)) { + appearance = desAppearances->addByCopy(appearance, appearanceName); + } + colorEffect = CustomGraphicsAppearanceColorEffect::create(appearance); + } + } + else if (colorEffectName == _colorEffect_vertex_id) { + colorEffect = CustomGraphicsVertexColorEffect::create(); + } + + if (colorEffect && cgEnt) + cgEnt->color(colorEffect); +} + +static void getCoordinatesFromTable(Ptr tableInput, std::vector& vecCoords, std::vector& vecStripLen) +{ + vecCoords.clear(); + vecStripLen.clear(); + if (_coordTable) { + int stripLen = 0; + for (int i = 0; i < _coordTable->rowCount(); ++i) { + if (Ptr xValueInput = tableInput->getInputAtPosition(i, 0)) { + Ptr yValueInput = tableInput->getInputAtPosition(i, 1); + Ptr zValueInput = tableInput->getInputAtPosition(i, 2); + if (yValueInput && zValueInput) { + vecCoords.push_back(xValueInput->value()); + vecCoords.push_back(yValueInput->value()); + vecCoords.push_back(zValueInput->value()); + ++stripLen; + } + } + else if (Ptr lineStripInput = tableInput->getInputAtPosition(i, 0)) { + vecStripLen.push_back(stripLen); + stripLen = 0; + } + } + vecStripLen.push_back(stripLen); + } +} + +static void changeColorEffectVisibility(const std::string& strColorEffectName) +{ + if (_red) + _red->isVisible(false); + if (_green) + _green->isVisible(false); + if (_blue) + _blue->isVisible(false); + if (_opacity) + _opacity->isVisible(false); + if (_glossiness) + _glossiness->isVisible(false); + if (_appearanceList) + _appearanceList->isVisible(false); + if (_materialLibList) + _materialLibList->isVisible(false); + if (_appearanceFilter) + _appearanceFilter->isVisible(false); + + if (strColorEffectName == _colorEffect_solid_id) { + if (_red) + _red->isVisible(true); + if (_green) + _green->isVisible(true); + if (_blue) + _blue->isVisible(true); + } + else if (strColorEffectName == _colorEffect_basicMaterial_id) { + if (_opacity) + _opacity->isVisible(true); + if (_glossiness) + _glossiness->isVisible(true); + } + else if (strColorEffectName == _colorEffect_appearance_id) { + if (_appearanceList) + _appearanceList->isVisible(true); + if (_materialLibList) + _materialLibList->isVisible(true); + if (_appearanceFilter) + _appearanceFilter->isVisible(true); + } +} + +static void changeLineStyleInputsVisibility(const std::string& patternName) +{ + if (patternName == _solidLine_id) + _lineStyleScale->isVisible(false); + else + _lineStyleScale->isVisible(true); +} + +static void changeCGObjVisibility(const std::string& strObjName) +{ + if (_colorEffects) { + if (Ptr listItems = _colorEffects->listItems()) { + listItems->clear(); + listItems->add(_colorEffect_solid_id, true); + listItems->add(_colorEffect_basicMaterial_id, false); + listItems->add(_colorEffect_appearance_id, false); + } + _colorEffects->isVisible(false); + } + if (_selection) { + _selection->clearSelection(); + _selection->clearSelectionFilter(); + _selection->setSelectionLimits(0, 0); + _selection->isVisible(false); + _selection->isEnabled(false); + } + if (_text) + _text->isVisible(false); + if (_coordTable) + _coordTable->isVisible(false); + if (_isLineStrip) + _isLineStrip->isVisible(false); + if (_lineStylePattern) + _lineStylePattern->isVisible(false); + if (_lineStyleWeight) + _lineStyleWeight->isVisible(false); + if (_lineStyleScale) + _lineStyleScale->isVisible(false); + + changeColorEffectVisibility("None"); + + _viewPlacementGroup->isVisible(false); + _viewScaleGroup->isVisible(false); + _billboardingGroup->isVisible(false); + + if (strObjName == "Mesh") { + if (_colorEffects) { + _colorEffects->isVisible(true); + if (Ptr listItems = _colorEffects->listItems()) { + listItems->add(_colorEffect_vertex_id, false); + } + changeColorEffectVisibility(_colorEffect_solid_id); + _viewPlacementGroup->isVisible(true); + _viewScaleGroup->isVisible(true); + _billboardingGroup->isVisible(true); + } + } + else if (strObjName == "Lines") { + changeColorEffectVisibility(_colorEffect_solid_id); + _lineStylePattern->isVisible(true); + _lineStyleWeight->isVisible(true); + if (_lineStylePattern->selectedItem()->name() == _solidLine_id) { + _lineStyleScale->isVisible(true); + } + _viewPlacementGroup->isVisible(true); + _viewScaleGroup->isVisible(true); + _billboardingGroup->isVisible(true); + } + else if (strObjName == "Curve") { + if (_selection) { + _selection->isVisible(true); + _selection->isEnabled(true); + _selection->tooltip("select a sketch curve"); + _selection->commandPrompt("select a sketch curve"); + _selection->addSelectionFilter("SketchCurve"); + _selection->setSelectionLimits(1, 1); + changeColorEffectVisibility(_colorEffect_solid_id); + _lineStyleWeight->isVisible(true); + } + _viewPlacementGroup->isVisible(true); + _viewScaleGroup->isVisible(true); + _billboardingGroup->isVisible(true); + } + else if (strObjName == "BRep") { + if (_colorEffects) + _colorEffects->isVisible(true); + if (_selection) { + _selection->isVisible(true); + _selection->isEnabled(true); + _selection->tooltip("select a BRep body"); + _selection->commandPrompt("select a BRep body"); + _selection->addSelectionFilter("Bodies"); + _selection->setSelectionLimits(1, 1); + changeColorEffectVisibility(_colorEffect_solid_id); + } + _viewPlacementGroup->isVisible(true); + _viewScaleGroup->isVisible(true); + _billboardingGroup->isVisible(true); + } + else if (strObjName == "Text") { + if (_text) + _text->isVisible(true); + if (_textSize) + _textSize->isVisible(true); + if (_textStyle) + _textStyle->isVisible(true); + if (_textFont) + _textFont->isVisible(true); + } + else if (strObjName == "PointSet - Custom") { + if (_coordTable) + _coordTable->isVisible(true); + if (_addStrip) + _addStrip->isEnabled(false); + } + else if (strObjName == "Lines - Custom") { + if (_coordTable) + _coordTable->isVisible(true); + if (_isLineStrip) + _isLineStrip->isVisible(true); + if (_addStrip) + _addStrip->isEnabled(true); + changeColorEffectVisibility(_colorEffect_solid_id); + _lineStylePattern->isVisible(true); + _lineStyleWeight->isVisible(true); + if (_lineStylePattern->selectedItem()->name() == _solidLine_id) { + _lineStyleScale->isVisible(true); + } + } +} + +static Ptr rotate2D(double rad, Ptr vec) +{ + if (!vec) + return Vector2D::create(); + double x = vec->x(); + double y = vec->y(); + + double newX = x * cos(rad) - y * sin(rad); + double newY = x * sin(rad) + y * cos(rad); + return Vector2D::create(newX, newY); +} + +static void calculateCoordinates(int numTeeth, + /*out*/std::vector& rPts0, /*out*/std::vector& hPts0,/*out*/std::vector& pPts0,/*out*/std::vector& oPts0, + /*out*/std::vector& rPts1, /*out*/std::vector& hPts1,/*out*/std::vector& pPts1,/*out*/std::vector& oPts1, + /*out*/std::vector& vecCoords, /*out*/std::vector& vecColors) +{ + if (numTeeth < 3) + return; + // holeDia < rootDia < pitchDia < outsideDia + double holeDia = 0.5 * 2.54, diametralPitch = 2 / 2.54; + double pitchDia = _numTeeth / diametralPitch; + double dedendum = 1.157 / diametralPitch; + if (fabs((20 * (pi / 180)) - diametralPitch) < 1e-6) { + double circularPitch = pi / diametralPitch; + if (circularPitch >= 20) + dedendum = 1.25 / diametralPitch; + else + dedendum = (1.2 / diametralPitch) + (.002 * 2.54); + } + double rootDia = pitchDia - (2 * dedendum); + double outsideDia = (_numTeeth + 2) / diametralPitch; + + Ptr vecRootRadi = Vector2D::create(rootDia / 2, 0); + Ptr vecHoleRadi = Vector2D::create(holeDia / 2, 0); + Ptr vecPitchRadi = Vector2D::create(pitchDia / 2, 0); + Ptr vecOutRadi = Vector2D::create(outsideDia / 2, 0); + double unitRadian = pi / numTeeth; + + for (int i = 0; i < 2 * numTeeth; ++i) { + if (Ptr pos = rotate2D(unitRadian * (i - 0.5), vecRootRadi)) { + double x = pos->x(), y = pos->y(); + rPts0.push_back(static_cast(vecCoords.size() / 3)); + rPts1.push_back(static_cast(vecCoords.size() / 3 + 1)); + vecCoords.insert(vecCoords.end(), { x, y, 0, x, y, _thickness }); + vecColors.insert(vecColors.end(), { 255,0,255,128, 255,0,255,128 }); + } + } + for (int i = 0; i < 2 * numTeeth; ++i) { + if (Ptr pos = rotate2D(unitRadian * (i - 0.5), vecHoleRadi)) { + double x = pos->x(), y = pos->y(); + hPts0.push_back(static_cast(vecCoords.size() / 3)); + hPts1.push_back(static_cast(vecCoords.size() / 3 + 1)); + vecCoords.insert(vecCoords.end(), { x, y, 0, x, y, _thickness }); + vecColors.insert(vecColors.end(), { 255,0,0,128, 255,0,0,128 }); + } + } + for (int i = 0; i < 2 * numTeeth; ++i) { + if (Ptr pos = rotate2D(unitRadian * (i - 0.5), vecPitchRadi)) { + double x = pos->x(), y = pos->y(); + pPts0.push_back(static_cast(vecCoords.size() / 3)); + pPts1.push_back(static_cast(vecCoords.size() / 3 + 1)); + vecCoords.insert(vecCoords.end(), { x, y, 0, x, y, _thickness }); + vecColors.insert(vecColors.end(), { 0,0,255,128, 0,0,255,128 }); + } + } + for (int i = 0; i < numTeeth; ++i) { + if (Ptr pos = rotate2D(unitRadian * i * 2, vecOutRadi)) { + double x = pos->x(), y = pos->y(); + oPts0.push_back(static_cast(vecCoords.size() / 3)); + oPts1.push_back(static_cast(vecCoords.size() / 3 + 1)); + vecCoords.insert(vecCoords.end(), { x, y, 0, x, y, _thickness }); + vecColors.insert(vecColors.end(), { 0,255,255,128, 0,255,255,128 }); + } + } +} + +static std::vector calculateStripLen(int numTeeth) +{ + if (numTeeth < 3) + return std::vector(); + + std::vector vecStripLen; + for (int i = 0; i < numTeeth; ++i) + vecStripLen.push_back(6); + for (int i = 0; i < 2*numTeeth; ++i) + vecStripLen.push_back(21); + for (int i = 0; i < numTeeth; ++i) + vecStripLen.push_back(24); + for (int i = 0; i < 2*numTeeth; ++i) + vecStripLen.push_back(6); + return vecStripLen; +} + +static std::vector calculateTriangles(int numTeeth, + std::vector rPts0, std::vector hPts0, std::vector pPts0, std::vector oPts0, + std::vector rPts1, std::vector hPts1, std::vector pPts1, std::vector oPts1) +{ + if (numTeeth < 3) + return std::vector(); + + std::vector vertexIndexList; + // triangles between teeth + for (int i = 0; i < numTeeth; ++i) { + int idx0 = (2 * i + 1) % (2 * numTeeth); + int idx1 = (2 * i + 2) % (2 * numTeeth); + int rPtA0 = rPts0[idx0]; + int rPtB0 = rPts0[idx1]; + int rPtA1 = rPts1[idx0]; + int rPtB1 = rPts1[idx1]; + vertexIndexList.insert(vertexIndexList.end(), { rPtA0,rPtB0,rPtB1, rPtB1,rPtA1,rPtA0 }); + } + + // triangles on surface0 + for (int i = 0; i < numTeeth; ++i) { + int rPtA = rPts0[i * 2]; + int rPtB = rPts0[i * 2 + 1]; + int rPtC = rPts0[(i * 2 + 2) % (2 * numTeeth)]; + int hPtA = hPts0[i * 2]; + int hPtB = hPts0[i * 2 + 1]; + int hPtC = hPts0[(i * 2 + 2) % (2 * numTeeth)]; + int pPtA = pPts0[i * 2]; + int pPtB = pPts0[i * 2 + 1]; + int oPt = oPts0[i]; + vertexIndexList.insert(vertexIndexList.end(), + { hPtB,hPtC,rPtC, rPtC,rPtB,hPtB, + rPtA,rPtB,pPtB, pPtB,pPtA,rPtA, + hPtA,hPtB,rPtB, rPtB,rPtA,hPtA, + pPtA,pPtB,oPt }); + } + + // triangles on surface1 + for (int i = 0; i < numTeeth; ++i) { + int rPtA = rPts1[i * 2]; + int rPtB = rPts1[i * 2 + 1]; + int rPtC = rPts1[(i * 2 + 2) % (2 * numTeeth)]; + int hPtA = hPts1[i * 2]; + int hPtB = hPts1[i * 2 + 1]; + int hPtC = hPts1[(i * 2 + 2) % (2 * numTeeth)]; + int pPtA = pPts1[i * 2]; + int pPtB = pPts1[i * 2 + 1]; + int oPt = oPts1[i]; + vertexIndexList.insert(vertexIndexList.end(), + { hPtC,hPtB,rPtB, rPtB,rPtC,hPtC, + rPtB,rPtA,pPtA, pPtA,pPtB,rPtB, + hPtB,hPtA,rPtA, rPtA,rPtB,hPtB, + pPtB,pPtA,oPt }); + } + + // triangles on teeth + for (int i = 0; i < numTeeth; ++i) { + int rPtA0 = rPts0[i * 2]; + int rPtB0 = rPts0[i * 2 + 1]; + int pPtA0 = pPts0[i * 2]; + int pPtB0 = pPts0[i * 2 + 1]; + int rPtA1 = rPts1[i * 2]; + int rPtB1 = rPts1[i * 2 + 1]; + int pPtA1 = pPts1[i * 2]; + int pPtB1 = pPts1[i * 2 + 1]; + int oPt0 = oPts0[i]; + int oPt1 = oPts1[i]; + vertexIndexList.insert(vertexIndexList.end(), + { rPtA1, rPtA0, pPtA0, pPtA0, pPtA1, rPtA1, + pPtA1, pPtA0, oPt0, oPt0, oPt1, pPtA1, + rPtB0, rPtB1, pPtB1, pPtB1, pPtB0, rPtB0, + pPtB0, pPtB1, oPt1, oPt1, oPt0, pPtB0 }); + } + + // triangles on inner face + for (int i = 0; i < 2 * numTeeth; ++i) { + int hPtA0 = hPts0[i]; + int hPtB0 = hPts0[(i + 1) % (2 * numTeeth)]; + int hPtA1 = hPts1[i]; + int hPtB1 = hPts1[(i + 1) % (2 * numTeeth)]; + vertexIndexList.insert(vertexIndexList.end(), + { hPtA1,hPtB1,hPtB0, hPtB0,hPtA0,hPtA1 }); + } + + return vertexIndexList; +} + +static Ptr drawMesh(const Ptr& cgGroup) +{ + // Calculate mesh coordinates + std::vector rPts0, hPts0, pPts0, oPts0, rPts1, hPts1, pPts1, oPts1; + std::vector vecColors; + std::vector vecCoords; + calculateCoordinates(_numTeeth, rPts0, hPts0, pPts0, oPts0, rPts1, hPts1, pPts1, oPts1, vecCoords, vecColors); + Ptr coordinates = CustomGraphicsCoordinates::create(vecCoords); + if (!coordinates) + return nullptr; + coordinates->colors(vecColors); + + // Calculate mesh triangles + std::vector vertexIndexList = calculateTriangles(_numTeeth, rPts0, hPts0, pPts0, oPts0, rPts1, hPts1, pPts1, oPts1); + // Add Custom Graphics mesh + if (!cgGroup) + return nullptr; + return cgGroup->addMesh(coordinates, vertexIndexList, std::vector(), std::vector()); +} + +static Ptr drawLines(const Ptr& cgGroup) +{ + if (!cgGroup) + return nullptr; + + // Calculate lines coordinates + std::vector rPts0, hPts0, pPts0, oPts0, rPts1, hPts1, pPts1, oPts1; + std::vector vecColors; + std::vector vecCoords; + calculateCoordinates(_numTeeth, rPts0, hPts0, pPts0, oPts0, rPts1, hPts1, pPts1, oPts1, vecCoords, vecColors); + Ptr coordinates = CustomGraphicsCoordinates::create(vecCoords); + if (!coordinates) + return nullptr; + + // Calculate lines triangles + std::vector vertexIndexList = calculateTriangles(_numTeeth, rPts0, hPts0, pPts0, oPts0, rPts1, hPts1, pPts1, oPts1); + + // Calculate lines strip length + std::vector vecStripLen = calculateStripLen(_numTeeth); + + Ptr cgLines = cgGroup->addLines(coordinates, vertexIndexList, true, vecStripLen); + return cgLines; +} + +static Ptr drawPointSet(const Ptr& cgGroup) +{ + if (!cgGroup) + return nullptr; + + // Calculate coordinates + std::vector rPts0, hPts0, pPts0, oPts0, rPts1, hPts1, pPts1, oPts1; + std::vector vecColors; + std::vector vecCoords; + calculateCoordinates(_numTeeth, rPts0, hPts0, pPts0, oPts0, rPts1, hPts1, pPts1, oPts1, vecCoords, vecColors); + Ptr coordinates = CustomGraphicsCoordinates::create(vecCoords); + if (!coordinates) + return nullptr; + + return cgGroup->addPointSet(coordinates, std::vector(), UserDefinedCustomGraphicsPointType, _pointSetImage); +} + +// CommandExecuted event handler. +class OnExecuteEventHandler : public adsk::core::CommandEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + // get selection entity first since it's fragile and any creation/edit operations will clear the selection. + Ptr selEntity = nullptr; + if (_selection && _selection->selectionCount() > 0) { + if (Ptr sel0 = _selection->selection(0)) { + selEntity = sel0->entity(); + } + } + + if (_customGraphicsObj) { + if (!_cgGroups) + return; + Ptr cgGroup = _cgGroups->add(); + if (!cgGroup) + return; + + if (!_anchorPt) + _anchorPt = Point3D::create(); + + Ptr cgEnt = nullptr; + Ptr selectedCGObj = _customGraphicsObj->selectedItem(); + if (!selectedCGObj) + return; + std::string cgObjName = selectedCGObj->name(); + if (cgObjName == "Mesh") { + cgEnt = drawMesh(cgGroup); + _anchorPt->setWithArray({ 0, 0, _thickness / 2 }); + } + else if (cgObjName == "Lines") { + cgEnt = drawLines(cgGroup); + _anchorPt->setWithArray({ 0, 0, _thickness / 2 }); + applyLinesProperties(cgEnt); + } + else if (cgObjName == "PointSet") { + cgEnt = drawPointSet(cgGroup); + } + else if (cgObjName == "BRep") { + if (Ptr body = selEntity->cast()) { + cgEnt = cgGroup->addBRepBody(body); + } + } + else if (cgObjName == "Curve") { + if (Ptr skCurve = selEntity->cast()) { + if (Ptr sk = skCurve->parentSketch()) { + Ptr curv = nullptr; + if (Ptr skArc = skCurve->cast()) + curv = skArc->geometry(); + else if (Ptr skEllipArc = skCurve->cast()) + curv = skEllipArc->geometry(); + else if (Ptr skCircle = skCurve->cast()) + curv = skCircle->geometry(); + else if (Ptr skEllipse = skCurve->cast()) + curv = skEllipse->geometry(); + else if (Ptr skLine = skCurve->cast()) + curv = skLine->geometry(); + else if (Ptr skSpline = skCurve->cast()) + curv = skSpline->geometry(); + + if (curv) { + curv->transformBy(sk->transform()); + Ptr cgCurve = cgGroup->addCurve(curv); + cgEnt = cgCurve; + if (cgCurve) + cgCurve->weight(static_cast(_lineStyleWeight->valueOne())); + } + } + } + } + else if (cgObjName == "Text") { + if (_text) { + std::string font = _textFont ? _textFont->value() : "Arial"; + double size = _textSize ? _textSize->value() : 1.0; + cgEnt = cgGroup->addText(_text->value(), font, size, Matrix3D::create()); + if (!cgEnt) + cgEnt = cgGroup->addText(_text->value(), "Arial", size, Matrix3D::create()); + Ptr cgText = cgEnt; + if (cgText && _textStyle) { + Ptr items = _textStyle->listItems(); + if (items) { + for (size_t i = 0; i < items->count(); ++i) { + Ptr item = items->item(i); + if (!item) + continue; + if (item->name() == "Bold") + cgText->isBold(item->isSelected()); + else if (item->name() == "Italic") + cgText->isItalic(item->isSelected()); + else if (item->name() == "UnderLine") + cgText->isUnderline(item->isSelected()); + else if (item->name() == "StrikeThrough") + cgText->isStrikeThrough(item->isSelected()); + } + } + } + } + } + else if (cgObjName == "PointSet - Custom") { + if (_coordTable) { + std::vector vecCoords; + std::vector vecStripLen; + getCoordinatesFromTable(_coordTable, vecCoords, vecStripLen); + Ptr coordinates = CustomGraphicsCoordinates::create(vecCoords); + cgEnt = cgGroup->addPointSet(coordinates, std::vector(), UserDefinedCustomGraphicsPointType, _pointSetImage); + } + } + else if (cgObjName == "Lines - Custom") { + if (_coordTable) { + std::vector vecCoords; + std::vector vecStripLen; + getCoordinatesFromTable(_coordTable, vecCoords, vecStripLen); + Ptr coordinates = CustomGraphicsCoordinates::create(vecCoords); + bool isLineStrip = true; + if (_isLineStrip) + isLineStrip = _isLineStrip->value(); + cgEnt = cgGroup->addLines(coordinates, std::vector(), isLineStrip, vecStripLen); + applyLinesProperties(cgEnt); + } + } + + // add attributes to the custom graphics entity + if (cgEnt) { + // color effect + if (!cgEnt->cast() && !cgEnt->cast()) // do not apply effect to point set and text node + applyColorEffect(cgEnt); + // transform + Ptr transMat = Matrix3D::create(); + double transformDistance = 1.0; + if (_transform) + transformDistance = _transform->value(); + Ptr origin = Point3D::create(transformDistance, 0, 0); + if (transMat && origin) { + transMat->setWithCoordinateSystem(origin, Vector3D::create(1, 0, 0), Vector3D::create(0, 1, 0), Vector3D::create(0, 0, 1)); + cgEnt->transform(transMat); + } + // calculate _scaleFactor and _anchorPt for viewPlacement, viewScale and billboarding attributes based on the bounding box of custom graphics entity + if (Ptr bbox = cgEnt->boundingBox()) { + Ptr maxPt = bbox->maxPoint(); + Ptr minPt = bbox->minPoint(); + if (maxPt && minPt) { + _scaleFactor = 100 / minPt->distanceTo(maxPt); + _anchorPt->setWithArray({ (minPt->x() + maxPt->x()) / 2, (minPt->y() + maxPt->y()) / 2, (minPt->z() + maxPt->z()) / 2 }); + } + } + // view placement + if (_viewPlacementGroup && _viewPlacementGroup->isVisible() && _viewPlacementGroup->isEnabledCheckBoxChecked() && _viewCorner && _viewCorner->selectedItem()) + { + Ptr viewPt = Point2D::create(100, 100); + // upper left corner by default + ViewCorners corner = ViewCorners::upperLeftViewCorner; + Ptr selected = _viewCorner->selectedItem(); + if (selected->name() == "Upper Right") + corner = ViewCorners::upperRightViewCorner; + else if (selected->name() == "Lower Left") + corner = ViewCorners::lowerLeftViewCorner; + else if (selected->name() == "Lower Right") + corner = ViewCorners::lowerRightViewCorner; + Ptr attr = CustomGraphicsViewPlacement::create(_anchorPt, corner, viewPt); + cgEnt->viewPlacement(attr); + } + // view scale + if (_viewScaleGroup && _viewScaleGroup->isVisible() && _viewScaleGroup->isEnabledCheckBoxChecked() && _pixelScale) + { + Ptr attr = CustomGraphicsViewScale::create(_scaleFactor * _pixelScale->valueOne(), _anchorPt); + cgEnt->viewScale(attr); + } + // billboarding + if (_billboardingGroup && _billboardingGroup->isVisible() && _billboardingGroup->isEnabledCheckBoxChecked() && _billboardingStyle && _billboardingStyle->selectedItem()) + { + // screen style by default + CustomGraphicsBillBoardStyles bbStyle = CustomGraphicsBillBoardStyles::ScreenBillBoardStyle; + Ptr selected = _billboardingStyle->selectedItem(); + if (selected->name() == "Axis") + bbStyle = CustomGraphicsBillBoardStyles::AxialBillBoardStyle; + else if (selected->name() == "Right Reading") + bbStyle = CustomGraphicsBillBoardStyles::RightReadingBillBoardStyle; + Ptr attr = CustomGraphicsBillBoard::create(_anchorPt); + attr->axis(Vector3D::create(0, 1, 0)); + attr->billBoardStyle(bbStyle); + cgEnt->billBoarding(attr); + } + } + } + } +}; + +// InputChange event handler. +class OnInputChangedEventHander : public adsk::core::InputChangedEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + if (!eventArgs) + return; + + Ptr changedInput = eventArgs->input(); + if (!changedInput) + return; + + std::string changedInputId = changedInput->id(); + if (changedInputId == _commandId + "_cgObj") { + if (_customGraphicsObj) { + if (Ptr selectedItem = _customGraphicsObj->selectedItem()) { + changeCGObjVisibility(selectedItem->name()); + } + } + } + else if (changedInputId == _commandId + "_colorEffects") { + if (_colorEffects) { + if (Ptr selectedItem = _colorEffects->selectedItem()) { + changeColorEffectVisibility(selectedItem->name()); + } + } + } + else if (changedInputId == _commandId + "_appearanceFilter" || changedInputId == _commandId + "_materialLib") { + std::string libName(""), filterExp(""); + if (_materialLibList) { + if (Ptr selectedItem = _materialLibList->selectedItem()) { + libName = selectedItem->name(); + } + } + if (_appearanceFilter) { + filterExp = _appearanceFilter->value(); + } + std::vector appearanceNames = getAppearancesFromLib(libName, filterExp); + if (_appearanceList) { + replaceItems(_appearanceList, appearanceNames); + } + } + else if (_coordTable && changedInputId == _coordTable->id() + "_add") { + addRow(_coordTable); + } + else if (_coordTable && changedInputId == _coordTable->id() + "_addStrip") { + addLineStrip(_coordTable); + } + else if (_coordTable && changedInputId == _coordTable->id() + "_delete") { + int selectedRowNo = _coordTable->selectedRow(); + if (selectedRowNo == -1) { + _ui->messageBox("Select one row to delete"); + } + else { + _coordTable->deleteRow(selectedRowNo); + } + } + else if (_lineStylePattern && changedInputId == _commandId + "_LSPattern") { + changeLineStyleInputsVisibility(_lineStylePattern->selectedItem()->name()); + } + } +}; + +// CommandDestroyed event handler +class OnDestroyEventHandler : public adsk::core::CommandEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + adsk::terminate(); + } +}; + +// CommandCreated event handler. +class CommandCreatedEventHandler : public adsk::core::CommandCreatedEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + if (eventArgs) + { + Ptr command = eventArgs->command(); + if (command) + { + Ptr onDestroy = command->destroy(); + if (!onDestroy) + return; + bool isOk = onDestroy->add(&onDestroyHandler_); + if (!isOk) + return; + + Ptr onInputChanged = command->inputChanged(); + if (!onInputChanged) + return; + isOk = onInputChanged->add(&onInputChangedHandler_); + if (!isOk) + return; + + Ptr onExecute = command->execute(); + if (!onExecute) + return; + isOk = onExecute->add(&onExecuteHandler_); + if (!isOk) + return; + + Ptr onExecutePtrview = command->executePreview(); + if (!onExecutePtrview) + return; + isOk = onExecutePtrview->add(&onExecuteHandler_); + if (!isOk) + return; + + Ptr inputs = command->commandInputs(); + if (!inputs) + return; + + // menu for different kinds of custom graphics + _customGraphicsObj = inputs->addDropDownCommandInput(_commandId + "_cgObj", "Custom Graphics Object", DropDownStyles::TextListDropDownStyle); + if (_customGraphicsObj) { + Ptr listItems = _customGraphicsObj->listItems(); + if (listItems) { + listItems->add("Mesh", true); + listItems->add("Lines", false); + listItems->add("PointSet", false); + listItems->add("Curve", false); + listItems->add("BRep", false); + listItems->add("Text", false); + listItems->add("Lines - Custom", false); + listItems->add("PointSet - Custom", false); + } + } + + // coordinates table used by 'Lines - Custom' and 'PointSet - Custom' + _coordTable = inputs->addTableCommandInput(_commandId + "_table", "Coordinates Table", 3, "1:1:1"); + if (_coordTable) { + _coordTable->maximumVisibleRows(10); + addRow(_coordTable); + Ptr addButtonInput = inputs->addBoolValueInput(_coordTable->id() + "_add", "Add", false, "", true); + if (addButtonInput) { + _coordTable->addToolbarCommandInput(addButtonInput); + addButtonInput->isVisible(false); + } + Ptr addStripButtonInput = inputs->addBoolValueInput(_coordTable->id() + "_addStrip", "Add Strip", false, "", true); + if (addStripButtonInput) { + _coordTable->addToolbarCommandInput(addStripButtonInput); + addStripButtonInput->isVisible(false); + } + Ptr deleteButtonInput = inputs->addBoolValueInput(_coordTable->id() + "_delete", "Delete", false, "", true); + if (deleteButtonInput) { + _coordTable->addToolbarCommandInput(deleteButtonInput); + deleteButtonInput->isVisible(false); + } + _coordTable->isVisible(false); + } + + // specific for 'Lines - Custom' + _isLineStrip = inputs->addBoolValueInput(_commandId + "_isLineStrip", "Use LineStrip", true, "", true); + if (_isLineStrip) { + _isLineStrip->isVisible(false); + } + + // color effects for custom graphics Mesh/BRep + _colorEffects = inputs->addDropDownCommandInput(_commandId + "_colorEffects", "Color Effect", DropDownStyles::TextListDropDownStyle); + if (_colorEffects) { + Ptr listItems = _colorEffects->listItems(); + if (listItems) { + listItems->add(_colorEffect_solid_id, true); + listItems->add(_colorEffect_basicMaterial_id, false); + listItems->add(_colorEffect_appearance_id, false); + listItems->add(_colorEffect_vertex_id, false); + } + } + + // RGB for solid colors + _red = inputs->addIntegerSliderCommandInput(_commandId + "_red", "Red", 0, 255); + if (_red) + _red->valueOne(255); + _green = inputs->addIntegerSliderCommandInput(_commandId + "_green", "Green", 0, 255); + if (_green) + _green->valueOne(0); + _blue = inputs->addIntegerSliderCommandInput(_commandId + "_blue", "Blue", 0, 255); + if (_blue) + _blue->valueOne(0); + + // specific for basic material color effect + _glossiness = inputs->addFloatSliderCommandInput(_commandId + "_glossiness", "Glossiness", "", 0, 128); + if (_glossiness) { + _glossiness->valueOne(128); + _glossiness->isVisible(false); + } + _opacity = inputs->addFloatSliderCommandInput(_commandId + "_opacity", "Opacity", "", 0, 1); + if (_opacity) { + _opacity->valueOne(1); + _opacity->isVisible(false); + } + + // for appearance color effect + std::string defaultMatLibName(""); + _materialLibList = inputs->addDropDownCommandInput(_commandId + "_materialLib", "Material Library", DropDownStyles::TextListDropDownStyle); + if (_materialLibList) { + Ptr listItems = _materialLibList->listItems(); + if (listItems) { + std::vector matLibNames = getMaterialLibNames(); + for (std::string libName : matLibNames) { + listItems->add(libName, false); + } + if (listItems->count() > 0) { + Ptr item0 = listItems->item(0); + if (item0) { + item0->isSelected(true); + defaultMatLibName = item0->name(); + } + } + } + _materialLibList->isVisible(false); + } + _appearanceList = inputs->addDropDownCommandInput(_commandId + "_appearanceList", "Appearance", DropDownStyles::TextListDropDownStyle); + if (_appearanceList && !defaultMatLibName.empty()) { + Ptr listItems = _appearanceList->listItems(); + if (listItems) { + std::vector defaultAppearanceList = getAppearancesFromLib(defaultMatLibName, ""); + for (std::string appearanceName : defaultAppearanceList) { + listItems->add(appearanceName, false); + } + if (listItems->count() > 0) { + Ptr item0 = listItems->item(0); + if (item0) { + item0->isSelected(true); + } + } + } + _appearanceList->isVisible(false); + } + _appearanceFilter = inputs->addStringValueInput(_commandId + "_appearanceFilter", "Filter"); + if (_appearanceFilter) { + _appearanceFilter->isVisible(false); + } + + // selection input for custom graphics BRep/Curve + _selection = inputs->addSelectionInput(_commandId + "_sel", "Selection", ""); + if (_selection) { + _selection->setSelectionLimits(0, 1); + _selection->isVisible(false); + _selection->isEnabled(false); + } + + // for custom graphics text + std::string txt = "{standard text}\\P{\\H1.5x;height:1.5x}\\P{\\C1;color:red}\\P{\\H1;height:1 unit}\\P{\\T2;char spacing:2}\\P{\\Q45;obliquing angle:45deg}\\P{\\W2;char width:2x}\\P{\\\\fArial;font:Arial}\\~{\\\\fTimes;font:Times}\\~{\\\\fCalibri;font:Calibri}\\P{\\Ooverline\\o}\\~{\\Lunderline\\l}"; + _text = inputs->addStringValueInput(_commandId + "_text", "Text", txt); + if (_text) + _text->isVisible(false); + _textSize = inputs->addValueInput(_commandId + "_textSize", "Size", "cm", ValueInput::createByReal(1)); + if (_textSize) + _textSize->isVisible(false); + _textStyle = inputs->addButtonRowCommandInput(_commandId + "_textStyle", "Style", true); + if (_textStyle) + { + Ptr items = _textStyle->listItems(); + if (items) + { + items->add("Bold", false, "./resources/text_bold"); + items->add("Italic", false, "./resources/text_italic"); + items->add("UnderLine", false, "./resources/text_underline"); + items->add("StrikeThrough", false, "./resources/text_strikethrough"); + } + _textStyle->isVisible(false); + } + _textFont = inputs->addStringValueInput(_commandId + "_textFont", "Font", "Arial"); + if (_textFont) + _textFont->isVisible(false); + + // transform for all custom graphics entity + if (Ptr transformDistance = adsk::core::ValueInput::createByReal(0)) { + _transform = inputs->addDistanceValueCommandInput(_commandId + "_transform", "Transform", transformDistance); + if (_transform) { + Ptr origin = adsk::core::Point3D::create(0, 0, 0); + Ptr direction = adsk::core::Vector3D::create(1, 0, 0); + if (origin && direction) { + _transform->setManipulator(origin, direction); + } + } + } + + // for custom graphics line style pattern + _lineStylePattern = inputs->addDropDownCommandInput(_commandId + "_LSPattern", "Line Style Pattern", DropDownStyles::TextListDropDownStyle); + if (_lineStylePattern) { + Ptr listItems = _lineStylePattern->listItems(); + if (listItems) { + listItems->add(_solidLine_id, true); + listItems->add(_centerLine_id, false); + listItems->add(_dashedLine_id, false); + listItems->add(_dotLine_id, false); + listItems->add(_phantomLine_id, false); + listItems->add(_tracksLine_id, false); + listItems->add(_zigZagLine_id, false); + } + _lineStylePattern->isVisible(false); + } + + // for line style weight + _lineStyleWeight = inputs->addIntegerSliderCommandInput(_commandId + "_LSWeight", "Line Style Weight", 1, 20); + _lineStyleWeight->valueOne(1); + _lineStyleWeight->isVisible(false); + + // for line style scale + _lineStyleScale = inputs->addIntegerSliderCommandInput(_commandId + "_LSScale", "Line Style Scale", 1, 100); + _lineStyleScale->valueOne(10); + _lineStyleScale->isVisible(false); + + // for view placement attribute + _viewPlacementGroup = inputs->addGroupCommandInput(_commandId + "_VPGroup", "View Placement"); + if (_viewPlacementGroup) + { + _viewPlacementGroup->isEnabledCheckBoxDisplayed(true); + _viewPlacementGroup->isEnabledCheckBoxChecked(false); + if (Ptr childInputs = _viewPlacementGroup->children()) + { + _viewCorner = childInputs->addButtonRowCommandInput(_commandId + "_viewCorner", "corner", false); + if(_viewCorner) + { + if (Ptr listItems = _viewCorner->listItems()) + { + listItems->add("Upper Left", false, "./resources/upperLeft"); + listItems->add("Upper Right", false, "./resources/upperRight"); + listItems->add("Lower Left", false, "./resources/lowerLeft"); + listItems->add("Lower Right", false, "./resources/lowerRight"); + } + } + } + } + + // for view scale attribute + _viewScaleGroup = inputs->addGroupCommandInput(_commandId + "_VSGroup", "View Scale"); + if (_viewScaleGroup) + { + _viewScaleGroup->isEnabledCheckBoxDisplayed(true); + _viewScaleGroup->isEnabledCheckBoxChecked(false); + if (Ptr childInputs = _viewScaleGroup->children()) + { + _pixelScale = childInputs->addFloatSliderCommandInput(_commandId + "_pixelScale", "pixel scale", "", 0.5,5,false); + if (_pixelScale) + { + _pixelScale->valueOne(1); + _pixelScale->setText("Smaller", "Larger"); + } + } + } + + // for billboarding attribute + _billboardingGroup = inputs->addGroupCommandInput(_commandId + "_BBGroup", "Billboarding"); + if (_billboardingGroup) + { + _billboardingGroup->isEnabledCheckBoxDisplayed(true); + _billboardingGroup->isEnabledCheckBoxChecked(false); + if (Ptr childInputs = _billboardingGroup->children()) + { + _billboardingStyle = childInputs->addButtonRowCommandInput(_commandId + "_billboardingStyle", "style", false); + if (_billboardingStyle) + { + if (Ptr listItems = _billboardingStyle->listItems()) + { + listItems->add("Screen", false, "./resources/One"); + listItems->add("Axis", false, "./resources/Two"); + listItems->add("Right Reading", false, "./resources/Three"); + } + } + } + } + // + } + } + } +private: + OnExecuteEventHandler onExecuteHandler_; + OnDestroyEventHandler onDestroyHandler_; + OnInputChangedEventHander onInputChangedHandler_; +} cmdCreated_; + +extern "C" XI_EXPORT bool run(const char* context) +{ + _app = Application::get(); + if (!_app) + return false; + + _ui = _app->userInterface(); + if (!_ui) + return false; + + Ptr doc = _app->activeDocument(); + if (!doc) + return false; + + Ptr prods = doc->products(); + if (!prods) + return false; + + Ptr prod = prods->itemByProductType("DesignProductType"); + if (!prod) + return false; + + _des = prod->cast(); + if (!_des) + return false; + + // get the entry for custom graphics + Ptr activeProd = _app->activeProduct(); + if (!activeProd) + return false; + + Ptr cam = activeProd->cast(); + if (cam) { + _cgGroups = cam->customGraphicsGroups(); + } + else { + Ptr rootComp = _des->rootComponent(); + if (!rootComp) + return false; + _cgGroups = rootComp->customGraphicsGroups(); + } + if (!_cgGroups) + return false; + + Ptr command = createCommandDefinition(); + if (!command) + return false; + + Ptr commandCreatedEvent = command->commandCreated(); + if (!commandCreatedEvent) + return false; + commandCreatedEvent->add(&cmdCreated_); + command->execute(); + + // prevent this module from being terminate when the script returns, because we are waiting for event handlers to fire + adsk::autoTerminate(false); + + return true; +} + +#ifdef XI_WIN + +#include + +BOOL APIENTRY DllMain(HMODULE hmodule, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +#endif // XI_WIN diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.dll b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.dll new file mode 100644 index 0000000..38ffe06 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.dll differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.dylib b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.dylib new file mode 100644 index 0000000..3ecf3cb Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.dylib differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.manifest b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.manifest new file mode 100644 index 0000000..045a512 --- /dev/null +++ b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.manifest @@ -0,0 +1,12 @@ +{ + "autodeskProduct": "Fusion360", + "type": "script", + "author": "", + "description": { + "": "" + }, + "supportedOS": "windows|mac", + "editEnabled": true, + "sourcewindows": "CustomGraphicsSample.vcxproj", + "sourcemac": "CustomGraphicsSample.xcodeproj" +} \ No newline at end of file diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.vcxproj b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.vcxproj new file mode 100644 index 0000000..5bdb30d --- /dev/null +++ b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {D7CBB035-8CC0-4576-9C72-5076E079586B} + Win32Proj + CustomGraphicsSample + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/include + + + Windows + true + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/lib + core.lib;fusion.lib;cam.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/include + + + Windows + true + true + true + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/lib + core.lib;fusion.lib;cam.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + NotUsing + NotUsing + + + + + true + true + + + + + + \ No newline at end of file diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.xcodeproj/project.pbxproj b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1ec7232 --- /dev/null +++ b/usr/autodesk/CPP/Samples/CustomGraphicsSample/CustomGraphicsSample.xcodeproj/project.pbxproj @@ -0,0 +1,269 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2BB196C61AD5940800164CD3 /* CustomGraphicsSample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB196C51AD5940800164CD3 /* CustomGraphicsSample.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2BB196BE1AD586AA00164CD3 /* CustomGraphicsSample.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "CustomGraphicsSample.dylib"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2BB196C51AD5940800164CD3 /* CustomGraphicsSample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "CustomGraphicsSample.cpp"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2BB196BB1AD586AA00164CD3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2BB196B51AD586AA00164CD3 = { + isa = PBXGroup; + children = ( + 2BB196C51AD5940800164CD3 /* CustomGraphicsSample.cpp */, + 2BB196BF1AD586AA00164CD3 /* Products */, + ); + sourceTree = ""; + }; + 2BB196BF1AD586AA00164CD3 /* Products */ = { + isa = PBXGroup; + children = ( + 2BB196BE1AD586AA00164CD3 /* CustomGraphicsSample.dylib */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2BB196BC1AD586AA00164CD3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2BB196BD1AD586AA00164CD3 /* CustomGraphicsSample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "CustomGraphicsSample" */; + buildPhases = ( + 2BB196BA1AD586AA00164CD3 /* Sources */, + 2BB196BB1AD586AA00164CD3 /* Frameworks */, + 2BB196BC1AD586AA00164CD3 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "CustomGraphicsSample"; + productName = "CustomGraphicsSample"; + productReference = 2BB196BE1AD586AA00164CD3 /* CustomGraphicsSample.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2BB196B61AD586AA00164CD3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = Autodesk; + }; + buildConfigurationList = 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "CustomGraphicsSample" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 2BB196B51AD586AA00164CD3; + productRefGroup = 2BB196BF1AD586AA00164CD3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2BB196BD1AD586AA00164CD3 /* CustomGraphicsSample */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 2BB196BA1AD586AA00164CD3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2BB196C61AD5940800164CD3 /* CustomGraphicsSample.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2BB196C01AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/include", + ); + LIBRARY_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 2BB196C11AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/include", + ); + LIBRARY_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + SDKROOT = macosx; + }; + name = Release; + }; + 2BB196C31AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/core.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/fusion.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/cam.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Debug; + }; + 2BB196C41AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/core.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/fusion.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/cam.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "CustomGraphicsSample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C01AD586AA00164CD3 /* Debug */, + 2BB196C11AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "CustomGraphicsSample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C31AD586AA00164CD3 /* Debug */, + 2BB196C41AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2BB196B61AD586AA00164CD3 /* Project object */; +} diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/16x16-disabled.png new file mode 100644 index 0000000..b3b427e Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/16x16.png new file mode 100644 index 0000000..928832f Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/16x16-disabled.png new file mode 100644 index 0000000..2b1a9be Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/16x16-pressed.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/16x16-pressed.png new file mode 100644 index 0000000..2bbd57f Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/16x16-pressed.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/16x16.png new file mode 100644 index 0000000..704848a Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/32x32-pressed.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/32x32-pressed.png new file mode 100644 index 0000000..bde1694 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/32x32-pressed.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/32x32.png new file mode 100644 index 0000000..efb6665 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/One/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/16x16-disabled.png new file mode 100644 index 0000000..88a1f90 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/16x16-pressed.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/16x16-pressed.png new file mode 100644 index 0000000..3a9f2e9 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/16x16-pressed.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/16x16.png new file mode 100644 index 0000000..1825a2e Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/32x32-pressed.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/32x32-pressed.png new file mode 100644 index 0000000..d2816b0 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/32x32-pressed.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/32x32.png new file mode 100644 index 0000000..88bceaf Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Three/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/16x16-disabled.png new file mode 100644 index 0000000..d76f8e9 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/16x16-pressed.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/16x16-pressed.png new file mode 100644 index 0000000..3201c42 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/16x16-pressed.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/16x16.png new file mode 100644 index 0000000..c57d89b Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/32x32.png new file mode 100644 index 0000000..f0ac18c Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/32x32pressed.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/32x32pressed.png new file mode 100644 index 0000000..78621f7 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/Two/32x32pressed.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerLeft/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerLeft/16x16-disabled.png new file mode 100644 index 0000000..e8755e7 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerLeft/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerLeft/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerLeft/16x16.png new file mode 100644 index 0000000..bfcba46 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerLeft/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerLeft/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerLeft/32x32.png new file mode 100644 index 0000000..f33ce0d Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerLeft/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerRight/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerRight/16x16-disabled.png new file mode 100644 index 0000000..e59f2d0 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerRight/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerRight/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerRight/16x16.png new file mode 100644 index 0000000..93f85bc Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerRight/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerRight/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerRight/32x32.png new file mode 100644 index 0000000..e85e2a1 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/lowerRight/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_bold/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_bold/16x16-disabled.png new file mode 100644 index 0000000..8f52437 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_bold/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_bold/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_bold/16x16.png new file mode 100644 index 0000000..a1288de Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_bold/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_bold/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_bold/32x32.png new file mode 100644 index 0000000..8f677e7 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_bold/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_italic/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_italic/16x16-disabled.png new file mode 100644 index 0000000..04e982c Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_italic/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_italic/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_italic/16x16.png new file mode 100644 index 0000000..aa21127 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_italic/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_italic/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_italic/32x32.png new file mode 100644 index 0000000..fc73d21 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_italic/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_strikethrough/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_strikethrough/16x16-disabled.png new file mode 100644 index 0000000..4dc68ef Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_strikethrough/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_strikethrough/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_strikethrough/16x16.png new file mode 100644 index 0000000..9338af7 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_strikethrough/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_strikethrough/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_strikethrough/32x32.png new file mode 100644 index 0000000..58b695a Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_strikethrough/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_underline/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_underline/16x16-disabled.png new file mode 100644 index 0000000..10318bc Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_underline/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_underline/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_underline/16x16.png new file mode 100644 index 0000000..afc6c24 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_underline/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_underline/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_underline/32x32.png new file mode 100644 index 0000000..f248875 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/text_underline/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperLeft/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperLeft/16x16-disabled.png new file mode 100644 index 0000000..0e8dd60 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperLeft/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperLeft/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperLeft/16x16.png new file mode 100644 index 0000000..d1acbe5 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperLeft/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperLeft/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperLeft/32x32.png new file mode 100644 index 0000000..f5ec968 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperLeft/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperRight/16x16-disabled.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperRight/16x16-disabled.png new file mode 100644 index 0000000..4dcd1ef Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperRight/16x16-disabled.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperRight/16x16.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperRight/16x16.png new file mode 100644 index 0000000..5e1ac25 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperRight/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperRight/32x32.png b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperRight/32x32.png new file mode 100644 index 0000000..108a368 Binary files /dev/null and b/usr/autodesk/CPP/Samples/CustomGraphicsSample/resources/upperRight/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/SpurGear/Resources/GearEnglish.png b/usr/autodesk/CPP/Samples/SpurGear/Resources/GearEnglish.png new file mode 100644 index 0000000..b7190fd Binary files /dev/null and b/usr/autodesk/CPP/Samples/SpurGear/Resources/GearEnglish.png differ diff --git a/usr/autodesk/CPP/Samples/SpurGear/Resources/GearMetric.png b/usr/autodesk/CPP/Samples/SpurGear/Resources/GearMetric.png new file mode 100644 index 0000000..844b3ee Binary files /dev/null and b/usr/autodesk/CPP/Samples/SpurGear/Resources/GearMetric.png differ diff --git a/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/16x16.png b/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/16x16.png new file mode 100644 index 0000000..c12e374 Binary files /dev/null and b/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/16x16.png differ diff --git a/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/16x16@2x.png b/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/16x16@2x.png new file mode 100644 index 0000000..efa3cd1 Binary files /dev/null and b/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/16x16@2x.png differ diff --git a/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/32x32.png b/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/32x32.png new file mode 100644 index 0000000..efa3cd1 Binary files /dev/null and b/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/32x32.png differ diff --git a/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/32x32@2x.png b/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/32x32@2x.png new file mode 100644 index 0000000..1fd0d3d Binary files /dev/null and b/usr/autodesk/CPP/Samples/SpurGear/Resources/SpurGear/32x32@2x.png differ diff --git a/usr/autodesk/CPP/Samples/SpurGear/SpurGear.cpp b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.cpp new file mode 100644 index 0000000..8f0f8da --- /dev/null +++ b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.cpp @@ -0,0 +1,1283 @@ +/************************************************************************************** + Author-Brian Ekins + Description-Creates a spur gear component. + + AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. AUTODESK SPECIFICALLY + DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. + AUTODESK, INC. DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE + UNINTERRUPTED OR ERROR FREE. +***************************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#define _USE_MATH_DEFINES +#include +#include + + +#if defined(_WINDOWS) || defined(_WIN32) || defined(_WIN64) +#include +#else +#include +#endif + +using namespace adsk::core; +using namespace adsk::fusion; + + +// Globals +Ptr _app; +Ptr _ui; +std::string _units = ""; + +// Global command input declarations. +Ptr _imgInputEnglish; +Ptr _imgInputMetric; +Ptr _standard; +Ptr _pressureAngle; +Ptr _pressureAngleCustom; +Ptr _backlash; +Ptr _diaPitch; +Ptr _module; +Ptr _numTeeth; +Ptr _rootFilletRad; +Ptr _thickness; +Ptr _holeDiam; +Ptr _pitchDiam; +Ptr _errMessage; + +bool getCommandInputValue(Ptr commandInput, std::string unitType, double *value); +bool is_digits(const std::string &str); +Ptr drawGear(Ptr design, double diametralPitch, int numTeeth, double thickness, double rootFilletRad, double pressureAngle, double backlash, double holeDiam); + + +bool checkReturn(Ptr returnObj) +{ + if (returnObj) + return true; + else + if (_app && _ui) + { + std::string errDesc; + _app->getLastError(&errDesc); + _ui->messageBox(errDesc); + return false; + } + else + return false; +} + +// Event handler for the execute event. +class GearCommandExecuteEventHandler : public adsk::core::CommandEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + double diaPitch = 0.0; + if( _standard->selectedItem()->name() == "English") + { + diaPitch = _diaPitch->value(); + } + else if (_standard->selectedItem()->name() == "Metric") + { + diaPitch = 25.4 / _module->value(); + } + + // Save the current values as attributes. + Ptr des = _app->activeProduct(); + Ptr attribs = des->attributes(); + attribs->add("SpurGear", "standard", _standard->selectedItem()->name()); + attribs->add("SpurGear", "pressureAngle", _pressureAngle->selectedItem()->name()); + attribs->add("SpurGear", "pressureAngleCustom", std::to_string(_pressureAngleCustom->value())); + attribs->add("SpurGear", "diaPitch", std::to_string(diaPitch)); + attribs->add("SpurGear", "numTeeth", _numTeeth->value()); + attribs->add("SpurGear", "rootFilletRad", std::to_string(_rootFilletRad->value())); + attribs->add("SpurGear", "thickness", std::to_string(_thickness->value())); + attribs->add("SpurGear", "holeDiam", std::to_string(_holeDiam->value())); + attribs->add("SpurGear", "backlash", std::to_string(_backlash->value())); + + // Get the current values. + double pressureAngle = 0.0; + if (_pressureAngle->selectedItem()->name() == "Custom") + { + pressureAngle = _pressureAngleCustom->value(); + } + else + { + if (_pressureAngle->selectedItem()->name() == "14.5 deg") + { + pressureAngle = 14.5 * (M_PI/180.0); + } + else if (_pressureAngle->selectedItem()->name() == "20 deg") + { + pressureAngle = 20.0 * (M_PI/180.0); + } + else if (_pressureAngle->selectedItem()->name() == "25 deg") + { + pressureAngle = 25.0 * (M_PI/180); + } + } + + int numTeeth = std::stoi(_numTeeth->value()); + double rootFilletRad = _rootFilletRad->value(); + double thickness = _thickness->value(); + double holeDiam = _holeDiam->value(); + double backlash = _backlash->value(); + + // Create the gear. + Ptr gearComp; + gearComp = drawGear(des, diaPitch, numTeeth, thickness, rootFilletRad, pressureAngle, backlash, holeDiam); + + if (gearComp) + { + std::string desc = ""; + if (_standard->selectedItem()->name() == "English") + { + desc = "Spur Gear; Diametrial Pitch: " + std::to_string(diaPitch) + "; "; + } + else if (_standard->selectedItem()->name() == "Metric") + { + desc = "Spur Gear; Module: " + std::to_string(25.4 / diaPitch) + "; "; + } + + desc += "Num Teeth: " + std::to_string(numTeeth) + "; "; + desc += "Pressure Angle: " + std::to_string(pressureAngle * (180/M_PI)) + "; "; + + desc += "Backlash: " + des->unitsManager()->formatInternalValue(backlash, _units, true); + gearComp->description(desc); + } + else + { + eventArgs->executeFailed(true); + eventArgs->executeFailedMessage("Unexpected failure while constructing the gear."); + } + } +} _gearCommandExecute; + + +class GearCommandInputChangedHandler : public adsk::core::InputChangedEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + Ptr changedInput = eventArgs->input(); + + if (changedInput->id() == "standard") + { + if (_standard->selectedItem()->name() == "English") + { + _imgInputMetric->isVisible(false); + _imgInputEnglish->isVisible(true); + + _diaPitch->isVisible(true); + _module->isVisible(false); + + _diaPitch->value(25.4 / _module->value()); + + _units = "in"; + } + else if (_standard->selectedItem()->name() == "Metric") + { + _imgInputMetric->isVisible(true); + _imgInputEnglish->isVisible(false); + + _diaPitch->isVisible(false); + _module->isVisible(true); + + _module->value(25.4 / _diaPitch->value()); + + _units = "mm"; + } + + // Set each one to it's current value because otherwised if the user + // has edited it, the value won't update in the dialog because + // apparently it remembers the units when the value was edited. + // Setting the value using the API resets this. + _backlash->value(_backlash->value()); + _backlash->unitType(_units); + _rootFilletRad->value(_rootFilletRad->value()); + _rootFilletRad->unitType(_units); + _thickness->value(_thickness->value()); + _thickness->unitType(_units); + _holeDiam->value(_holeDiam->value()); + _holeDiam->unitType(_units); + } + + // Update the pitch diameter value. + double diaPitch = 0; + if (_standard->selectedItem()->name() == "English") + { + double value; + if (getCommandInputValue(_diaPitch, "", &value)) + { + diaPitch = value; + } + } + else if (_standard->selectedItem()->name() == "Metric") + { + double value; + if (getCommandInputValue(_module, "", &value)) + { + diaPitch = 25.4 / value; + } + } + + if (diaPitch != 0) + { + if (is_digits(_numTeeth->value())) + { + double numTeeth = std::stoi(_numTeeth->value()); + double pitchDia = numTeeth/diaPitch; + + // The pitch dia has been calculated in inches, but this expects cm as the input units. + Ptr des = _app->activeProduct(); + std::string pitchDiaText = des->unitsManager()->formatInternalValue(pitchDia * 2.54, _units, true); + _pitchDiam->text(pitchDiaText); + } + else + { + _pitchDiam->text(""); + } + } + else + { + _pitchDiam->text(""); + } + + if (changedInput->id() == "pressureAngle") + { + if (_pressureAngle->selectedItem()->name() == "Custom") + { + _pressureAngleCustom->isVisible(true); + } + else + { + _pressureAngleCustom->isVisible(false); + } + } + } +} _gearCommandInputChanged; + + +class GearCommandValidateInputsEventHandler : public adsk::core::ValidateInputsEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + _errMessage->text(""); + + // Verify that at lesat 4 teath are specified. + int numTeeth; + if (!is_digits(_numTeeth->value())) + { + _errMessage->text("The number of teeth must be a whole number."); + eventArgs->areInputsValid(false); + return; + } + else + { + numTeeth = std::stoi(_numTeeth->value()); + } + + if (numTeeth < 4) + { + _errMessage->text("The number of teeth must be 4 or more."); + eventArgs->areInputsValid(false); + return; + } + + // Calculate some of the gear sizes to use in validation. + double diaPitch = 0.0; + if (_standard->selectedItem()->name() == "English") + { + double value; + if (!getCommandInputValue(_diaPitch, "", &value)) + { + eventArgs->areInputsValid(false); + return; + } + else + { + diaPitch = value; + } + } + else if (_standard->selectedItem()->name() == "Metric") + { + double value; + if (!getCommandInputValue(_module, "", &value)) + { + eventArgs->areInputsValid(false); + return; + } + else + { + diaPitch = 25.4 / value; + } + } + + double diametralPitch = diaPitch / 2.54; + double pitchDia = numTeeth / diametralPitch; + + double dedendum; + if (diametralPitch < (20.0 *(M_PI/180.0))-0.000001) + { + dedendum = 1.157 / diametralPitch; + } + else + { + double circularPitch = M_PI / diametralPitch; + if (circularPitch >= 20.0) + { + dedendum = 1.25 / diametralPitch; + } + else + { + dedendum = (1.2 / diametralPitch) + (.002 * 2.54); + } + } + + double rootDia = pitchDia - (2.0 * dedendum); + + double pressureAngle = 0.0; + if (_pressureAngle->selectedItem()->name() == "Custom") + { + pressureAngle = _pressureAngleCustom->value(); + } + else + { + if (_pressureAngle->selectedItem()->name() == "14.5 deg") + pressureAngle = 14.5 * (M_PI/180.0); + else if (_pressureAngle->selectedItem()->name() == "20 deg") + pressureAngle = 20.0 * (M_PI/180.0); + else if (_pressureAngle->selectedItem()->name() == "25 deg") + pressureAngle = 25.0 * (M_PI/180.0); + } + + double baseCircleDia = pitchDia * cos(pressureAngle); + double baseCircleCircumference = 2.0 * M_PI * (baseCircleDia / 2.0); + + Ptr des = _app->activeProduct(); + + double holeDiam; + double value; + if (!getCommandInputValue(_holeDiam, _units, &value)) + { + eventArgs->areInputsValid(false); + return; + } + else + { + holeDiam = value; + } + + if (holeDiam >= (rootDia - 0.01)) + { + _errMessage->text("The center hole diameter is too large. It must be less than " + des->unitsManager()->formatInternalValue(rootDia - 0.01, _units, true)); + eventArgs->areInputsValid(false); + return; + } + + double toothThickness = baseCircleCircumference / (numTeeth * 2); + if (_rootFilletRad->value() > toothThickness * 0.4) + { + _errMessage->text("The root fillet radius is too large. It must be less than " + des->unitsManager()->formatInternalValue(toothThickness * 0.4, _units, true)); + eventArgs->areInputsValid(false); + return; + } + } +} _gearCommandValidateInputs; + + +class SpurGearCommandDestroyEventHandler : public adsk::core::CommandEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + // Terminate the script since the command has finished. + adsk::terminate(); + } +} _gearCommandDestroy; + +class SpurGearCommandCreatedEventHandler : public adsk::core::CommandCreatedEventHandler +{ +public: + void notify(const Ptr& eventArgs) override + { + // Verify that a Fusion design is active. + Ptr des = _app->activeProduct(); + if (!checkReturn(des)) + { + _ui->messageBox("A Fusion design must be active when invoking this command."); + return; + } + + std::string defaultUnits = des->unitsManager()->defaultLengthUnits(); + + // Determine whether to use inches or millimeters as the intial default. + if (defaultUnits == "in" || defaultUnits == "ft") + { + _units = "in"; + } + else + { + _units = "mm"; + } + + // Define the default values and get the previous values from the attributes. + std::string standard; + if (_units == "in") + { + standard = "English"; + } + else + { + standard = "Metric"; + } + + Ptr standardAttrib = des->attributes()->itemByName("SpurGear", "standard"); + if (checkReturn(standardAttrib)) + standard = standardAttrib->value(); + + if (standard == "English") + { + _units = "in"; + } + else + { + _units = "mm"; + } + + std::string pressureAngle = "20 deg"; + Ptr pressureAngleAttrib = des->attributes()->itemByName("SpurGear", "pressureAngle"); + if (checkReturn(pressureAngleAttrib)) + { + pressureAngle = pressureAngleAttrib->value(); + } + + double pressureAngleCustom = 20 * (M_PI/180.0); + Ptr pressureAngleCustomAttrib = des->attributes()->itemByName("SpurGear", "pressureAngleCustom"); + if (checkReturn(pressureAngleCustomAttrib)) + { + pressureAngleCustom = std::stod(pressureAngleCustomAttrib->value()); + } + + std::string diaPitch = "2"; + Ptr diaPitchAttrib = des->attributes()->itemByName("SpurGear", "diaPitch"); + if (checkReturn(diaPitchAttrib)) + { + diaPitch = diaPitchAttrib->value(); + } + double metricModule = 25.4 / std::stod(diaPitch); + + std::string backlash = "0"; + Ptr backlashAttrib = des->attributes()->itemByName("SpurGear", "backlash"); + if (checkReturn(backlashAttrib)) + backlash = backlashAttrib->value(); + + std::string numTeeth = "24"; + Ptr numTeethAttrib = des->attributes()->itemByName("SpurGear", "numTeeth"); + if (checkReturn(numTeethAttrib)) + numTeeth = numTeethAttrib->value(); + + std::string rootFilletRad = std::to_string(.0625 * 2.54); + Ptr rootFilletRadAttrib = des->attributes()->itemByName("SpurGear", "rootFilletRad"); + if (checkReturn(rootFilletRadAttrib)) + rootFilletRad = rootFilletRadAttrib->value(); + + std::string thickness = std::to_string(0.5 * 2.54); + Ptr thicknessAttrib = des->attributes()->itemByName("SpurGear", "thickness"); + if (checkReturn(thicknessAttrib)) + thickness = thicknessAttrib->value(); + + std::string holeDiam = std::to_string(0.5 * 2.54); + Ptr holeDiamAttrib = des->attributes()->itemByName("SpurGear", "holeDiam"); + if (checkReturn(holeDiamAttrib)) + holeDiam = holeDiamAttrib->value(); + + Ptr cmd = eventArgs->command(); + cmd->isExecutedWhenPreEmpted(false); + Ptr inputs = cmd->commandInputs(); + if (!checkReturn(inputs)) + return; + + // Define the command dialog. + _imgInputEnglish = inputs->addImageCommandInput("gearImageEnglish", "", "Resources/GearEnglish.png"); + if (!checkReturn(_imgInputEnglish)) + return; + _imgInputEnglish->isFullWidth(true); + + _imgInputMetric = inputs->addImageCommandInput("gearImageMetric", "", "Resources/GearMetric.png"); + if (!checkReturn(_imgInputMetric)) + return; + _imgInputMetric->isFullWidth(true); + + _standard = inputs->addDropDownCommandInput("standard", "Standard", TextListDropDownStyle); + if (!checkReturn(_standard)) + return; + + if (standard == "English") + { + _standard->listItems()->add("English", true); + _standard->listItems()->add("Metric", false); + _imgInputMetric->isVisible(false); + } + else + { + _standard->listItems()->add("English", false); + _standard->listItems()->add("Metric", true); + _imgInputEnglish->isVisible(false); + } + + _pressureAngle = inputs->addDropDownCommandInput("pressureAngle", "Pressure Angle", TextListDropDownStyle); + if (!checkReturn(_pressureAngle)) + return; + + if (pressureAngle == "14.5 deg") + { + _pressureAngle->listItems()->add("14.5 deg", true); + } + else + { + _pressureAngle->listItems()->add("14.5 deg", false); + } + + if (pressureAngle == "20 deg") + { + _pressureAngle->listItems()->add("20 deg", true); + } + else + { + _pressureAngle->listItems()->add("20 deg", false); + } + + if (pressureAngle == "25 deg") + { + _pressureAngle->listItems()->add("25 deg", true); + } + else + { + _pressureAngle->listItems()->add("25 deg", false); + } + + if (pressureAngle == "Custom") + { + _pressureAngle->listItems()->add("Custom", true); + } + else + { + _pressureAngle->listItems()->add("Custom", false); + } + + _pressureAngleCustom = inputs->addValueInput("pressureAngleCustom", "Custom Angle", "deg", ValueInput::createByReal(pressureAngleCustom)); + if (!checkReturn(_pressureAngleCustom)) + return; + if (pressureAngle != "Custom") + { + _pressureAngleCustom->isVisible(false); + } + + _diaPitch = inputs->addValueInput("diaPitch", "Diametral Pitch", "", ValueInput::createByString(diaPitch)) ; + + _module = inputs->addValueInput("module", "Module", "", ValueInput::createByReal(metricModule)) ; + if (!checkReturn(_module)) + return; + + if (standard == "English") + { + _module->isVisible(false); + } + else if (standard == "Metric") + { + _diaPitch->isVisible(false); + } + + _numTeeth = inputs->addStringValueInput("numTeeth", "Number of Teeth", numTeeth); + if (!checkReturn(_pressureAngleCustom)) + return; + + _backlash = inputs->addValueInput("backlash", "Backlash", _units, ValueInput::createByReal(std::stod(backlash))); + if (!checkReturn(_backlash)) + return; + + _rootFilletRad = inputs->addValueInput("rootFilletRad", "Root Fillet Radius", _units, ValueInput::createByReal(std::stod(rootFilletRad))); + if (!checkReturn(_rootFilletRad)) + return; + + _thickness = inputs->addValueInput("thickness", "Gear Thickness", _units, ValueInput::createByReal(std::stod(thickness))); + if (!checkReturn(_thickness)) + return; + + _holeDiam = inputs->addValueInput("holeDiam", "Hole Diameter", _units,ValueInput::createByReal(std::stod(holeDiam))); + if (!checkReturn(_holeDiam)) + return; + + _pitchDiam = inputs->addTextBoxCommandInput("pitchDiam", "Pitch Diameter", "", 1, true); + if (!checkReturn(_pitchDiam)) + return; + + _errMessage = inputs->addTextBoxCommandInput("errMessage", "", "", 2, true); + if (!checkReturn(_errMessage)) + return; + _errMessage->isFullWidth(true); + + // Connect to the command related events. + Ptr inputChangedEvent = cmd->inputChanged(); + if (!inputChangedEvent) + return; + bool isOk = inputChangedEvent->add(&_gearCommandInputChanged); + if (!isOk) + return; + + Ptr validateInputsEvent = cmd->validateInputs(); + if (!validateInputsEvent) + return; + isOk = validateInputsEvent->add(&_gearCommandValidateInputs); + if (!isOk) + return; + + Ptr executeEvent = cmd->execute(); + if (!executeEvent) + return; + isOk = executeEvent->add(&_gearCommandExecute); + if (!isOk) + return; + + Ptr destroyEvent = cmd->destroy(); + if (!destroyEvent) + return; + + isOk = destroyEvent->add(&_gearCommandDestroy); + if (!isOk) + return; + } +} _gearCommandCreated; + + +extern "C" XI_EXPORT bool run(const char* context) +{ + _app = Application::get(); + if (!_app) + return false; + + _ui = _app->userInterface(); + if (!_ui) + return false; + + // Create a command definition and add a button to the CREATE panel. + Ptr cmdDef = _ui->commandDefinitions()->itemById("adskSpurGearCPPScript"); + if (!cmdDef) + { + cmdDef = _ui->commandDefinitions()->addButtonDefinition("adskSpurGearCPPScript", "Spur Gear", "Creates a spur gear component", "Resources/SpurGear"); + if (!checkReturn(cmdDef)) + return false; + } + + // Connect to the command created event. + Ptr commandCreatedEvent = cmdDef->commandCreated(); + if (!checkReturn(commandCreatedEvent)) + return false; + bool isOk = commandCreatedEvent->add(&_gearCommandCreated); + if (!isOk) + return false; + + isOk = cmdDef->execute(); + if (!isOk) + return false; + + // Prevent this module from terminating so that the command can continue to run until + // the user completes the command. + adsk::autoTerminate(false); + + return true; +} + + + +bool is_digits(const std::string &str) +{ + return str.find_first_not_of("0123456789") == std::string::npos; +} + + +/* + * Verfies that a value command input has a valid expression and returns the + * value if it does. Otherwise it returns False. This works around a + * problem where when you get the value from a ValueCommandInput it causes the + * current expression to be evaluated and updates the display. Some new functionality + * is being added in the future to the ValueCommandInput object that will make + * this easier and should make this function obsolete. + */ +bool getCommandInputValue(Ptr commandInput, std::string unitType, double *value) +{ + Ptr valCommandInput = commandInput; + if (!commandInput) + { + *value = 0; + return false; + } + + // Verify that the expression is valid. + Ptr des = _app->activeProduct(); + Ptr unitsMgr = des->unitsManager(); + + if (unitsMgr->isValidExpression(valCommandInput->expression(), unitType)) + { + *value = unitsMgr->evaluateExpression(valCommandInput->expression(), unitType); + return true; + } + else + { + *value = 0; + return false; + } +} + + +// Calculate points along an involute curve. +Ptr involutePoint(double baseCircleRadius, double distFromCenterToInvolutePoint) +{ + // Calculate the other side of the right-angle triangle defined by the base circle and the current distance radius. + // This is also the length of the involute chord as it comes off of the base circle. + double triangleSide = sqrt(pow(distFromCenterToInvolutePoint, 2.0) - pow(baseCircleRadius, 2.0)); + + // Calculate the angle of the involute. + double alpha = triangleSide / baseCircleRadius; + + // Calculate the angle where the current involute point is. + double theta = alpha - acos(baseCircleRadius / distFromCenterToInvolutePoint); + + // Calculate the coordinates of the involute point. + double x = distFromCenterToInvolutePoint * cos(theta); + double y = distFromCenterToInvolutePoint * sin(theta); + + // Create a point to return. + return( adsk::core::Point3D::create(x, y, 0) ); +} + + +// Builds a spur gear. +Ptr drawGear(Ptr design, double diametralPitch, int numTeeth, double thickness, double rootFilletRad, double pressureAngle, double backlash, double holeDiam) +{ + // The diametral pitch is specified in inches but everthing + // here expects all distances to be in centimeters, so convert + // for the gear creation. + diametralPitch = diametralPitch / 2.54; + + // Compute the various values for a gear. + double pitchDia = (double)numTeeth / diametralPitch; + + //addendum = 1.0 / diametralPitch + double dedendum; + if (diametralPitch < (20 *(M_PI/180.0))-0.000001) + { + dedendum = 1.157 / diametralPitch; + } + else + { + double circularPitch = M_PI / diametralPitch; + if (circularPitch >= 20.0) + { + dedendum = 1.25 / diametralPitch; + } + else + { + dedendum = (1.2 / diametralPitch) + (.002 * 2.54); + } + } + + double rootDia = pitchDia - (2.0 * dedendum); + + double baseCircleDia = pitchDia * cos(pressureAngle); + double outsideDia = (double)(numTeeth + 2) / diametralPitch; + + // Create a new component by creating an occurrence. + Ptr occs = design->rootComponent()->occurrences(); + if (!checkReturn(occs)) + return nullptr; + + Ptr mat = adsk::core::Matrix3D::create(); + if (!checkReturn(mat)) + return nullptr; + + Ptr newOcc = occs->addNewComponent(mat); + if (!checkReturn(newOcc)) + return nullptr; + + Ptr newComp = newOcc->component(); + if (!checkReturn(newComp)) + return nullptr; + + // Create a new sketch. + Ptr sketches = newComp->sketches(); + if (!checkReturn(sketches)) + return nullptr; + + Ptr xyPlane = newComp->xYConstructionPlane(); + if (!checkReturn(xyPlane)) + return nullptr; + + Ptr baseSketch = sketches->add(xyPlane); + if (!checkReturn(xyPlane)) + return nullptr; + + // Draw a circle for the base. + baseSketch->sketchCurves()->sketchCircles()->addByCenterRadius(adsk::core::Point3D::create(0,0,0), rootDia/2.0); + if (!checkReturn(baseSketch)) + return nullptr; + + // Draw a circle for the center hole, if the value is greater than 0. + Ptr prof = nullptr; + if (holeDiam - (_app->pointTolerance() * 2) > 0) + { + Ptr circ = baseSketch->sketchCurves()->sketchCircles()->addByCenterRadius(adsk::core::Point3D::create(0,0,0), holeDiam/2.0); + if (!checkReturn(circ)) + return nullptr; + + // Find the profile that uses both circles. + for (Ptr tempProf : baseSketch->profiles()) + { + if (tempProf->profileLoops()->count() == 2) + { + prof = tempProf; + break; + } + } + } + else + { + // Use the single profile. + prof = baseSketch->profiles()->item(0); + } + + if (!checkReturn(prof)) + return nullptr; + + //////// Extrude the circle to create the base of the gear. + + // Create an extrusion input to be able to define the input needed for an extrusion + // while specifying the profile and that a new component is to be created + Ptr extrudes = newComp->features()->extrudeFeatures(); + if (!checkReturn(extrudes)) + return nullptr; + + Ptr extInput = extrudes->createInput(prof, NewBodyFeatureOperation); + if (!checkReturn(extInput)) + return nullptr; + + // Define that the extent is a distance extent of 5 cm. + Ptr distance = adsk::core::ValueInput::createByReal(thickness); + if (!checkReturn(distance)) + return nullptr; + + bool result = extInput->setDistanceExtent(false, distance); + if (!result) + return nullptr; + + // Create the extrusion. + Ptr baseExtrude = extrudes->add(extInput); + if (!checkReturn(baseExtrude)) + return nullptr; + + // Create a second sketch for the tooth. + Ptr toothSketch = sketches->add(xyPlane); + if (!checkReturn(toothSketch)) + return nullptr; + + // Calculate points along the involute curve. + int involutePointCount = 15; + double involuteIntersectionRadius = baseCircleDia / 2.0; + Ptr *involutePoints = new Ptr[involutePointCount]; + std::unique_ptr[]> involutePointsDeleter(involutePoints); + double involuteSize = (outsideDia - baseCircleDia) / 2.0; + for (int i=0; i newPoint = involutePoint(baseCircleDia / 2.0, involuteIntersectionRadius); + involutePoints[i] = newPoint; + } + + // Get the point along the tooth that's at the pictch diameter and then + // calculate the angle to that point. + Ptr pitchInvolutePoint = involutePoint(baseCircleDia / 2.0, pitchDia / 2.0); + double pitchPointAngle = atan(pitchInvolutePoint->y() / pitchInvolutePoint->x()); + + // Determine the angle defined by the tooth thickness as measured at + // the pitch diameter circle. + double toothThicknessAngle = (2.0 * M_PI) / (2.0 * (double)numTeeth); + + // Determine the angle needed for the specified backlash. + double backlashAngle = (backlash / (pitchDia / 2.0)) * 0.25; + + // Determine the angle to rotate the curve. + double rotateAngle = -((toothThicknessAngle/2.0) + pitchPointAngle - backlashAngle); + + // Rotate the involute so the middle of the tooth lies on the x axis. + double cosAngle = cos(rotateAngle); + double sinAngle = sin(rotateAngle); + for (int i=0; ix() * cosAngle - involutePoints[i]->y() * sinAngle; + double newY = involutePoints[i]->x() * sinAngle + involutePoints[i]->y() * cosAngle; + involutePoints[i] = adsk::core::Point3D::create(newX, newY, 0); + } + + // Create a new set of points with a negated y. This effectively mirrors the original + // points about the X axis. + Ptr *involute2Points = new Ptr[involutePointCount]; + std::unique_ptr[]> involute2PointsDeleter(involute2Points); + for (int i=0; ix(), -involutePoints[i]->y(), 0); + } + + double *curve1Angle = new double[involutePointCount]; + std::unique_ptr curve1AngleDeleter(curve1Angle); + for (int i=0; iy() / involutePoints[i]->x()); + } + + double *curve2Angle = new double[involutePointCount]; + std::unique_ptr curve2AngleDeleter(curve2Angle); + for (int i=0; iy() / involute2Points[i]->x()); + } + + toothSketch->isComputeDeferred(true); + + // Create and load an object collection with the points. + Ptr pointSet = adsk::core::ObjectCollection::create(); + for (int i=0; iadd(involutePoints[i]); + } + + // Create the first spline. + Ptr spline1 = toothSketch->sketchCurves()->sketchFittedSplines()->add(pointSet); + if (!checkReturn(spline1)) + return nullptr; + + // Add the involute points for the second spline to an ObjectCollection. + pointSet = adsk::core::ObjectCollection::create(); + for (int i=0; iadd(involute2Points[i]); + } + + // Create the second spline. + Ptr spline2 = toothSketch->sketchCurves()->sketchFittedSplines()->add(pointSet); + if (!checkReturn(spline2)) + return nullptr; + + // Draw the arc for the top of the tooth. + Ptr midPoint = adsk::core::Point3D::create((outsideDia / 2.0), 0, 0); + Ptr topArc = toothSketch->sketchCurves()->sketchArcs()->addByThreePoints(spline1->endSketchPoint(), midPoint, spline2->endSketchPoint()); + if (!checkReturn(topArc)) + return nullptr; + + // Check to see if involute goes down to the root or not. If not, then + // create lines to connect the involute to the root. + if (baseCircleDia < rootDia) + { + Ptr bottomLine = toothSketch->sketchCurves()->sketchLines()->addByTwoPoints(spline2->startSketchPoint(), spline1->startSketchPoint()); + if (!checkReturn(bottomLine)) + return nullptr; + } + else + { + Ptr rootPoint1 = adsk::core::Point3D::create((rootDia / 2 - 0.001) * cos(curve1Angle[0] ), (rootDia / 2) * sin(curve1Angle[0]), 0); + Ptr line1 = toothSketch->sketchCurves()->sketchLines()->addByTwoPoints(rootPoint1, spline1->startSketchPoint()); + if (!checkReturn(line1)) + return nullptr; + + Ptr rootPoint2 = adsk::core::Point3D::create((rootDia / 2 - 0.001) * cos(curve2Angle[0]), (rootDia / 2) * sin(curve2Angle[0]), 0); + Ptr line2 = toothSketch->sketchCurves()->sketchLines()->addByTwoPoints(rootPoint2, spline2->startSketchPoint()); + if (!checkReturn(line2)) + return nullptr; + + Ptr bottomLine = toothSketch->sketchCurves()->sketchLines()->addByTwoPoints(line1->startSketchPoint(), line2->startSketchPoint()); + if (!checkReturn(bottomLine)) + return nullptr; + + // Make the lines tangent to the spline so the root fillet will behave correctly. + if (!line1->isFixed(true)) + return nullptr; + + if (!line2->isFixed(true)) + return nullptr; + + Ptr geomConstraints = toothSketch->geometricConstraints(); + if (!checkReturn(geomConstraints)) + return nullptr; + + Ptr tangent = geomConstraints->addTangent(spline1, line1); + if (!checkReturn(tangent)) + return nullptr; + + tangent = geomConstraints->addTangent(spline2, line2); + if (!checkReturn(tangent)) + return nullptr; + } + + toothSketch->isComputeDeferred(false); + + ////// Extrude the tooth. + + // Get the profile defined by the tooth. + prof = toothSketch->profiles()->item(0); + if (!checkReturn(prof)) + return nullptr; + + // Create an extrusion input to be able to define the input needed for an extrusion + // while specifying the profile and that a new component is to be created + extInput = extrudes->createInput(prof, JoinFeatureOperation); + if (!checkReturn(extInput)) + return nullptr; + + // Define that the extent is a distance extent of 5 cm. + distance = adsk::core::ValueInput::createByReal(thickness); + if (!checkReturn(distance)) + return nullptr; + + result = extInput->setDistanceExtent(false, distance); + if (!result) + return nullptr; + + // Create the extrusion. + Ptr toothExtrude = extrudes->add(extInput); + if (!checkReturn(toothExtrude)) + return nullptr; + + Ptr baseFillet; + if (rootFilletRad > 0) + { + ////// Find the edges between the base cylinder and the tooth. + + // Get the outer cylindrical face from the base extrusion by checking the number + // of edges and if it's 2 get the other one. + Ptr cylFace = baseExtrude->sideFaces()->item(0); + if (cylFace->edges()->count() == 2) + { + cylFace = baseExtrude->sideFaces()->item(1); + } + if (!checkReturn(cylFace)) + return nullptr; + + // Get the two linear edges, which are the connection between the cylinder and tooth. + Ptr edges = adsk::core::ObjectCollection::create(); + for (Ptr edge : cylFace->edges()) + { + Ptr tempLine = edge->geometry(); + if (tempLine) + { + edges->add(edge); + } + } + + // Create a fillet input to be able to define the input needed for a fillet. + Ptr fillets = newComp->features()->filletFeatures(); + if (!checkReturn(fillets)) + return nullptr; + + Ptr filletInput = fillets->createInput(); + if (!checkReturn(filletInput)) + return nullptr; + + // Define that the extent is a distance extent of 5 cm. + Ptr radius = adsk::core::ValueInput::createByReal(rootFilletRad); + if (!checkReturn(radius)) + return nullptr; + + result = filletInput->addConstantRadiusEdgeSet(edges, radius, false); + if (!result) + return nullptr; + + // Create the extrusion. + baseFillet = fillets->add(filletInput); + if (!checkReturn(baseFillet)) + return nullptr; + } + + // Create a pattern of the tooth extrude and the base fillet. + Ptr circularPatterns = newComp->features()->circularPatternFeatures(); + if (!checkReturn(circularPatterns)) + return nullptr; + + Ptr entities = adsk::core::ObjectCollection::create(); + entities->add(toothExtrude); + if (baseFillet) + { + entities->add(baseFillet); + } + + Ptr cylFace = baseExtrude->sideFaces()->item(0); + if (!checkReturn(cylFace)) + return nullptr; + + Ptr patternInput = circularPatterns->createInput(entities, cylFace); + if (!checkReturn(patternInput)) + return nullptr; + + Ptr numTeethInput = adsk::core::ValueInput::createByString(std::to_string(numTeeth)); + if (!checkReturn(numTeethInput)) + return nullptr; + + patternInput->quantity(numTeethInput); + patternInput->patternComputeOption(adsk::fusion::PatternComputeOptions::IdenticalPatternCompute); + Ptr pattern = circularPatterns->add(patternInput); + if (!checkReturn(pattern)) + return nullptr; + + // Create an extra sketch that contains a circle of the diametral pitch. + Ptr diametralPitchSketch = sketches->add(xyPlane); + if (!checkReturn(diametralPitchSketch)) + return nullptr; + + Ptr diametralPitchCircle = diametralPitchSketch->sketchCurves()->sketchCircles()->addByCenterRadius(adsk::core::Point3D::create(0,0,0), pitchDia/2.0); + if (!checkReturn(diametralPitchCircle)) + return nullptr; + + diametralPitchCircle->isConstruction(true); + diametralPitchCircle->isFixed(true); + + // Group everything used to create the gear in the timeline. + Ptr timelineGroups = design->timeline()->timelineGroups(); + if (!checkReturn(timelineGroups)) + return nullptr; + + int newOccIndex = newOcc->timelineObject()->index(); + int pitchSketchIndex = diametralPitchSketch->timelineObject()->index(); + + Ptr timelineGroup = timelineGroups->add(newOccIndex, pitchSketchIndex); + if (!checkReturn(timelineGroup)) + return nullptr; + + timelineGroup->name("Spur Gear"); + + // Add an attribute to the component with all of the input values. This might + // be used in the future to be able to edit the gear. + std::string gearValues = "{"; + gearValues += "'pressureAngle': '" + std::to_string(pressureAngle) + "',"; + gearValues += "'numTeeth': '" + std::to_string(numTeeth) + "',"; + gearValues += "'backlash': '" + std::to_string(backlash) + "',"; + gearValues += "'holeDiam': '" + std::to_string(holeDiam) + "',"; + gearValues += "'thickness': '" + std::to_string(thickness) + "',"; + gearValues += "'rootFilletRad': '" + std::to_string(rootFilletRad) + "',"; + gearValues += "'diametralPitch': '" + std::to_string(diametralPitch * 2.54) + "'}"; + Ptr attrib = newComp->attributes()->add("SpurGear", "Values", gearValues); + if (!checkReturn(attrib)) + return nullptr; + + // Set the name of the component. + newComp->name("Spur Gear (" + std::to_string(numTeeth) + " teeth)"); + + return newComp; +} + + + +#ifdef XI_WIN + +#include + +BOOL APIENTRY DllMain(HMODULE hmodule, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +#endif // XI_WIN diff --git a/usr/autodesk/CPP/Samples/SpurGear/SpurGear.dll b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.dll new file mode 100644 index 0000000..db49601 Binary files /dev/null and b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.dll differ diff --git a/usr/autodesk/CPP/Samples/SpurGear/SpurGear.dylib b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.dylib new file mode 100644 index 0000000..086d912 Binary files /dev/null and b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.dylib differ diff --git a/usr/autodesk/CPP/Samples/SpurGear/SpurGear.manifest b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.manifest new file mode 100644 index 0000000..57b577d --- /dev/null +++ b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.manifest @@ -0,0 +1,11 @@ +{ + "autodeskProduct": "Fusion360", + "type": "script", + "author": "Brian Ekins", + "description": { + "": "Create a spur gear." + }, + "supportedOS": "windows|mac", + "sourcewindows": "SpurGear.vcxproj", + "sourcemac": "SpurGear.xcodeproj" +} \ No newline at end of file diff --git a/usr/autodesk/CPP/Samples/SpurGear/SpurGear.vcxproj b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.vcxproj new file mode 100644 index 0000000..8219d58 --- /dev/null +++ b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {D7CBB035-8CC0-4576-9C72-5076E079586B} + Win32Proj + SpurGear + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/include + + + Windows + true + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/lib + core.lib;fusion.lib;cam.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/include + + + Windows + true + true + true + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/lib + core.lib;fusion.lib;cam.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + NotUsing + NotUsing + + + + + true + true + + + + + + \ No newline at end of file diff --git a/usr/autodesk/CPP/Samples/SpurGear/SpurGear.xcodeproj/project.pbxproj b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c707caa --- /dev/null +++ b/usr/autodesk/CPP/Samples/SpurGear/SpurGear.xcodeproj/project.pbxproj @@ -0,0 +1,269 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2BB196C61AD5940800164CD3 /* SpurGear.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB196C51AD5940800164CD3 /* SpurGear.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2BB196BE1AD586AA00164CD3 /* SpurGear.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = SpurGear.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + 2BB196C51AD5940800164CD3 /* SpurGear.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpurGear.cpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2BB196BB1AD586AA00164CD3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2BB196B51AD586AA00164CD3 = { + isa = PBXGroup; + children = ( + 2BB196C51AD5940800164CD3 /* SpurGear.cpp */, + 2BB196BF1AD586AA00164CD3 /* Products */, + ); + sourceTree = ""; + }; + 2BB196BF1AD586AA00164CD3 /* Products */ = { + isa = PBXGroup; + children = ( + 2BB196BE1AD586AA00164CD3 /* SpurGear.dylib */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2BB196BC1AD586AA00164CD3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2BB196BD1AD586AA00164CD3 /* SpurGear */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "SpurGear" */; + buildPhases = ( + 2BB196BA1AD586AA00164CD3 /* Sources */, + 2BB196BB1AD586AA00164CD3 /* Frameworks */, + 2BB196BC1AD586AA00164CD3 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SpurGear; + productName = SpurGear; + productReference = 2BB196BE1AD586AA00164CD3 /* SpurGear.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2BB196B61AD586AA00164CD3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = Autodesk; + }; + buildConfigurationList = 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "SpurGear" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 2BB196B51AD586AA00164CD3; + productRefGroup = 2BB196BF1AD586AA00164CD3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2BB196BD1AD586AA00164CD3 /* SpurGear */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 2BB196BA1AD586AA00164CD3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2BB196C61AD5940800164CD3 /* SpurGear.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2BB196C01AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/include", + ); + LIBRARY_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 2BB196C11AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/include", + ); + LIBRARY_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + SDKROOT = macosx; + }; + name = Release; + }; + 2BB196C31AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/core.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/fusion.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/cam.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Debug; + }; + 2BB196C41AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/core.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/fusion.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/cam.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "SpurGear" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C01AD586AA00164CD3 /* Debug */, + 2BB196C11AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "SpurGear" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C31AD586AA00164CD3 /* Debug */, + 2BB196C41AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2BB196B61AD586AA00164CD3 /* Project object */; +} diff --git a/usr/autodesk/CPP/Samples/TestScript/TestScript.cpp b/usr/autodesk/CPP/Samples/TestScript/TestScript.cpp new file mode 100644 index 0000000..16eeba8 --- /dev/null +++ b/usr/autodesk/CPP/Samples/TestScript/TestScript.cpp @@ -0,0 +1,43 @@ +//Author-Autodesk Inc. +//Description-Simple script display a message. +#include +#include + + +using namespace adsk::core; + +Ptr ui; + +extern "C" XI_EXPORT bool run(const char* context) +{ + Ptr app = Application::get(); + if (!app) + return false; + + ui = app->userInterface(); + if (!ui) + return false; + + ui->messageBox("Hello script"); + + return true; +} + +#ifdef XI_WIN + +#include + +BOOL APIENTRY DllMain(HMODULE hmodule, DWORD reason, LPVOID reserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +#endif // XI_WIN diff --git a/usr/autodesk/CPP/Samples/TestScript/TestScript.dll b/usr/autodesk/CPP/Samples/TestScript/TestScript.dll new file mode 100644 index 0000000..104c860 Binary files /dev/null and b/usr/autodesk/CPP/Samples/TestScript/TestScript.dll differ diff --git a/usr/autodesk/CPP/Samples/TestScript/TestScript.dylib b/usr/autodesk/CPP/Samples/TestScript/TestScript.dylib new file mode 100644 index 0000000..c648927 Binary files /dev/null and b/usr/autodesk/CPP/Samples/TestScript/TestScript.dylib differ diff --git a/usr/autodesk/CPP/Samples/TestScript/TestScript.manifest b/usr/autodesk/CPP/Samples/TestScript/TestScript.manifest new file mode 100644 index 0000000..d7b734d --- /dev/null +++ b/usr/autodesk/CPP/Samples/TestScript/TestScript.manifest @@ -0,0 +1,11 @@ +{ + "autodeskProduct": "Fusion360", + "type": "script", + "author": "Autodesk Inc.", + "description": { + "": "Simple script display a message." + }, + "supportedOS": "windows|mac", + "sourcewindows": "TestScript.vcxproj", + "sourcemac": "TestScript.xcodeproj" +} \ No newline at end of file diff --git a/usr/autodesk/CPP/Samples/TestScript/TestScript.vcxproj b/usr/autodesk/CPP/Samples/TestScript/TestScript.vcxproj new file mode 100644 index 0000000..0cb4705 --- /dev/null +++ b/usr/autodesk/CPP/Samples/TestScript/TestScript.vcxproj @@ -0,0 +1,107 @@ + + + + + Debug + x64 + + + Release + x64 + + + + {D7CBB035-8CC0-4576-9C72-5076E079586B} + Win32Proj + TestScript + + + + DynamicLibrary + true + v110 + Unicode + + + DynamicLibrary + false + v110 + true + Unicode + + + + + + + + + + + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + false + $(SolutionDir)$(Configuration)\ + $(Configuration)\ + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/include + + + Windows + true + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/lib + core.lib;fusion.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;SIMPLE_EXPORTS;%(PreprocessorDefinitions) + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/include + + + Windows + true + true + true + $(APPDATA)/Autodesk/Autodesk Fusion 360/API/CPP/lib + core.lib;fusion.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + xcopy /R /Y "$(SolutionDir)$(Configuration)\$(ProjectName).dll" "$(SolutionDir)" + + + + + NotUsing + NotUsing + + + + + true + true + + + + + + diff --git a/usr/autodesk/CPP/Samples/TestScript/TestScript.xcodeproj/project.pbxproj b/usr/autodesk/CPP/Samples/TestScript/TestScript.xcodeproj/project.pbxproj new file mode 100644 index 0000000..15461b9 --- /dev/null +++ b/usr/autodesk/CPP/Samples/TestScript/TestScript.xcodeproj/project.pbxproj @@ -0,0 +1,267 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2BB196C61AD5940800164CD3 /* TestScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB196C51AD5940800164CD3 /* TestScript.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2BB196BE1AD586AA00164CD3 /* TestScript.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = TestScript.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; + 2BB196C51AD5940800164CD3 /* TestScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestScript.cpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 2BB196BB1AD586AA00164CD3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2BB196B51AD586AA00164CD3 = { + isa = PBXGroup; + children = ( + 2BB196C51AD5940800164CD3 /* TestScript.cpp */, + 2BB196BF1AD586AA00164CD3 /* Products */, + ); + sourceTree = ""; + }; + 2BB196BF1AD586AA00164CD3 /* Products */ = { + isa = PBXGroup; + children = ( + 2BB196BE1AD586AA00164CD3 /* TestScript.dylib */, + ); + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 2BB196BC1AD586AA00164CD3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 2BB196BD1AD586AA00164CD3 /* TestScript */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "TestScript" */; + buildPhases = ( + 2BB196BA1AD586AA00164CD3 /* Sources */, + 2BB196BB1AD586AA00164CD3 /* Frameworks */, + 2BB196BC1AD586AA00164CD3 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TestScript; + productName = TestScript; + productReference = 2BB196BE1AD586AA00164CD3 /* TestScript.dylib */; + productType = "com.apple.product-type.library.dynamic"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 2BB196B61AD586AA00164CD3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = Autodesk; + }; + buildConfigurationList = 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "TestScript" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 2BB196B51AD586AA00164CD3; + productRefGroup = 2BB196BF1AD586AA00164CD3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 2BB196BD1AD586AA00164CD3 /* TestScript */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 2BB196BA1AD586AA00164CD3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2BB196C61AD5940800164CD3 /* TestScript.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 2BB196C01AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/include", + ); + LIBRARY_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 2BB196C11AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/include", + ); + LIBRARY_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib"; + MACOSX_DEPLOYMENT_TARGET = 11.0; + SDKROOT = macosx; + }; + name = Release; + }; + 2BB196C31AD586AA00164CD3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/core.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/fusion.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Debug; + }; + 2BB196C41AD586AA00164CD3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(EFFECTIVE_PLATFORM_NAME)"; + EXECUTABLE_EXTENSION = dylib; + EXECUTABLE_PREFIX = ""; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(PYTHONINC)", + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, + ); + INSTALL_PATH = "$(SRCROOT)"; + LIBRARY_SEARCH_PATHS = ""; + MACOSX_DEPLOYMENT_TARGET = ""; + OTHER_LDFLAGS = ( + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/core.dylib", + "$(USER_LIBRARY_DIR)/Application\\ Support/Autodesk/Autodesk\\ Fusion\\ 360/API/CPP/lib/fusion.dylib", + ); + PRELINK_LIBS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SYMROOT = "$(SRCROOT)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2BB196B91AD586AA00164CD3 /* Build configuration list for PBXProject "TestScript" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C01AD586AA00164CD3 /* Debug */, + 2BB196C11AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2BB196C21AD586AA00164CD3 /* Build configuration list for PBXNativeTarget "TestScript" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2BB196C31AD586AA00164CD3 /* Debug */, + 2BB196C41AD586AA00164CD3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 2BB196B61AD586AA00164CD3 /* Project object */; +} diff --git a/usr/autodesk/CPP/include/CAM/CAM/CAM.h b/usr/autodesk/CPP/include/CAM/CAM/CAM.h new file mode 100644 index 0000000..6cb0df3 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/CAM.h @@ -0,0 +1,410 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../CAMTypeDefs.h" +#include "../../Core/Application/Product.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_CAM_CPP__ +# define ADSK_CAM_CAM_API XI_EXPORT +# else +# define ADSK_CAM_CAM_API +# endif +#else +# define ADSK_CAM_CAM_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class GenerateToolpathFuture; + class MachiningTime; + class PostProcessInput; + class SetupChangeEvent; + class SetupEvent; + class Setups; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} +namespace adsk { namespace fusion { + class CustomGraphicsGroups; + class Occurrence; + class OccurrenceList; +}} + +namespace adsk { namespace cam { + +/// Object that represents the CAM environment of a Fusion document. +class CAM : public core::Product { +public: + + /// Returns the Setups collection that provides access to existing setups + core::Ptr setups() const; + + /// Exports the default additive setup's models into a 3mf file. The 3mf also contains machine and support information. + /// True on success, false on errors or wrong setup type + bool export3MFForDefaultAdditiveSetup(const std::string& filepath, bool addSimulationInfo = false, bool simPostProcess = false, bool simSplitSurrogates = false, bool simKeepThickeningStructure = false); + + /// Generates/Regenerates all of the toolpaths (including those nested in sub-folders or patterns) + /// for the specified objects. + /// operations : An Operation, Setup, Folder or Pattern object for which to generate the toolpath/s for. You can also + /// specify a collection of any combination of these object types. + /// Return GenerateToolpathFuture that includes the status of toolpath generation. + core::Ptr generateToolpath(const core::Ptr& operations); + + /// Generates/Regenerates all toolpaths (includes those nested in sub-folders or patterns) in the document. + /// skipValid : Option to skip valid toolpaths and only regenerate invalid toolpaths. + /// Return GenerateToolpathFuture that includes the status of toolpath generation. + core::Ptr generateAllToolpaths(bool skipValid); + + /// Clears all of the toolpaths (including those nested in sub-folders or patterns) for the specified objects. + /// operations : An Operation, Setup, Folder or Pattern object for which to clear the toolpath/s for. You can also + /// specify a collection of any combination of these object types. + /// Return true if successful. + bool clearToolpath(const core::Ptr& operations); + + /// Clears all the toolpaths (includes those nested in sub-folders or patterns) in the document + /// Return true if successful. + bool clearAllToolpaths(); + + /// Checks if toolpath operations (including those nested in sub-folders or patterns) are valid for the specified objects. + /// operations : An Operation, Setup, Folder or Pattern object for which to check the toolpath/s of. You can also + /// specify a collection of any combination of these object types. + /// Returns true if the toolpath operations are valid + bool checkToolpath(const core::Ptr& operations); + + /// Checks if all the toolpath operations (includes those nested in sub-folders or patterns) in the document are valid + /// Returns true if the all toolpath operations are valid + bool checkAllToolpaths(); + + /// Post all of the toolpaths (including those nested in sub-folders or patterns) for the specified objects. + /// If post processing fails, an error message can be retrieved from the error log explaining the reason for the failure. + /// operations : An Operation, Setup, Folder or Pattern object for which to post the toolpath/s of. You can also + /// specify a collection of any combination of these object types. + /// input : The PostProcessInput object that defines the post options and parameters. + /// Returns true if successful + bool postProcess(const core::Ptr& operations, const core::Ptr& input); + + /// Post all of the toolpaths (includes those nested in sub-folders or patterns) in the document. + /// If post processing fails, an error message can be retrieved from the error log explaining the reason for the failure. + /// input : The PostProcessInput object that defines the post options and parameters. + /// Returns true if successful. + bool postProcessAll(const core::Ptr& input); + + /// Generate the setup sheets for the specified objects + /// operations : An Operation, Setup, Folder or Pattern object for which to generate the setup sheet/s for. You can also + /// specify a collection of any combination of these object types. + /// format : The document format for the setup sheet. Valid options are HTMLFormat and ExcelFormat. + /// Limitation: "ExcelFormat" can be used in windows OS only. + /// folder : The destination folder to locate the setup sheet documents in. + /// openDocument : An option to allow to open the document instantly after the generation. By default, the document is opened. + /// Returns true if successful + bool generateSetupSheet(const core::Ptr& operations, SetupSheetFormats format, const std::string& folder, bool openDocument = true); + + /// Generates all of the setup sheets for all of the operations in the document + /// format : The document format for the setup sheet. Valid options are HTMLFormat and ExcelFormat. + /// Limitation: "ExcelFormat" can be used in windows OS only. + /// folder : The destination folder to locate the setup sheet documents in. + /// openDocument : An option to allow to open the document instantly after the generation. By default, the document is opened. + /// Returns true if successful + bool generateAllSetupSheets(SetupSheetFormats format, const std::string& folder, bool openDocument = true); + + /// Gets a collection containing all of the operations in the document. + /// This includes all operations nested in folders and patterns. + core::Ptr allOperations() const; + + /// Gets the installed post folder. + std::string genericPostFolder() const; + + /// Gets the personal post folder. + std::string personalPostFolder() const; + + /// Gets the folder for temporary files. + std::string temporaryFolder() const; + + /// Get the machining time for the specified objects. + /// operations : An Operation, Setup, Folder or Pattern object for which to get the machining time for. You can also + /// specify a collection of any combination of these object types. + /// feedScale : The feed scale value (%) to use. + /// rapidFeed : The rapid feed rate in centimeters per second. + /// toolChangeTime : The tool change time in seconds. + /// Returns a MachiningTime object that has properties holding the calculation results. + core::Ptr getMachiningTime(const core::Ptr& operations, double feedScale, double rapidFeed, double toolChangeTime); + + /// Returns the customGraphicsGroups object associated with the CAM product. + core::Ptr customGraphicsGroups() const; + + /// Returns the occurrence that references the design root component in CAM product. + core::Ptr designRootOccurrence() const; + + /// Returns a read only list of flat pattern occurrences in CAM product. + core::Ptr flatPatternOccurrences() const; + + /// Gets a collection containing all of the machines in the document. + core::Ptr allMachines() const; + + /// The SetupCreated event fires when a new setup was created. + core::Ptr setupCreated() const; + + /// The setupDestroying event fires before a setup will be destroyed. + core::Ptr setupDestroying() const; + + /// The SetupChanged event fires when a setup was modified. + core::Ptr setupChanged() const; + + /// The SetupActivating event fires before a setup will be activated. + core::Ptr setupActivating() const; + + /// The SetupActivated event fires when a setup was activated. + core::Ptr setupActivated() const; + + /// The SetupDeactivating event fires before a setup will be deactivated. + core::Ptr setupDeactivating() const; + + /// The SetupDeactivated event fires when a setup was deactivated. + core::Ptr setupDeactivated() const; + + ADSK_CAM_CAM_API static const char* classType(); + ADSK_CAM_CAM_API const char* objectType() const override; + ADSK_CAM_CAM_API void* queryInterface(const char* id) const override; + ADSK_CAM_CAM_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Setups* setups_raw() const = 0; + virtual bool export3MFForDefaultAdditiveSetup_raw(const char * filepath, bool addSimulationInfo, bool simPostProcess, bool simSplitSurrogates, bool simKeepThickeningStructure) = 0; + virtual GenerateToolpathFuture* generateToolpath_raw(core::Base* operations) = 0; + virtual GenerateToolpathFuture* generateAllToolpaths_raw(bool skipValid) = 0; + virtual bool clearToolpath_raw(core::Base* operations) = 0; + virtual bool clearAllToolpaths_raw() = 0; + virtual bool checkToolpath_raw(core::Base* operations) = 0; + virtual bool checkAllToolpaths_raw() = 0; + virtual bool postProcess_raw(core::Base* operations, PostProcessInput* input) = 0; + virtual bool postProcessAll_raw(PostProcessInput* input) = 0; + virtual bool generateSetupSheet_raw(core::Base* operations, SetupSheetFormats format, const char * folder, bool openDocument) = 0; + virtual bool generateAllSetupSheets_raw(SetupSheetFormats format, const char * folder, bool openDocument) = 0; + virtual core::ObjectCollection* allOperations_raw() const = 0; + virtual char* genericPostFolder_raw() const = 0; + virtual char* personalPostFolder_raw() const = 0; + virtual char* temporaryFolder_raw() const = 0; + virtual MachiningTime* getMachiningTime_raw(core::Base* operations, double feedScale, double rapidFeed, double toolChangeTime) = 0; + virtual fusion::CustomGraphicsGroups* customGraphicsGroups_raw() const = 0; + virtual fusion::Occurrence* designRootOccurrence_raw() const = 0; + virtual fusion::OccurrenceList* flatPatternOccurrences_raw() const = 0; + virtual core::ObjectCollection* allMachines_raw() const = 0; + virtual SetupEvent* setupCreated_raw() const = 0; + virtual SetupEvent* setupDestroying_raw() const = 0; + virtual SetupChangeEvent* setupChanged_raw() const = 0; + virtual SetupEvent* setupActivating_raw() const = 0; + virtual SetupEvent* setupActivated_raw() const = 0; + virtual SetupEvent* setupDeactivating_raw() const = 0; + virtual SetupEvent* setupDeactivated_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr CAM::setups() const +{ + core::Ptr res = setups_raw(); + return res; +} + +inline bool CAM::export3MFForDefaultAdditiveSetup(const std::string& filepath, bool addSimulationInfo, bool simPostProcess, bool simSplitSurrogates, bool simKeepThickeningStructure) +{ + bool res = export3MFForDefaultAdditiveSetup_raw(filepath.c_str(), addSimulationInfo, simPostProcess, simSplitSurrogates, simKeepThickeningStructure); + return res; +} + +inline core::Ptr CAM::generateToolpath(const core::Ptr& operations) +{ + core::Ptr res = generateToolpath_raw(operations.get()); + return res; +} + +inline core::Ptr CAM::generateAllToolpaths(bool skipValid) +{ + core::Ptr res = generateAllToolpaths_raw(skipValid); + return res; +} + +inline bool CAM::clearToolpath(const core::Ptr& operations) +{ + bool res = clearToolpath_raw(operations.get()); + return res; +} + +inline bool CAM::clearAllToolpaths() +{ + bool res = clearAllToolpaths_raw(); + return res; +} + +inline bool CAM::checkToolpath(const core::Ptr& operations) +{ + bool res = checkToolpath_raw(operations.get()); + return res; +} + +inline bool CAM::checkAllToolpaths() +{ + bool res = checkAllToolpaths_raw(); + return res; +} + +inline bool CAM::postProcess(const core::Ptr& operations, const core::Ptr& input) +{ + bool res = postProcess_raw(operations.get(), input.get()); + return res; +} + +inline bool CAM::postProcessAll(const core::Ptr& input) +{ + bool res = postProcessAll_raw(input.get()); + return res; +} + +inline bool CAM::generateSetupSheet(const core::Ptr& operations, SetupSheetFormats format, const std::string& folder, bool openDocument) +{ + bool res = generateSetupSheet_raw(operations.get(), format, folder.c_str(), openDocument); + return res; +} + +inline bool CAM::generateAllSetupSheets(SetupSheetFormats format, const std::string& folder, bool openDocument) +{ + bool res = generateAllSetupSheets_raw(format, folder.c_str(), openDocument); + return res; +} + +inline core::Ptr CAM::allOperations() const +{ + core::Ptr res = allOperations_raw(); + return res; +} + +inline std::string CAM::genericPostFolder() const +{ + std::string res; + + char* p= genericPostFolder_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CAM::personalPostFolder() const +{ + std::string res; + + char* p= personalPostFolder_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CAM::temporaryFolder() const +{ + std::string res; + + char* p= temporaryFolder_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr CAM::getMachiningTime(const core::Ptr& operations, double feedScale, double rapidFeed, double toolChangeTime) +{ + core::Ptr res = getMachiningTime_raw(operations.get(), feedScale, rapidFeed, toolChangeTime); + return res; +} + +inline core::Ptr CAM::customGraphicsGroups() const +{ + core::Ptr res = customGraphicsGroups_raw(); + return res; +} + +inline core::Ptr CAM::designRootOccurrence() const +{ + core::Ptr res = designRootOccurrence_raw(); + return res; +} + +inline core::Ptr CAM::flatPatternOccurrences() const +{ + core::Ptr res = flatPatternOccurrences_raw(); + return res; +} + +inline core::Ptr CAM::allMachines() const +{ + core::Ptr res = allMachines_raw(); + return res; +} + +inline core::Ptr CAM::setupCreated() const +{ + core::Ptr res = setupCreated_raw(); + return res; +} + +inline core::Ptr CAM::setupDestroying() const +{ + core::Ptr res = setupDestroying_raw(); + return res; +} + +inline core::Ptr CAM::setupChanged() const +{ + core::Ptr res = setupChanged_raw(); + return res; +} + +inline core::Ptr CAM::setupActivating() const +{ + core::Ptr res = setupActivating_raw(); + return res; +} + +inline core::Ptr CAM::setupActivated() const +{ + core::Ptr res = setupActivated_raw(); + return res; +} + +inline core::Ptr CAM::setupDeactivating() const +{ + core::Ptr res = setupDeactivating_raw(); + return res; +} + +inline core::Ptr CAM::setupDeactivated() const +{ + core::Ptr res = setupDeactivated_raw(); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_CAM_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/CAMFolder.h b/usr/autodesk/CPP/include/CAM/CAM/CAMFolder.h new file mode 100644 index 0000000..4f2deaf --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/CAMFolder.h @@ -0,0 +1,170 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../Operations/OperationBase.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_CAMFOLDER_CPP__ +# define ADSK_CAM_CAMFOLDER_API XI_EXPORT +# else +# define ADSK_CAM_CAMFOLDER_API +# endif +#else +# define ADSK_CAM_CAMFOLDER_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class CAMFolders; + class CAMPatterns; + class ChildOperationList; + class Operations; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace cam { + +/// Object that represents a folder in an existing Setup, Folder or Pattern. +class CAMFolder : public OperationBase { +public: + + /// Gets if this folder is active. + bool isActive() const; + + /// Returns the Operations collection that provides access to existing individual operations + /// in this folder. + core::Ptr operations() const; + + /// Returns the Folders collection that provides access to existing folders + /// in this folder. + core::Ptr folders() const; + + /// Returns the Patterns collection that provides access to existing patterns + /// in this folder. + core::Ptr patterns() const; + + /// Returns a collection containing all of the immediate (top level) child operations, folders and patterns in this folder + /// in the order they appear in the browser. + core::Ptr children() const; + + /// Returns the parent Setup, Folder or Pattern for this Folder. + core::Ptr parent() const; + + /// Gets a collection containing all of the operations in this folder. + /// This includes all operations nested in folders and patterns. + core::Ptr allOperations() const; + + /// Create and add operations, folders or patterns from the specified template file to the end of this folder. + /// templateFilePath : The full path to the template file. + /// Returns the collection containing all of the operations, folders and patterns created from the template file. + core::Ptr createFromTemplate(const std::string& templateFilePath); + + ADSK_CAM_CAMFOLDER_API static const char* classType(); + ADSK_CAM_CAMFOLDER_API const char* objectType() const override; + ADSK_CAM_CAMFOLDER_API void* queryInterface(const char* id) const override; + ADSK_CAM_CAMFOLDER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isActive_raw() const = 0; + virtual Operations* operations_raw() const = 0; + virtual CAMFolders* folders_raw() const = 0; + virtual CAMPatterns* patterns_raw() const = 0; + virtual ChildOperationList* children_raw() const = 0; + virtual core::Base* parent_raw() const = 0; + virtual core::ObjectCollection* allOperations_raw() const = 0; + virtual core::ObjectCollection* createFromTemplate_raw(const char * templateFilePath) = 0; + virtual void placeholderCAMFolder0() {} + virtual void placeholderCAMFolder1() {} + virtual void placeholderCAMFolder2() {} + virtual void placeholderCAMFolder3() {} + virtual void placeholderCAMFolder4() {} + virtual void placeholderCAMFolder5() {} + virtual void placeholderCAMFolder6() {} + virtual void placeholderCAMFolder7() {} + virtual void placeholderCAMFolder8() {} + virtual void placeholderCAMFolder9() {} + virtual void placeholderCAMFolder10() {} + virtual void placeholderCAMFolder11() {} + virtual void placeholderCAMFolder12() {} + virtual void placeholderCAMFolder13() {} + virtual void placeholderCAMFolder14() {} + virtual void placeholderCAMFolder15() {} + virtual void placeholderCAMFolder16() {} + virtual void placeholderCAMFolder17() {} + virtual void placeholderCAMFolder18() {} + virtual void placeholderCAMFolder19() {} + virtual void placeholderCAMFolder20() {} + virtual void placeholderCAMFolder21() {} + virtual void placeholderCAMFolder22() {} + virtual void placeholderCAMFolder23() {} +}; + +// Inline wrappers + +inline bool CAMFolder::isActive() const +{ + bool res = isActive_raw(); + return res; +} + +inline core::Ptr CAMFolder::operations() const +{ + core::Ptr res = operations_raw(); + return res; +} + +inline core::Ptr CAMFolder::folders() const +{ + core::Ptr res = folders_raw(); + return res; +} + +inline core::Ptr CAMFolder::patterns() const +{ + core::Ptr res = patterns_raw(); + return res; +} + +inline core::Ptr CAMFolder::children() const +{ + core::Ptr res = children_raw(); + return res; +} + +inline core::Ptr CAMFolder::parent() const +{ + core::Ptr res = parent_raw(); + return res; +} + +inline core::Ptr CAMFolder::allOperations() const +{ + core::Ptr res = allOperations_raw(); + return res; +} + +inline core::Ptr CAMFolder::createFromTemplate(const std::string& templateFilePath) +{ + core::Ptr res = createFromTemplate_raw(templateFilePath.c_str()); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_CAMFOLDER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/CAMFolders.h b/usr/autodesk/CPP/include/CAM/CAM/CAMFolders.h new file mode 100644 index 0000000..cac98fc --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/CAMFolders.h @@ -0,0 +1,112 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_CAMFOLDERS_CPP__ +# define ADSK_CAM_CAMFOLDERS_API XI_EXPORT +# else +# define ADSK_CAM_CAMFOLDERS_API +# endif +#else +# define ADSK_CAM_CAMFOLDERS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class CAMFolder; +}} + +namespace adsk { namespace cam { + +/// Collection that provides access to the folders within an existing setup, folder or pattern. +class CAMFolders : public core::Base { +public: + + /// Function that returns the specified folder using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the folder with the specified name (as appears in the browser). + /// name : The name (as it appears in the browser) of the folder. + /// Returns the specified folder or null in the case where there is no folder with the specified name. + core::Ptr itemByName(const std::string& name) const; + + /// The number of items in the collection. + size_t count() const; + + /// Returns the folder with the specified operation id. + /// id : The id of the folder. + /// Returns the specified folder or null in the case where there is no folder with the specified operation id. + core::Ptr itemByOperationId(int id) const; + + typedef CAMFolder iterable_type; + template void copyTo(OutputIterator result); + + ADSK_CAM_CAMFOLDERS_API static const char* classType(); + ADSK_CAM_CAMFOLDERS_API const char* objectType() const override; + ADSK_CAM_CAMFOLDERS_API void* queryInterface(const char* id) const override; + ADSK_CAM_CAMFOLDERS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CAMFolder* item_raw(size_t index) const = 0; + virtual CAMFolder* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual CAMFolder* itemByOperationId_raw(int id) const = 0; +}; + +// Inline wrappers + +inline core::Ptr CAMFolders::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr CAMFolders::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t CAMFolders::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CAMFolders::itemByOperationId(int id) const +{ + core::Ptr res = itemByOperationId_raw(id); + return res; +} + +template inline void CAMFolders::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_CAMFOLDERS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/CAMPattern.h b/usr/autodesk/CPP/include/CAM/CAM/CAMPattern.h new file mode 100644 index 0000000..80fed2e --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/CAMPattern.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "CAMFolder.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_CAMPATTERN_CPP__ +# define ADSK_CAM_CAMPATTERN_API XI_EXPORT +# else +# define ADSK_CAM_CAMPATTERN_API +# endif +#else +# define ADSK_CAM_CAMPATTERN_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// Object that represents a pattern in an existing Setup, Folder or Pattern. +class CAMPattern : public CAMFolder { +public: + + ADSK_CAM_CAMPATTERN_API static const char* classType(); + ADSK_CAM_CAMPATTERN_API const char* objectType() const override; + ADSK_CAM_CAMPATTERN_API void* queryInterface(const char* id) const override; + ADSK_CAM_CAMPATTERN_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_CAMPATTERN_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/CAMPatterns.h b/usr/autodesk/CPP/include/CAM/CAM/CAMPatterns.h new file mode 100644 index 0000000..ab77a42 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/CAMPatterns.h @@ -0,0 +1,112 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_CAMPATTERNS_CPP__ +# define ADSK_CAM_CAMPATTERNS_API XI_EXPORT +# else +# define ADSK_CAM_CAMPATTERNS_API +# endif +#else +# define ADSK_CAM_CAMPATTERNS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class CAMPattern; +}} + +namespace adsk { namespace cam { + +/// Collection that provides access to the patterns within an existing setup, folder or pattern. +class CAMPatterns : public core::Base { +public: + + /// Function that returns the specified pattern using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the pattern with the specified name (as appears in the browser). + /// name : The name (as it appears in the browser) of the pattern. + /// Returns the specified pattern or null in the case where there is no pattern with the specified name. + core::Ptr itemByName(const std::string& name) const; + + /// The number of items in the collection. + size_t count() const; + + /// Returns the pattern with the specified operation id. + /// id : The id of the pattern. + /// Returns the specified pattern or null in the case where there is no pattern with the specified operation id. + core::Ptr itemByOperationId(int id) const; + + typedef CAMPattern iterable_type; + template void copyTo(OutputIterator result); + + ADSK_CAM_CAMPATTERNS_API static const char* classType(); + ADSK_CAM_CAMPATTERNS_API const char* objectType() const override; + ADSK_CAM_CAMPATTERNS_API void* queryInterface(const char* id) const override; + ADSK_CAM_CAMPATTERNS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CAMPattern* item_raw(size_t index) const = 0; + virtual CAMPattern* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual CAMPattern* itemByOperationId_raw(int id) const = 0; +}; + +// Inline wrappers + +inline core::Ptr CAMPatterns::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr CAMPatterns::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t CAMPatterns::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CAMPatterns::itemByOperationId(int id) const +{ + core::Ptr res = itemByOperationId_raw(id); + return res; +} + +template inline void CAMPatterns::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_CAMPATTERNS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/ChildOperationList.h b/usr/autodesk/CPP/include/CAM/CAM/ChildOperationList.h new file mode 100644 index 0000000..3c54dbe --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/ChildOperationList.h @@ -0,0 +1,108 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_CHILDOPERATIONLIST_CPP__ +# define ADSK_CAM_CHILDOPERATIONLIST_API XI_EXPORT +# else +# define ADSK_CAM_CHILDOPERATIONLIST_API +# endif +#else +# define ADSK_CAM_CHILDOPERATIONLIST_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// Provides access to the collection of child operations, folders and patterns of an existing setup. +class ChildOperationList : public core::Base { +public: + + /// Returns the specified item using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the operation, folder or pattern with the specified name (the name seen in the browser). + /// name : The name of the operation, folder or pattern as seen in the browser. + /// Returns the specified item or null in the case where there is no item with the specified name. + core::Ptr itemByName(const std::string& name) const; + + /// Gets the number of objects in the collection. + size_t count() const; + + /// Returns the operation, folder or pattern with the specified operation id. + /// id : The id of the operation, folder or pattern. + /// Returns the specified item or null in the case where there is no item with the specified operation id. + core::Ptr itemByOperationId(int id) const; + + typedef Base iterable_type; + template void copyTo(OutputIterator result); + + ADSK_CAM_CHILDOPERATIONLIST_API static const char* classType(); + ADSK_CAM_CHILDOPERATIONLIST_API const char* objectType() const override; + ADSK_CAM_CHILDOPERATIONLIST_API void* queryInterface(const char* id) const override; + ADSK_CAM_CHILDOPERATIONLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* item_raw(size_t index) const = 0; + virtual core::Base* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual core::Base* itemByOperationId_raw(int id) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ChildOperationList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr ChildOperationList::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t ChildOperationList::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ChildOperationList::itemByOperationId(int id) const +{ + core::Ptr res = itemByOperationId_raw(id); + return res; +} + +template inline void ChildOperationList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_CHILDOPERATIONLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/GenerateToolpathFuture.h b/usr/autodesk/CPP/include/CAM/CAM/GenerateToolpathFuture.h new file mode 100644 index 0000000..0ec5a27 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/GenerateToolpathFuture.h @@ -0,0 +1,93 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_GENERATETOOLPATHFUTURE_CPP__ +# define ADSK_CAM_GENERATETOOLPATHFUTURE_API XI_EXPORT +# else +# define ADSK_CAM_GENERATETOOLPATHFUTURE_API +# endif +#else +# define ADSK_CAM_GENERATETOOLPATHFUTURE_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class Operations; +}} + +namespace adsk { namespace cam { + +/// Used to check the state and get back the results of toolpath generation. +class GenerateToolpathFuture : public core::Base { +public: + + /// Returns a number of operations need to be generated. + int numberOfOperations() const; + + /// Returns a number of operations whose toolpath generation are completed. + int numberOfCompleted() const; + + /// Returns all operations that need to be generated. + core::Ptr operations() const; + + /// Returns true if all operations are generated. + bool isGenerationCompleted() const; + + ADSK_CAM_GENERATETOOLPATHFUTURE_API static const char* classType(); + ADSK_CAM_GENERATETOOLPATHFUTURE_API const char* objectType() const override; + ADSK_CAM_GENERATETOOLPATHFUTURE_API void* queryInterface(const char* id) const override; + ADSK_CAM_GENERATETOOLPATHFUTURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual int numberOfOperations_raw() const = 0; + virtual int numberOfCompleted_raw() const = 0; + virtual Operations* operations_raw() const = 0; + virtual bool isGenerationCompleted_raw() const = 0; +}; + +// Inline wrappers + +inline int GenerateToolpathFuture::numberOfOperations() const +{ + int res = numberOfOperations_raw(); + return res; +} + +inline int GenerateToolpathFuture::numberOfCompleted() const +{ + int res = numberOfCompleted_raw(); + return res; +} + +inline core::Ptr GenerateToolpathFuture::operations() const +{ + core::Ptr res = operations_raw(); + return res; +} + +inline bool GenerateToolpathFuture::isGenerationCompleted() const +{ + bool res = isGenerationCompleted_raw(); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_GENERATETOOLPATHFUTURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/MachiningTime.h b/usr/autodesk/CPP/include/CAM/CAM/MachiningTime.h new file mode 100644 index 0000000..a3e194a --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/MachiningTime.h @@ -0,0 +1,120 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_MACHININGTIME_CPP__ +# define ADSK_CAM_MACHININGTIME_API XI_EXPORT +# else +# define ADSK_CAM_MACHININGTIME_API +# endif +#else +# define ADSK_CAM_MACHININGTIME_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// Object returned when using the getMachiningTime method from the CAM class. +/// Use the properties on this object to get the machining time results. +class MachiningTime : public core::Base { +public: + + /// Gets the feed distance in centimeters. + double feedDistance() const; + + /// Get the total feed time in seconds. + double totalFeedTime() const; + + /// Gets the calculated rapid distance in centimeters. + double rapidDistance() const; + + /// Gets the total rapid feed time in seconds. + double totalRapidTime() const; + + /// Gets the number of tool changes. + int toolChangeCount() const; + + /// Gets the total tool change time in seconds. + double totalToolChangeTime() const; + + /// Gets the machining time in seconds. + double machiningTime() const; + + ADSK_CAM_MACHININGTIME_API static const char* classType(); + ADSK_CAM_MACHININGTIME_API const char* objectType() const override; + ADSK_CAM_MACHININGTIME_API void* queryInterface(const char* id) const override; + ADSK_CAM_MACHININGTIME_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual double feedDistance_raw() const = 0; + virtual double totalFeedTime_raw() const = 0; + virtual double rapidDistance_raw() const = 0; + virtual double totalRapidTime_raw() const = 0; + virtual int toolChangeCount_raw() const = 0; + virtual double totalToolChangeTime_raw() const = 0; + virtual double machiningTime_raw() const = 0; +}; + +// Inline wrappers + +inline double MachiningTime::feedDistance() const +{ + double res = feedDistance_raw(); + return res; +} + +inline double MachiningTime::totalFeedTime() const +{ + double res = totalFeedTime_raw(); + return res; +} + +inline double MachiningTime::rapidDistance() const +{ + double res = rapidDistance_raw(); + return res; +} + +inline double MachiningTime::totalRapidTime() const +{ + double res = totalRapidTime_raw(); + return res; +} + +inline int MachiningTime::toolChangeCount() const +{ + int res = toolChangeCount_raw(); + return res; +} + +inline double MachiningTime::totalToolChangeTime() const +{ + double res = totalToolChangeTime_raw(); + return res; +} + +inline double MachiningTime::machiningTime() const +{ + double res = machiningTime_raw(); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_MACHININGTIME_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/PostProcessInput.h b/usr/autodesk/CPP/include/CAM/CAM/PostProcessInput.h new file mode 100644 index 0000000..3a47b36 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/PostProcessInput.h @@ -0,0 +1,272 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_POSTPROCESSINPUT_CPP__ +# define ADSK_CAM_POSTPROCESSINPUT_API XI_EXPORT +# else +# define ADSK_CAM_POSTPROCESSINPUT_API +# endif +#else +# define ADSK_CAM_POSTPROCESSINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class Machine; +}} +namespace adsk { namespace core { + class NamedValues; +}} + +namespace adsk { namespace cam { + +/// This class defines the properties that pertain to the settings and options required for posting a +/// toolpath to generate a CNC file. A PostProcessInput object is a required parameter for the +/// postProcessAll() and postProcess() methods on the CAM class. +class PostProcessInput : public core::Base { +public: + + /// Creates a new PostProcessInput object to be used as an input argument by the postProcess() and postProcessAll() + /// methods on the CAM class for posting toolpaths and generating CNC files. + /// programName : The program name or number. + /// If the post configuration specifies the parameter programNameIsInteger = true, then the program name must be a number. + /// postConfiguration : The full filename (including the path) to the post configuration file (.cps) + /// The post config file can be stored in any path but for convenience you can use the genericPostFolder or the personalPostFolder property on the CAM class to specify + /// the path if your .cps file is stored in either of those locations. You must add a forward slash (this works for Mac or Windows) to the path defined by these folder + /// properties before the filename (e.g. postConfiguration = cam.genericPostFolder + '/' + 'fanuc.cps') + /// outputFolder : The path for the existing output folder where the .cnc files will be located. This method will create the specified output folder if it does not already exist. + /// It is not necessary to add a slash to the end of the outputFolder path. You should use forward slashes in your path definition if you want your script to run on both Mac and Windows. + /// outputUnits : The units option for the cnc output. + /// Valid options are DocumentUnitsOutput, InchesOutput or MillimetersOutput + /// Returns the newly created PostProcessInput object or null if the creation failed. + static core::Ptr create(const std::string& programName, const std::string& postConfiguration, const std::string& outputFolder, PostOutputUnitOptions outputUnits); + + /// Gets and sets the program name or number. + /// If the post configuration specifies the parameter programNameIsInteger = true, then the program name must be a number. + std::string programName() const; + bool programName(const std::string& value); + + /// Gets and sets the program comment. The default value for this property is an empty string (""). + std::string programComment() const; + bool programComment(const std::string& value); + + /// Gets and sets the full filename (including the path) for the post configuration file (.cps) + std::string postConfiguration() const; + bool postConfiguration(const std::string& value); + + /// Gets and sets the path for the output folder where the .cnc files will be located. + std::string outputFolder() const; + bool outputFolder(const std::string& value); + + /// Gets and sets the units option for the cnc output. + /// Valid options are DocumentUnitsOutput, InchesOutput or MillimetersOutput + PostOutputUnitOptions outputUnits() const; + bool outputUnits(PostOutputUnitOptions value); + + /// Gets and sets the option if opening the cnc file with the editor after it is created. + /// The default value for this property is true. + bool isOpenInEditor() const; + bool isOpenInEditor(bool value); + + /// Gets and sets that operations may be reordered between setups to minimize the number of tool changes. + /// Operations within each setup will still be executed in the programmed order. + /// This is commonly used for tombstone machining where you have multiple setups. + /// The default value for this property is false. + bool areToolChangesMinimized() const; + bool areToolChangesMinimized(bool value); + + /// Gets and sets the list of post properties. + /// Each property has a string name and a ValueInput object. + /// The default value for this is an empty NamedValues. + core::Ptr postProperties() const; + bool postProperties(const core::Ptr& value); + + /// Gets and sets the machine used for post processing. + /// It will override the machines associated with the operations or setup when posting. + /// The default value for this property is null. + core::Ptr machine() const; + bool machine(const core::Ptr& value); + + ADSK_CAM_POSTPROCESSINPUT_API static const char* classType(); + ADSK_CAM_POSTPROCESSINPUT_API const char* objectType() const override; + ADSK_CAM_POSTPROCESSINPUT_API void* queryInterface(const char* id) const override; + ADSK_CAM_POSTPROCESSINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_CAM_POSTPROCESSINPUT_API static PostProcessInput* create_raw(const char * programName, const char * postConfiguration, const char * outputFolder, PostOutputUnitOptions outputUnits); + virtual char* programName_raw() const = 0; + virtual bool programName_raw(const char * value) = 0; + virtual char* programComment_raw() const = 0; + virtual bool programComment_raw(const char * value) = 0; + virtual char* postConfiguration_raw() const = 0; + virtual bool postConfiguration_raw(const char * value) = 0; + virtual char* outputFolder_raw() const = 0; + virtual bool outputFolder_raw(const char * value) = 0; + virtual PostOutputUnitOptions outputUnits_raw() const = 0; + virtual bool outputUnits_raw(PostOutputUnitOptions value) = 0; + virtual bool isOpenInEditor_raw() const = 0; + virtual bool isOpenInEditor_raw(bool value) = 0; + virtual bool areToolChangesMinimized_raw() const = 0; + virtual bool areToolChangesMinimized_raw(bool value) = 0; + virtual core::NamedValues* postProperties_raw() const = 0; + virtual bool postProperties_raw(core::NamedValues* value) = 0; + virtual Machine* machine_raw() const = 0; + virtual bool machine_raw(Machine* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr PostProcessInput::create(const std::string& programName, const std::string& postConfiguration, const std::string& outputFolder, PostOutputUnitOptions outputUnits) +{ + core::Ptr res = create_raw(programName.c_str(), postConfiguration.c_str(), outputFolder.c_str(), outputUnits); + return res; +} + +inline std::string PostProcessInput::programName() const +{ + std::string res; + + char* p= programName_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool PostProcessInput::programName(const std::string& value) +{ + return programName_raw(value.c_str()); +} + +inline std::string PostProcessInput::programComment() const +{ + std::string res; + + char* p= programComment_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool PostProcessInput::programComment(const std::string& value) +{ + return programComment_raw(value.c_str()); +} + +inline std::string PostProcessInput::postConfiguration() const +{ + std::string res; + + char* p= postConfiguration_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool PostProcessInput::postConfiguration(const std::string& value) +{ + return postConfiguration_raw(value.c_str()); +} + +inline std::string PostProcessInput::outputFolder() const +{ + std::string res; + + char* p= outputFolder_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool PostProcessInput::outputFolder(const std::string& value) +{ + return outputFolder_raw(value.c_str()); +} + +inline PostOutputUnitOptions PostProcessInput::outputUnits() const +{ + PostOutputUnitOptions res = outputUnits_raw(); + return res; +} + +inline bool PostProcessInput::outputUnits(PostOutputUnitOptions value) +{ + return outputUnits_raw(value); +} + +inline bool PostProcessInput::isOpenInEditor() const +{ + bool res = isOpenInEditor_raw(); + return res; +} + +inline bool PostProcessInput::isOpenInEditor(bool value) +{ + return isOpenInEditor_raw(value); +} + +inline bool PostProcessInput::areToolChangesMinimized() const +{ + bool res = areToolChangesMinimized_raw(); + return res; +} + +inline bool PostProcessInput::areToolChangesMinimized(bool value) +{ + return areToolChangesMinimized_raw(value); +} + +inline core::Ptr PostProcessInput::postProperties() const +{ + core::Ptr res = postProperties_raw(); + return res; +} + +inline bool PostProcessInput::postProperties(const core::Ptr& value) +{ + return postProperties_raw(value.get()); +} + +inline core::Ptr PostProcessInput::machine() const +{ + core::Ptr res = machine_raw(); + return res; +} + +inline bool PostProcessInput::machine(const core::Ptr& value) +{ + return machine_raw(value.get()); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_POSTPROCESSINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/Setup.h b/usr/autodesk/CPP/include/CAM/CAM/Setup.h new file mode 100644 index 0000000..7e28944 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/Setup.h @@ -0,0 +1,197 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../CAMTypeDefs.h" +#include "../Operations/OperationBase.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_SETUP_CPP__ +# define ADSK_CAM_SETUP_API XI_EXPORT +# else +# define ADSK_CAM_SETUP_API +# endif +#else +# define ADSK_CAM_SETUP_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class CAMFolders; + class CAMPatterns; + class ChildOperationList; + class Machine; + class Operations; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace cam { + +/// Object that represents an existing Setup. +class Setup : public OperationBase { +public: + + /// Gets the Operation Type. + /// It can be MillingOperation, TurningOperation, JetOperation or AdditiveOperation. + OperationTypes operationType() const; + + /// Gets if this setup is active. + bool isActive() const; + + /// Returns the Operations collection that provides access to existing operations + /// in this setup. + core::Ptr operations() const; + + /// Returns the Folders collection that provides access to existing folders + /// in this setup. + core::Ptr folders() const; + + /// Returns the Patterns collection that provides access to existing patterns + /// in this setup. + core::Ptr patterns() const; + + /// Returns a collection containing all of the immediate (top level) child operations, folders and patterns in this setup + /// in the order they appear in the browser. + core::Ptr children() const; + + /// Gets a collection containing all of the operations in this setup. + /// This includes all operations nested in folders and patterns. + core::Ptr allOperations() const; + + /// Gets and sets the bodies associated with the setup. Passing in an empty ObjectCollection + /// will remove all current bodies. Valid input is MeshBody and/or BRepBody objects. + core::Ptr models() const; + bool models(const core::Ptr& value); + + /// Gets the fixtures associated with the setup. + core::Ptr fixtures() const; + + /// Gets the stock solids associated with the setup. + core::Ptr stockSolids() const; + + /// Gets the Machine associated with the setup. + core::Ptr machine() const; + + /// Create and add operations, folders or patterns from the specified template file to the end of this setup. + /// templateFilePath : The full path to the template file. + /// Returns the collection containing all of the operations, folders and patterns created from the template file. + core::Ptr createFromTemplate(const std::string& templateFilePath); + + ADSK_CAM_SETUP_API static const char* classType(); + ADSK_CAM_SETUP_API const char* objectType() const override; + ADSK_CAM_SETUP_API void* queryInterface(const char* id) const override; + ADSK_CAM_SETUP_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual OperationTypes operationType_raw() const = 0; + virtual bool isActive_raw() const = 0; + virtual Operations* operations_raw() const = 0; + virtual CAMFolders* folders_raw() const = 0; + virtual CAMPatterns* patterns_raw() const = 0; + virtual ChildOperationList* children_raw() const = 0; + virtual core::ObjectCollection* allOperations_raw() const = 0; + virtual core::ObjectCollection* models_raw() const = 0; + virtual bool models_raw(core::ObjectCollection* value) = 0; + virtual core::ObjectCollection* fixtures_raw() const = 0; + virtual core::ObjectCollection* stockSolids_raw() const = 0; + virtual Machine* machine_raw() const = 0; + virtual core::ObjectCollection* createFromTemplate_raw(const char * templateFilePath) = 0; +}; + +// Inline wrappers + +inline OperationTypes Setup::operationType() const +{ + OperationTypes res = operationType_raw(); + return res; +} + +inline bool Setup::isActive() const +{ + bool res = isActive_raw(); + return res; +} + +inline core::Ptr Setup::operations() const +{ + core::Ptr res = operations_raw(); + return res; +} + +inline core::Ptr Setup::folders() const +{ + core::Ptr res = folders_raw(); + return res; +} + +inline core::Ptr Setup::patterns() const +{ + core::Ptr res = patterns_raw(); + return res; +} + +inline core::Ptr Setup::children() const +{ + core::Ptr res = children_raw(); + return res; +} + +inline core::Ptr Setup::allOperations() const +{ + core::Ptr res = allOperations_raw(); + return res; +} + +inline core::Ptr Setup::models() const +{ + core::Ptr res = models_raw(); + return res; +} + +inline bool Setup::models(const core::Ptr& value) +{ + return models_raw(value.get()); +} + +inline core::Ptr Setup::fixtures() const +{ + core::Ptr res = fixtures_raw(); + return res; +} + +inline core::Ptr Setup::stockSolids() const +{ + core::Ptr res = stockSolids_raw(); + return res; +} + +inline core::Ptr Setup::machine() const +{ + core::Ptr res = machine_raw(); + return res; +} + +inline core::Ptr Setup::createFromTemplate(const std::string& templateFilePath) +{ + core::Ptr res = createFromTemplate_raw(templateFilePath.c_str()); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_SETUP_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/SetupEvents.h b/usr/autodesk/CPP/include/CAM/CAM/SetupEvents.h new file mode 100644 index 0000000..7c43427 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/SetupEvents.h @@ -0,0 +1,226 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Application/Events.h" +#include "../../Core/Application/EventHandler.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_SETUPEVENTS_CPP__ +# define SETUPEVENTS_API XI_EXPORT +# else +# define SETUPEVENTS_API +# endif +#else +# define SETUPEVENTS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class Setup; + class SetupChangeEvent; + class SetupChangeEventArgs; + class SetupChangeEventHandler; + class SetupEventArgs; + class SetupEventHandler; +}} + +namespace adsk { namespace cam { + +/// A SetupEvent represents a setup related event. For example, SetupCreated or SetupDestroying. +class SetupEvent : public core::Event { +public: + + /// Add a handler to be notified when the file event occurs. + /// handler : The handler object to be called when this event is fired. + /// Returns true if the addition of the handler was successful. + bool add(SetupEventHandler* handler); + + /// Removes a handler from the event. + /// handler : The handler object to be removed from the event. + /// Returns true if removal of the handler was successful. + bool remove(SetupEventHandler* handler); + + SETUPEVENTS_API static const char* classType(); + SETUPEVENTS_API const char* objectType() const override; + SETUPEVENTS_API void* queryInterface(const char* id) const override; + SETUPEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool add_raw(SetupEventHandler* handler) = 0; + virtual bool remove_raw(SetupEventHandler* handler) = 0; +}; + +// Inline wrappers + +inline bool SetupEvent::add(SetupEventHandler* handler) +{ + bool res = add_raw(handler); + return res; +} + +inline bool SetupEvent::remove(SetupEventHandler* handler) +{ + bool res = remove_raw(handler); + return res; +} + +/// A SetupChangeEvent represents a setup related change event. It is used for SetupChanged notifications. +class SetupChangeEvent : public core::Event { +public: + + /// Add a handler to be notified when the file event occurs. + /// handler : The handler object to be called when this event is fired. + /// Returns true if the addition of the handler was successful. + bool add(SetupChangeEventHandler* handler); + + /// Removes a handler from the event. + /// handler : The handler object to be removed from the event. + /// Returns true if removal of the handler was successful. + bool remove(SetupChangeEventHandler* handler); + + SETUPEVENTS_API static const char* classType(); + SETUPEVENTS_API const char* objectType() const override; + SETUPEVENTS_API void* queryInterface(const char* id) const override; + SETUPEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool add_raw(SetupChangeEventHandler* handler) = 0; + virtual bool remove_raw(SetupChangeEventHandler* handler) = 0; +}; + +// Inline wrappers + +inline bool SetupChangeEvent::add(SetupChangeEventHandler* handler) +{ + bool res = add_raw(handler); + return res; +} + +inline bool SetupChangeEvent::remove(SetupChangeEventHandler* handler) +{ + bool res = remove_raw(handler); + return res; +} + +/// The SetupEventHandler is a client implemented class that can be added as a handler to a +/// SetupEvent. +class SetupEventHandler : public core::EventHandler { +public: + + /// The function called by CAM when the associated event is fired. + /// eventArgs : Returns an object that provides access to additional information associated with the event. + SETUPEVENTS_API virtual void notify(const core::Ptr& eventArgs) = 0; +}; + +/// The SetupChangeEventHandler is a client implemented class that can be added as a handler to a +/// SetupChangeEvent. +class SetupChangeEventHandler : public core::EventHandler { +public: + + /// The function called by CAM when the associated event is fired. + /// eventArgs : Returns an object that provides access to additional information associated with the event. + SETUPEVENTS_API virtual void notify(const core::Ptr& eventArgs) = 0; +}; + +/// The SetupEventArgs provides information associated with a setup event. +class SetupEventArgs : public core::EventArgs { +public: + + /// Provides access to the setup. Can be null in the case + /// where the event is fired before the setup has been created or after it has been deleted. + core::Ptr setup() const; + + SETUPEVENTS_API static const char* classType(); + SETUPEVENTS_API const char* objectType() const override; + SETUPEVENTS_API void* queryInterface(const char* id) const override; + SETUPEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Setup* setup_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SetupEventArgs::setup() const +{ + core::Ptr res = setup_raw(); + return res; +} + +/// The SetupChangeEventArgs provides information associated with a change event of a setup. +class SetupChangeEventArgs : public core::EventArgs { +public: + + /// Provides access to the setup. Can be null in the case + /// where the event is fired before the setup has been created or after it has been deleted. + core::Ptr setup() const; + + /// Provides access to an information string. + /// The optional string may contain additional information about the change. + std::string info() const; + + /// The type specifies the actual change. + SetupChangeEventType type() const; + + SETUPEVENTS_API static const char* classType(); + SETUPEVENTS_API const char* objectType() const override; + SETUPEVENTS_API void* queryInterface(const char* id) const override; + SETUPEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Setup* setup_raw() const = 0; + virtual char* info_raw() const = 0; + virtual SetupChangeEventType type_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SetupChangeEventArgs::setup() const +{ + core::Ptr res = setup_raw(); + return res; +} + +inline std::string SetupChangeEventArgs::info() const +{ + std::string res; + + char* p= info_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline SetupChangeEventType SetupChangeEventArgs::type() const +{ + SetupChangeEventType res = type_raw(); + return res; +} +}// namespace cam +}// namespace adsk + +#undef SETUPEVENTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAM/Setups.h b/usr/autodesk/CPP/include/CAM/CAM/Setups.h new file mode 100644 index 0000000..b721d26 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAM/Setups.h @@ -0,0 +1,112 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_SETUPS_CPP__ +# define ADSK_CAM_SETUPS_API XI_EXPORT +# else +# define ADSK_CAM_SETUPS_API +# endif +#else +# define ADSK_CAM_SETUPS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class Setup; +}} + +namespace adsk { namespace cam { + +/// Collection that provides access to all of the existing setups in a document. +class Setups : public core::Base { +public: + + /// Function that returns the specified setup using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the setup with the specified name. + /// name : The name (as it appears in the browser) of the operation. + /// Returns the specified setup or null in the case where there is no setup with the specified name. + core::Ptr itemByName(const std::string& name) const; + + /// The number of setups in the collection. + size_t count() const; + + /// Returns the setup with the specified operation id. + /// id : The id of the operation. + /// Returns the specified setup or null in the case where there is no setup with the specified operation id. + core::Ptr itemByOperationId(int id) const; + + typedef Setup iterable_type; + template void copyTo(OutputIterator result); + + ADSK_CAM_SETUPS_API static const char* classType(); + ADSK_CAM_SETUPS_API const char* objectType() const override; + ADSK_CAM_SETUPS_API void* queryInterface(const char* id) const override; + ADSK_CAM_SETUPS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Setup* item_raw(size_t index) const = 0; + virtual Setup* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual Setup* itemByOperationId_raw(int id) const = 0; +}; + +// Inline wrappers + +inline core::Ptr Setups::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr Setups::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t Setups::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr Setups::itemByOperationId(int id) const +{ + core::Ptr res = itemByOperationId_raw(id); + return res; +} + +template inline void Setups::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_SETUPS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/CAMAll.h b/usr/autodesk/CPP/include/CAM/CAMAll.h new file mode 100644 index 0000000..ce729bc --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAMAll.h @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/usr/autodesk/CPP/include/CAM/CAMTypeDefs.h b/usr/autodesk/CPP/include/CAM/CAMTypeDefs.h new file mode 100644 index 0000000..def8f18 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/CAMTypeDefs.h @@ -0,0 +1,138 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once + +namespace adsk { namespace cam { + +/// List of the formats to choose from when generating setup sheets +enum SetupSheetFormats +{ + HTMLFormat, + ExcelFormat +}; + +/// The valid options for the Operation Type of a Setup. +enum OperationTypes +{ + MillingOperation, + TurningOperation, + JetOperation, + AdditiveOperation +}; + +/// List of locations representing folders in the library dialogs. +enum LibraryLocation +{ + Local, + Cloud, + Network, + OnlineSamples, + External +}; + +/// List of the valid options for the outputUnit property on a PostProcessInput object . +enum PostOutputUnitOptions +{ + DocumentUnitsOutput, + InchesOutput, + MillimetersOutput +}; + +/// List of setup change event types. +enum SetupChangeEventType +{ + Arbitrary, + PrintSettingSelection +}; + +/// List of the machine templates to create a machine from. +enum MachineTemplate +{ + GenericLathe, + Generic3Axis, + Generic4Axis, + Generic5AxisHeadHead, + Generic5AxisHeadTable, + Generic5AxisTableTable +}; + +/// List of part types for MachinePart +enum MachinePartTypes +{ + BasicMachinePartType, + AxisMachinePartType, + ToolAttachmentMachinePartType, + FixtureAttachmentMachinePartType +}; + +/// List of machine axis types for MachineAxis +enum MachineAxisTypes +{ + LinearMachineAxisType, + RotaryMachineAxisType +}; + +/// The valid options for the Strategy Type of an operation. +enum OperationStrategyTypes +{ + AdaptiveClearing2D, + Pocket2D, + Face, + Contour2D, + Slot, + Trace, + Thread, + Bore, + Circular, + Engrave, + AdaptiveClearing, + PocketClearing, + Parallel, + Contour, + Ramp, + Horizontal, + Pencil, + Scallop, + Spiral, + Radial, + MorphedSpiral, + Projection, + Drilling, + Jet2D, + TurningChamfer, + TurningFace, + TurningGroove, + TurningPart, + TurningProfile, + TurningProfileGroove, + TurningStockTransfer, + TurningThread, + SteepAndShallow, + Flow, + RotaryFinishing, + Chamfer2D, + Morph, + MultiAxisContour, + MultiAxisMorph, + RestFinishing, + Swarf +}; + +/// The possible states of an operation +enum OperationStates +{ + IsValidOperationState, + IsInvalidOperationState, + SuppressedOperationState, + NoToolpathOperationState +}; +}// namespace cam +}// namespace adsk diff --git a/usr/autodesk/CPP/include/CAM/Global/CAMLibraryManager.h b/usr/autodesk/CPP/include/CAM/Global/CAMLibraryManager.h new file mode 100644 index 0000000..42801e1 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Global/CAMLibraryManager.h @@ -0,0 +1,141 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_CAMLIBRARYMANAGER_CPP__ +# define ADSK_CAM_CAMLIBRARYMANAGER_API XI_EXPORT +# else +# define ADSK_CAM_CAMLIBRARYMANAGER_API +# endif +#else +# define ADSK_CAM_CAMLIBRARYMANAGER_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// CAMLibraryManager provides access to properties related to various libraries in the +/// Fusion 360 Manufacture workspace, such as the post library and machine library. +class CAMLibraryManager : public core::Base { +public: + + /// Gets the absolute path to the folder containing Fusion 360 posts. Fusion 360 posts + /// appear in the post library under the Fusion 360 tab. + std::string fusion360PostFolder() const; + + /// Gets the absolute path to the folder containing local posts. Local posts appear + /// in post library under the local tab. + std::string localPostFolder() const; + + /// Gets the absolute path to the folder containing Fusion 360 machines. Fusion 360 + /// machines appear in the machine library under the Fusion 360 tab. + std::string fusion360MachineFolder() const; + + /// Gets the absolute path to the folder containing local machines. Local Machines appear + /// in machine library under the local tab. + std::string localMachineFolder() const; + + /// Gets the absolute path to the folder containing network machines. Network machines + /// appear in the machine library under the network tab. + std::string networkMachineFolder() const; + + ADSK_CAM_CAMLIBRARYMANAGER_API static const char* classType(); + ADSK_CAM_CAMLIBRARYMANAGER_API const char* objectType() const override; + ADSK_CAM_CAMLIBRARYMANAGER_API void* queryInterface(const char* id) const override; + ADSK_CAM_CAMLIBRARYMANAGER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* fusion360PostFolder_raw() const = 0; + virtual char* localPostFolder_raw() const = 0; + virtual char* fusion360MachineFolder_raw() const = 0; + virtual char* localMachineFolder_raw() const = 0; + virtual char* networkMachineFolder_raw() const = 0; +}; + +// Inline wrappers + +inline std::string CAMLibraryManager::fusion360PostFolder() const +{ + std::string res; + + char* p= fusion360PostFolder_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CAMLibraryManager::localPostFolder() const +{ + std::string res; + + char* p= localPostFolder_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CAMLibraryManager::fusion360MachineFolder() const +{ + std::string res; + + char* p= fusion360MachineFolder_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CAMLibraryManager::localMachineFolder() const +{ + std::string res; + + char* p= localMachineFolder_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CAMLibraryManager::networkMachineFolder() const +{ + std::string res; + + char* p= networkMachineFolder_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_CAMLIBRARYMANAGER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Global/CAMManager.h b/usr/autodesk/CPP/include/CAM/Global/CAMManager.h new file mode 100644 index 0000000..8a34093 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Global/CAMManager.h @@ -0,0 +1,109 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_CAMMANAGER_CPP__ +# define ADSK_CAM_CAMMANAGER_API XI_EXPORT +# else +# define ADSK_CAM_CAMMANAGER_API +# endif +#else +# define ADSK_CAM_CAMMANAGER_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class CAMLibraryManager; + class NetworkMachineIntegrationManager; +}} + +namespace adsk { namespace cam { + +/// This singleton object provides access to application-level events and properties +/// that relate to the CAM (Manufacture) workspace in Fusion 360. +class CAMManager : public core::Base { +public: + + /// Access to the root CAMManager object. + /// Return the root CAMManager object or null if it failed. + static core::Ptr get(); + + /// CAMLibraryManager provides access to properties related to various libraries in the + /// Fusion 360 Manufacture workspace, such as the post library and machine library. + /// Return a CAMLibraryManager object or null if it failed. + core::Ptr libraryManager() const; + + /// Gets the absolute path to the post engine (post.exe) installed with Fusion 360. + std::string postEnginePath() const; + + /// NetworkMachineIntegrationManager provides access to properties and events needed to + /// integrate addins into the 'Find network machines' dialog, which enables users to add + /// machine configurations representing machines on the network to their machine library. + /// Return a NetworkMachineIntegrationManager object or null if it failed. + core::Ptr networkMachineIntegrationManager() const; + + ADSK_CAM_CAMMANAGER_API static const char* classType(); + ADSK_CAM_CAMMANAGER_API const char* objectType() const override; + ADSK_CAM_CAMMANAGER_API void* queryInterface(const char* id) const override; + ADSK_CAM_CAMMANAGER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_CAM_CAMMANAGER_API static CAMManager* get_raw(); + virtual CAMLibraryManager* libraryManager_raw() const = 0; + virtual char* postEnginePath_raw() const = 0; + virtual NetworkMachineIntegrationManager* networkMachineIntegrationManager_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr CAMManager::get() +{ + core::Ptr res = get_raw(); + return res; +} + +inline core::Ptr CAMManager::libraryManager() const +{ + core::Ptr res = libraryManager_raw(); + return res; +} + +inline std::string CAMManager::postEnginePath() const +{ + std::string res; + + char* p= postEnginePath_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr CAMManager::networkMachineIntegrationManager() const +{ + core::Ptr res = networkMachineIntegrationManager_raw(); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_CAMMANAGER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Global/MachineDescription.h b/usr/autodesk/CPP/include/CAM/Global/MachineDescription.h new file mode 100644 index 0000000..0d8fb10 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Global/MachineDescription.h @@ -0,0 +1,225 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_MACHINEDESCRIPTION_CPP__ +# define ADSK_CAM_MACHINEDESCRIPTION_API XI_EXPORT +# else +# define ADSK_CAM_MACHINEDESCRIPTION_API +# endif +#else +# define ADSK_CAM_MACHINEDESCRIPTION_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// A description of a machine used to preview machines in the 'Find network machines' dialog +class MachineDescription : public core::Base { +public: + + /// Creates a new MachineDescription. + /// vendor : The machine vendor. + /// model : The machine model. + /// ipAddress : The machine's ipv4 ip address. + /// Returns the newly created MachineDescription object, and allocates a unique id for the + /// object, or null if the creation failed. + static core::Ptr create(const std::string& vendor, const std::string& model, const std::string& ipAddress); + + /// Gets this MachineDescription's unique id. This id can be used to match + /// MachineDescription objects provided during the SearchNetworkMachinesEvent with those + /// requested to create machine configurations for during the CreateMachineConfigurations + /// event. + size_t id() const; + + /// Gets and sets the vendor name of the machine. + std::string vendor() const; + bool vendor(const std::string& value); + + /// Gets and sets the model name of the machine. + std::string model() const; + bool model(const std::string& value); + + /// Gets and sets the ip address of the machine. + std::string ipAddress() const; + bool ipAddress(const std::string& value); + + /// Gets and sets the controller name of the machine. Controller info is not displayed if + /// not set. + std::string control() const; + bool control(const std::string& value); + + /// Gets and sets the absolute path to the 128x128 png image of the machine. A default + /// image is used if not set. + std::string iconPath() const; + bool iconPath(const std::string& value); + + /// Gets and sets the serial number of the machine. A serial number is not displayed if not + /// set. + std::string serial() const; + bool serial(const std::string& value); + + ADSK_CAM_MACHINEDESCRIPTION_API static const char* classType(); + ADSK_CAM_MACHINEDESCRIPTION_API const char* objectType() const override; + ADSK_CAM_MACHINEDESCRIPTION_API void* queryInterface(const char* id) const override; + ADSK_CAM_MACHINEDESCRIPTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_CAM_MACHINEDESCRIPTION_API static MachineDescription* create_raw(const char * vendor, const char * model, const char * ipAddress); + virtual size_t id_raw() const = 0; + virtual char* vendor_raw() const = 0; + virtual bool vendor_raw(const char * value) = 0; + virtual char* model_raw() const = 0; + virtual bool model_raw(const char * value) = 0; + virtual char* ipAddress_raw() const = 0; + virtual bool ipAddress_raw(const char * value) = 0; + virtual char* control_raw() const = 0; + virtual bool control_raw(const char * value) = 0; + virtual char* iconPath_raw() const = 0; + virtual bool iconPath_raw(const char * value) = 0; + virtual char* serial_raw() const = 0; + virtual bool serial_raw(const char * value) = 0; +}; + +// Inline wrappers + +inline core::Ptr MachineDescription::create(const std::string& vendor, const std::string& model, const std::string& ipAddress) +{ + core::Ptr res = create_raw(vendor.c_str(), model.c_str(), ipAddress.c_str()); + return res; +} + +inline size_t MachineDescription::id() const +{ + size_t res = id_raw(); + return res; +} + +inline std::string MachineDescription::vendor() const +{ + std::string res; + + char* p= vendor_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool MachineDescription::vendor(const std::string& value) +{ + return vendor_raw(value.c_str()); +} + +inline std::string MachineDescription::model() const +{ + std::string res; + + char* p= model_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool MachineDescription::model(const std::string& value) +{ + return model_raw(value.c_str()); +} + +inline std::string MachineDescription::ipAddress() const +{ + std::string res; + + char* p= ipAddress_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool MachineDescription::ipAddress(const std::string& value) +{ + return ipAddress_raw(value.c_str()); +} + +inline std::string MachineDescription::control() const +{ + std::string res; + + char* p= control_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool MachineDescription::control(const std::string& value) +{ + return control_raw(value.c_str()); +} + +inline std::string MachineDescription::iconPath() const +{ + std::string res; + + char* p= iconPath_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool MachineDescription::iconPath(const std::string& value) +{ + return iconPath_raw(value.c_str()); +} + +inline std::string MachineDescription::serial() const +{ + std::string res; + + char* p= serial_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool MachineDescription::serial(const std::string& value) +{ + return serial_raw(value.c_str()); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_MACHINEDESCRIPTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Global/NetworkMachineEvents.h b/usr/autodesk/CPP/include/CAM/Global/NetworkMachineEvents.h new file mode 100644 index 0000000..873a03c --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Global/NetworkMachineEvents.h @@ -0,0 +1,278 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Application/Events.h" +#include "../../Core/Application/EventHandler.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_NETWORKMACHINEEVENTS_CPP__ +# define NETWORKMACHINEEVENTS_API XI_EXPORT +# else +# define NETWORKMACHINEEVENTS_API +# endif +#else +# define NETWORKMACHINEEVENTS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class CreateMachineConfigurationsEvent; + class CreateMachineConfigurationsEventArgs; + class CreateMachineConfigurationsEventHandler; + class Machine; + class MachineDescription; + class SearchNetworkMachinesEventArgs; + class SearchNetworkMachinesEventHandler; +}} + +namespace adsk { namespace cam { + +/// This event is fired from the 'Find network machines' dialog when the corresponding +/// addin is selected from the vendor dropdown, or when 'search all vendors' is +/// selected. This event will allow the addin to initiate an enumeration of machines on +/// the network. MachineDescription objects should be created for each machine found, and +/// an list of those MachineDescription objects should be set on the 'machineDescriptions' +/// property of the SearchNetworkMachinesEventArgs. Nothing should be set to signify no +/// machines found. See SearchNetworkMachinesEventArgs and MachineDescription for details. +/// Note that this event is raised on a background thread. +class SearchNetworkMachinesEvent : public core::Event { +public: + + /// Add a handler to be notified when the SearchNetworkMachinesEvent occurs. + /// handler : The handler object to be called when this event is fired. + /// Returns true if the addition of the handler was successful. + bool add(SearchNetworkMachinesEventHandler* handler); + + /// Removes a handler from the SearchNetworkMachinesEvent. + /// handler : The handler object to be removed from the event. + /// Returns true if removal of the handler was successful. + bool remove(SearchNetworkMachinesEventHandler* handler); + + NETWORKMACHINEEVENTS_API static const char* classType(); + NETWORKMACHINEEVENTS_API const char* objectType() const override; + NETWORKMACHINEEVENTS_API void* queryInterface(const char* id) const override; + NETWORKMACHINEEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool add_raw(SearchNetworkMachinesEventHandler* handler) = 0; + virtual bool remove_raw(SearchNetworkMachinesEventHandler* handler) = 0; +}; + +// Inline wrappers + +inline bool SearchNetworkMachinesEvent::add(SearchNetworkMachinesEventHandler* handler) +{ + bool res = add_raw(handler); + return res; +} + +inline bool SearchNetworkMachinesEvent::remove(SearchNetworkMachinesEventHandler* handler) +{ + bool res = remove_raw(handler); + return res; +} + +/// This event is fired from the 'Find network machines' dialog when MachineDescription(s) +/// previously provided during the handling of the SearchNetworkMachines event are selected +/// to add to the user's Machine Library. This event will allow the addins to create +/// machine configurations corresponding to the selected MachineDescription objects. +/// Handlers of this event should create machine configurations corresponding to each +/// MachineDescription present in the 'machineDescriptions' property in the +/// CreateMachineConfigurationsEventArgs and set them on the 'machines' property of the +/// event args. See CreateMachineConfigurationsEventArgs for details. Note that this event is +/// raised on a background thread. +class CreateMachineConfigurationsEvent : public core::Event { +public: + + /// Add a handler to be notified when the CreateMachineConfigurationsEvent occurs. + /// handler : The handler object to be called when this event is fired. + /// Returns true if the addition of the handler was successful. + bool add(CreateMachineConfigurationsEventHandler* handler); + + /// Removes a handler from the CreateMachineConfigurationsEvent. + /// handler : The handler object to be removed from the event. + /// Returns true if removal of the handler was successful. + bool remove(CreateMachineConfigurationsEventHandler* handler); + + NETWORKMACHINEEVENTS_API static const char* classType(); + NETWORKMACHINEEVENTS_API const char* objectType() const override; + NETWORKMACHINEEVENTS_API void* queryInterface(const char* id) const override; + NETWORKMACHINEEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool add_raw(CreateMachineConfigurationsEventHandler* handler) = 0; + virtual bool remove_raw(CreateMachineConfigurationsEventHandler* handler) = 0; +}; + +// Inline wrappers + +inline bool CreateMachineConfigurationsEvent::add(CreateMachineConfigurationsEventHandler* handler) +{ + bool res = add_raw(handler); + return res; +} + +inline bool CreateMachineConfigurationsEvent::remove(CreateMachineConfigurationsEventHandler* handler) +{ + bool res = remove_raw(handler); + return res; +} + +/// Event handler for the SearchNetworkMachinesEvent event. +class SearchNetworkMachinesEventHandler : public core::EventHandler { +public: + + /// The function called by Fusion 360 when the associated event is fired. + /// eventArgs : An object that provides access to additional information associated with the event. + NETWORKMACHINEEVENTS_API virtual void notify(const core::Ptr& eventArgs) = 0; +}; + +/// This EventArgs object will be sent with the SearchNetworkMachinesEvent. +class SearchNetworkMachinesEventArgs : public core::EventArgs { +public: + + /// Gets and sets a list of MachineDescription objects representing machines found on the + /// network. Do not set anything to signify no machine found. + std::vector> machineDescriptions() const; + bool machineDescriptions(const std::vector>& value); + + NETWORKMACHINEEVENTS_API static const char* classType(); + NETWORKMACHINEEVENTS_API const char* objectType() const override; + NETWORKMACHINEEVENTS_API void* queryInterface(const char* id) const override; + NETWORKMACHINEEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual MachineDescription** machineDescriptions_raw(size_t& return_size) const = 0; + virtual bool machineDescriptions_raw(MachineDescription** value, size_t value_size) = 0; +}; + +// Inline wrappers + +inline std::vector> SearchNetworkMachinesEventArgs::machineDescriptions() const +{ + std::vector> res; + size_t s; + + MachineDescription** p= machineDescriptions_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool SearchNetworkMachinesEventArgs::machineDescriptions(const std::vector>& value) +{ + MachineDescription** value_ = new MachineDescription*[value.size()]; + for(size_t i=0; i& eventArgs) = 0; +}; + +/// This EventArgs object will be sent with the CreateMachineConfigurationsEvent. +class CreateMachineConfigurationsEventArgs : public core::EventArgs { +public: + + /// Gets the collection of MachineDescription objects for which machine configurations + /// must be created. These MachineDescription(s) will be a subset of those previously + /// provided by the addin's SearchNetworkMachinesEventHandler. + /// Returns a list of MachineDescription objects which is a subset of the list that was + /// previously set by this addin on the 'machineDescriptions' property of the + /// SearchNetworkMachinesEventArgs. + std::vector> machineDescriptions() const; + + /// Gets and sets the list of Machine objects. Machines should be created corresponding to + /// each of the MachineDescription objects provided in the machineDescriptions property. + /// Machines can be created using adsk.cam.Machine.createFromTemplate or + /// adsk.cam.Machine.createFromFile. + std::vector> machines() const; + bool machines(const std::vector>& value); + + NETWORKMACHINEEVENTS_API static const char* classType(); + NETWORKMACHINEEVENTS_API const char* objectType() const override; + NETWORKMACHINEEVENTS_API void* queryInterface(const char* id) const override; + NETWORKMACHINEEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual MachineDescription** machineDescriptions_raw(size_t& return_size) const = 0; + virtual Machine** machines_raw(size_t& return_size) const = 0; + virtual bool machines_raw(Machine** value, size_t value_size) = 0; +}; + +// Inline wrappers + +inline std::vector> CreateMachineConfigurationsEventArgs::machineDescriptions() const +{ + std::vector> res; + size_t s; + + MachineDescription** p= machineDescriptions_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> CreateMachineConfigurationsEventArgs::machines() const +{ + std::vector> res; + size_t s; + + Machine** p= machines_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CreateMachineConfigurationsEventArgs::machines(const std::vector>& value) +{ + Machine** value_ = new Machine*[value.size()]; + for(size_t i=0; i + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_NETWORKMACHINEINTEGRATIONINPUT_CPP__ +# define ADSK_CAM_NETWORKMACHINEINTEGRATIONINPUT_API XI_EXPORT +# else +# define ADSK_CAM_NETWORKMACHINEINTEGRATIONINPUT_API +# endif +#else +# define ADSK_CAM_NETWORKMACHINEINTEGRATIONINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// An input object required to register an addin for use in the 'Find network machines' +/// dialog. This input object defines properties of an addin and allows an addin to +/// customize its appearence in the 'Find network machines' dialog. +class NetworkMachineIntegrationInput : public core::Base { +public: + + /// displayName : The name that will be presented to the user in the 'Find network machines' dialog. + /// description : A description of the addin which appears as a tooltip alongside the display name. + /// Returns true if the addin was successfully registered. + static core::Ptr create(const std::string& displayName, const std::string& description); + + /// Gets and sets the display name of the addin that appears in the 'vendor' dropdown in + /// the 'Find network machines' dialog. + std::string displayName() const; + bool displayName(const std::string& value); + + /// Gets and sets the description of the addin + std::string description() const; + bool description(const std::string& value); + + ADSK_CAM_NETWORKMACHINEINTEGRATIONINPUT_API static const char* classType(); + ADSK_CAM_NETWORKMACHINEINTEGRATIONINPUT_API const char* objectType() const override; + ADSK_CAM_NETWORKMACHINEINTEGRATIONINPUT_API void* queryInterface(const char* id) const override; + ADSK_CAM_NETWORKMACHINEINTEGRATIONINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_CAM_NETWORKMACHINEINTEGRATIONINPUT_API static NetworkMachineIntegrationInput* create_raw(const char * displayName, const char * description); + virtual char* displayName_raw() const = 0; + virtual bool displayName_raw(const char * value) = 0; + virtual char* description_raw() const = 0; + virtual bool description_raw(const char * value) = 0; +}; + +// Inline wrappers + +inline core::Ptr NetworkMachineIntegrationInput::create(const std::string& displayName, const std::string& description) +{ + core::Ptr res = create_raw(displayName.c_str(), description.c_str()); + return res; +} + +inline std::string NetworkMachineIntegrationInput::displayName() const +{ + std::string res; + + char* p= displayName_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool NetworkMachineIntegrationInput::displayName(const std::string& value) +{ + return displayName_raw(value.c_str()); +} + +inline std::string NetworkMachineIntegrationInput::description() const +{ + std::string res; + + char* p= description_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool NetworkMachineIntegrationInput::description(const std::string& value) +{ + return description_raw(value.c_str()); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_NETWORKMACHINEINTEGRATIONINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Global/NetworkMachineIntegrationManager.h b/usr/autodesk/CPP/include/CAM/Global/NetworkMachineIntegrationManager.h new file mode 100644 index 0000000..cda6a0e --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Global/NetworkMachineIntegrationManager.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_NETWORKMACHINEINTEGRATIONMANAGER_CPP__ +# define ADSK_CAM_NETWORKMACHINEINTEGRATIONMANAGER_API XI_EXPORT +# else +# define ADSK_CAM_NETWORKMACHINEINTEGRATIONMANAGER_API +# endif +#else +# define ADSK_CAM_NETWORKMACHINEINTEGRATIONMANAGER_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class CreateMachineConfigurationsEvent; + class NetworkMachineIntegrationInput; + class SearchNetworkMachinesEvent; +}} + +namespace adsk { namespace cam { + +/// NetworkMachineManager provides access to properties and events needed to integrate +/// addins into the 'Find network machines' dialog, which enables users to add machine +/// configurations representing machines on the network to their machine library. +class NetworkMachineIntegrationManager : public core::Base { +public: + + /// Registers an addin for use in the 'Find network machines' dialog. This dialog will fire + /// the SearchNetworkMachinesEvent and CreateMachineConfigurationsEvent, which the addin + /// must handle. See SearchNetworkMachinesEvent and CreateMachineConfigurationsEvent for + /// details. + /// networkMachineIntegrationInput : An object defining properties of an addin, also allowing an addin to customize its + /// appearence in the 'Find network machines' dialog. + bool registerNetworkMachineIntegration(const core::Ptr& networkMachineIntegrationInput); + + /// This event is fired from the 'Find network machines' dialog when the corresponding + /// addin is selected from the vendor dropdown, or when 'search all vendors' is + /// selected. This event will allow the addin to initiate an enumeration of machines on + /// the network, and populate the 'Find network machines' dialog with descriptions of each + /// machine found. See SearchNetworkMachinesEvent for details. + core::Ptr searchNetworkMachinesEvent() const; + + /// This event is fired from the 'Find network machines' dialog when MachineDescription(s) + /// previously provided during the handling of the SearchNetworkMachines event are selected + /// to add to the user's Machine Library. This event will allow the addins to create + /// machine configurations corresponding to the selected MachineDescription objects. + /// See CreateMachineConfigurationsEvent for details. + core::Ptr createMachineConfigurationsEvent() const; + + ADSK_CAM_NETWORKMACHINEINTEGRATIONMANAGER_API static const char* classType(); + ADSK_CAM_NETWORKMACHINEINTEGRATIONMANAGER_API const char* objectType() const override; + ADSK_CAM_NETWORKMACHINEINTEGRATIONMANAGER_API void* queryInterface(const char* id) const override; + ADSK_CAM_NETWORKMACHINEINTEGRATIONMANAGER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool registerNetworkMachineIntegration_raw(NetworkMachineIntegrationInput* networkMachineIntegrationInput) = 0; + virtual SearchNetworkMachinesEvent* searchNetworkMachinesEvent_raw() const = 0; + virtual CreateMachineConfigurationsEvent* createMachineConfigurationsEvent_raw() const = 0; +}; + +// Inline wrappers + +inline bool NetworkMachineIntegrationManager::registerNetworkMachineIntegration(const core::Ptr& networkMachineIntegrationInput) +{ + bool res = registerNetworkMachineIntegration_raw(networkMachineIntegrationInput.get()); + return res; +} + +inline core::Ptr NetworkMachineIntegrationManager::searchNetworkMachinesEvent() const +{ + core::Ptr res = searchNetworkMachinesEvent_raw(); + return res; +} + +inline core::Ptr NetworkMachineIntegrationManager::createMachineConfigurationsEvent() const +{ + core::Ptr res = createMachineConfigurationsEvent_raw(); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_NETWORKMACHINEINTEGRATIONMANAGER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/LinearMachineAxis.h b/usr/autodesk/CPP/include/CAM/Machine/LinearMachineAxis.h new file mode 100644 index 0000000..eb10a34 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/LinearMachineAxis.h @@ -0,0 +1,69 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "MachineAxis.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_LINEARMACHINEAXIS_CPP__ +# define ADSK_CAM_LINEARMACHINEAXIS_API XI_EXPORT +# else +# define ADSK_CAM_LINEARMACHINEAXIS_API +# endif +#else +# define ADSK_CAM_LINEARMACHINEAXIS_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Vector3D; +}} + +namespace adsk { namespace cam { + +/// Object that represents an axis with linear motion (e.g. X, Y, and Z). +class LinearMachineAxis : public MachineAxis { +public: + + /// The unit vector that represents the direction along which the axis will move. + core::Ptr direction() const; + bool direction(const core::Ptr& value); + + ADSK_CAM_LINEARMACHINEAXIS_API static const char* classType(); + ADSK_CAM_LINEARMACHINEAXIS_API const char* objectType() const override; + ADSK_CAM_LINEARMACHINEAXIS_API void* queryInterface(const char* id) const override; + ADSK_CAM_LINEARMACHINEAXIS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Vector3D* direction_raw() const = 0; + virtual bool direction_raw(core::Vector3D* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr LinearMachineAxis::direction() const +{ + core::Ptr res = direction_raw(); + return res; +} + +inline bool LinearMachineAxis::direction(const core::Ptr& value) +{ + return direction_raw(value.get()); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_LINEARMACHINEAXIS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/LinearMachineAxisInput.h b/usr/autodesk/CPP/include/CAM/Machine/LinearMachineAxisInput.h new file mode 100644 index 0000000..c4499b6 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/LinearMachineAxisInput.h @@ -0,0 +1,70 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "MachineAxisInput.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_LINEARMACHINEAXISINPUT_CPP__ +# define ADSK_CAM_LINEARMACHINEAXISINPUT_API XI_EXPORT +# else +# define ADSK_CAM_LINEARMACHINEAXISINPUT_API +# endif +#else +# define ADSK_CAM_LINEARMACHINEAXISINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Vector3D; +}} + +namespace adsk { namespace cam { + +/// Object that defines the properties required to create a new linear machine axis object. +class LinearMachineAxisInput : public MachineAxisInput { +public: + + /// The unit vector that represents the direction along which the linear axis will move. + /// This vector is in the machine's coordinate system (e.g. the X axis is always (1,0,0)). + core::Ptr direction() const; + bool direction(const core::Ptr& value); + + ADSK_CAM_LINEARMACHINEAXISINPUT_API static const char* classType(); + ADSK_CAM_LINEARMACHINEAXISINPUT_API const char* objectType() const override; + ADSK_CAM_LINEARMACHINEAXISINPUT_API void* queryInterface(const char* id) const override; + ADSK_CAM_LINEARMACHINEAXISINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Vector3D* direction_raw() const = 0; + virtual bool direction_raw(core::Vector3D* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr LinearMachineAxisInput::direction() const +{ + core::Ptr res = direction_raw(); + return res; +} + +inline bool LinearMachineAxisInput::direction(const core::Ptr& value) +{ + return direction_raw(value.get()); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_LINEARMACHINEAXISINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/Machine.h b/usr/autodesk/CPP/include/CAM/Machine/Machine.h new file mode 100644 index 0000000..eefeaed --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/Machine.h @@ -0,0 +1,209 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_MACHINE_CPP__ +# define ADSK_CAM_MACHINE_API XI_EXPORT +# else +# define ADSK_CAM_MACHINE_API +# endif +#else +# define ADSK_CAM_MACHINE_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class MachineCapabilities; + class MachineKinematics; +}} + +namespace adsk { namespace cam { + +/// Object that represents a machine. +class Machine : public core::Base { +public: + + /// Gets and sets the vendor name of the machine. + std::string vendor() const; + bool vendor(const std::string& value); + + /// Gets and sets the model name of the machine. + std::string model() const; + bool model(const std::string& value); + + /// Gets and sets the description of the machine. + std::string description() const; + bool description(const std::string& value); + + /// Gets the unique identifier of the machine. + /// Can be used for comparing machines within the document. + std::string id() const; + + /// Gets the capabilities of the machine. + core::Ptr capabilities() const; + + /// Gets the kinematics tree of the machine. + core::Ptr kinematics() const; + + /// Creates a Machine from a template. + /// machineTemplate : The template to act as a base for creating a machine from. + /// Returns the newly created machine with a valid kinematics tree. + static core::Ptr createFromTemplate(MachineTemplate machineTemplate); + + /// Creates a Machine from a file. + /// location : The location in the machine library. + /// filePath : The path to a file to act as a base for creating a machine from. + /// The path is relative to the library location given, unless library location is External, + /// then the filePath is expected to be an absolute path. + /// Returns the newly created machine with a valid kinematics tree. + static core::Ptr createFromFile(LibraryLocation location, const std::string& filePath); + + /// Save the Machine to a file. + /// Any subsequent edits will need to be saved again. + /// location : The location in the machine library to save the machine to. + /// filePath : The path of the file to save the machine as. + /// The path is relative to the library location given, unless library location is External, + /// then the filePath is expected to be an absolute path. + /// .machine will be appended if no extension is given. + /// Returns true if the machine was saved successfully, false otherwise. + bool save(LibraryLocation location, const std::string& filePath) const; + + ADSK_CAM_MACHINE_API static const char* classType(); + ADSK_CAM_MACHINE_API const char* objectType() const override; + ADSK_CAM_MACHINE_API void* queryInterface(const char* id) const override; + ADSK_CAM_MACHINE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* vendor_raw() const = 0; + virtual bool vendor_raw(const char * value) = 0; + virtual char* model_raw() const = 0; + virtual bool model_raw(const char * value) = 0; + virtual char* description_raw() const = 0; + virtual bool description_raw(const char * value) = 0; + virtual char* id_raw() const = 0; + virtual MachineCapabilities* capabilities_raw() const = 0; + virtual MachineKinematics* kinematics_raw() const = 0; + ADSK_CAM_MACHINE_API static Machine* createFromTemplate_raw(MachineTemplate machineTemplate); + ADSK_CAM_MACHINE_API static Machine* createFromFile_raw(LibraryLocation location, const char * filePath); + virtual bool save_raw(LibraryLocation location, const char * filePath) const = 0; +}; + +// Inline wrappers + +inline std::string Machine::vendor() const +{ + std::string res; + + char* p= vendor_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Machine::vendor(const std::string& value) +{ + return vendor_raw(value.c_str()); +} + +inline std::string Machine::model() const +{ + std::string res; + + char* p= model_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Machine::model(const std::string& value) +{ + return model_raw(value.c_str()); +} + +inline std::string Machine::description() const +{ + std::string res; + + char* p= description_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Machine::description(const std::string& value) +{ + return description_raw(value.c_str()); +} + +inline std::string Machine::id() const +{ + std::string res; + + char* p= id_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr Machine::capabilities() const +{ + core::Ptr res = capabilities_raw(); + return res; +} + +inline core::Ptr Machine::kinematics() const +{ + core::Ptr res = kinematics_raw(); + return res; +} + +inline core::Ptr Machine::createFromTemplate(MachineTemplate machineTemplate) +{ + core::Ptr res = createFromTemplate_raw(machineTemplate); + return res; +} + +inline core::Ptr Machine::createFromFile(LibraryLocation location, const std::string& filePath) +{ + core::Ptr res = createFromFile_raw(location, filePath.c_str()); + return res; +} + +inline bool Machine::save(LibraryLocation location, const std::string& filePath) const +{ + bool res = save_raw(location, filePath.c_str()); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_MACHINE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/MachineAxis.h b/usr/autodesk/CPP/include/CAM/Machine/MachineAxis.h new file mode 100644 index 0000000..d76c23e --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/MachineAxis.h @@ -0,0 +1,173 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_MACHINEAXIS_CPP__ +# define ADSK_CAM_MACHINEAXIS_API XI_EXPORT +# else +# define ADSK_CAM_MACHINEAXIS_API +# endif +#else +# define ADSK_CAM_MACHINEAXIS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// Abstract base class representing a single machine axis. +class MachineAxis : public core::Base { +public: + + /// The name of this axis. + std::string name() const; + bool name(const std::string& value); + + /// The type of axis. + MachineAxisTypes axisType() const; + + /// Does this axis have a limited range of motion. + bool hasLimits() const; + + /// The minimum possible value for this axis (in mm/deg). + /// Must be less than physicalMax. + /// Set the value of this and physicalMax to 0 to remove + /// axis limits. + double physicalMin() const; + bool physicalMin(double value); + + /// The maximum possible value for this axis (in mm/deg). + /// Must be less than physicalMin. + /// Set the value of this and physicalMin to 0 to remove + /// axis limits. + double physicalMax() const; + bool physicalMax(double value); + + /// Specifies the value (in mm/deg) that this axis returns to when the machine is homed. + double homePosition() const; + bool homePosition(double value); + + ADSK_CAM_MACHINEAXIS_API static const char* classType(); + ADSK_CAM_MACHINEAXIS_API const char* objectType() const override; + ADSK_CAM_MACHINEAXIS_API void* queryInterface(const char* id) const override; + ADSK_CAM_MACHINEAXIS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual MachineAxisTypes axisType_raw() const = 0; + virtual bool hasLimits_raw() const = 0; + virtual double physicalMin_raw() const = 0; + virtual bool physicalMin_raw(double value) = 0; + virtual double physicalMax_raw() const = 0; + virtual bool physicalMax_raw(double value) = 0; + virtual double homePosition_raw() const = 0; + virtual bool homePosition_raw(double value) = 0; + virtual void placeholderMachineAxis0() {} + virtual void placeholderMachineAxis1() {} + virtual void placeholderMachineAxis2() {} + virtual void placeholderMachineAxis3() {} + virtual void placeholderMachineAxis4() {} + virtual void placeholderMachineAxis5() {} + virtual void placeholderMachineAxis6() {} + virtual void placeholderMachineAxis7() {} + virtual void placeholderMachineAxis8() {} + virtual void placeholderMachineAxis9() {} + virtual void placeholderMachineAxis10() {} + virtual void placeholderMachineAxis11() {} + virtual void placeholderMachineAxis12() {} + virtual void placeholderMachineAxis13() {} + virtual void placeholderMachineAxis14() {} + virtual void placeholderMachineAxis15() {} + virtual void placeholderMachineAxis16() {} + virtual void placeholderMachineAxis17() {} + virtual void placeholderMachineAxis18() {} + virtual void placeholderMachineAxis19() {} + virtual void placeholderMachineAxis20() {} + virtual void placeholderMachineAxis21() {} +}; + +// Inline wrappers + +inline std::string MachineAxis::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool MachineAxis::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline MachineAxisTypes MachineAxis::axisType() const +{ + MachineAxisTypes res = axisType_raw(); + return res; +} + +inline bool MachineAxis::hasLimits() const +{ + bool res = hasLimits_raw(); + return res; +} + +inline double MachineAxis::physicalMin() const +{ + double res = physicalMin_raw(); + return res; +} + +inline bool MachineAxis::physicalMin(double value) +{ + return physicalMin_raw(value); +} + +inline double MachineAxis::physicalMax() const +{ + double res = physicalMax_raw(); + return res; +} + +inline bool MachineAxis::physicalMax(double value) +{ + return physicalMax_raw(value); +} + +inline double MachineAxis::homePosition() const +{ + double res = homePosition_raw(); + return res; +} + +inline bool MachineAxis::homePosition(double value) +{ + return homePosition_raw(value); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_MACHINEAXIS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/MachineAxisInput.h b/usr/autodesk/CPP/include/CAM/Machine/MachineAxisInput.h new file mode 100644 index 0000000..a82acbd --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/MachineAxisInput.h @@ -0,0 +1,164 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_MACHINEAXISINPUT_CPP__ +# define ADSK_CAM_MACHINEAXISINPUT_API XI_EXPORT +# else +# define ADSK_CAM_MACHINEAXISINPUT_API +# endif +#else +# define ADSK_CAM_MACHINEAXISINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// Object that defines the properties required to create a machine axis object. +class MachineAxisInput : public core::Base { +public: + + /// The type of axis. + /// This axis type determines which parameters of this object are valid to be accessed + /// or modified. + MachineAxisTypes axisType() const; + + /// The user facing name of this axis. + std::string name() const; + bool name(const std::string& value); + + /// Specifies the value (in mm/deg) that this axis returns to when the machine is homed. + double homePosition() const; + bool homePosition(double value); + + /// The minimum possible value for this axis (in mm/deg). + /// Set the value of this and physicalMax to 0 to create an + /// unlimited axis. + double physicalMin() const; + bool physicalMin(double value); + + /// The maximum possible value for this axis (in mm/deg). + /// Set the value of this and physicalMin to 0 to create an + /// unlimited axis. + double physicalMax() const; + bool physicalMax(double value); + + ADSK_CAM_MACHINEAXISINPUT_API static const char* classType(); + ADSK_CAM_MACHINEAXISINPUT_API const char* objectType() const override; + ADSK_CAM_MACHINEAXISINPUT_API void* queryInterface(const char* id) const override; + ADSK_CAM_MACHINEAXISINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual MachineAxisTypes axisType_raw() const = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual double homePosition_raw() const = 0; + virtual bool homePosition_raw(double value) = 0; + virtual double physicalMin_raw() const = 0; + virtual bool physicalMin_raw(double value) = 0; + virtual double physicalMax_raw() const = 0; + virtual bool physicalMax_raw(double value) = 0; + virtual void placeholderMachineAxisInput0() {} + virtual void placeholderMachineAxisInput1() {} + virtual void placeholderMachineAxisInput2() {} + virtual void placeholderMachineAxisInput3() {} + virtual void placeholderMachineAxisInput4() {} + virtual void placeholderMachineAxisInput5() {} + virtual void placeholderMachineAxisInput6() {} + virtual void placeholderMachineAxisInput7() {} + virtual void placeholderMachineAxisInput8() {} + virtual void placeholderMachineAxisInput9() {} + virtual void placeholderMachineAxisInput10() {} + virtual void placeholderMachineAxisInput11() {} + virtual void placeholderMachineAxisInput12() {} + virtual void placeholderMachineAxisInput13() {} + virtual void placeholderMachineAxisInput14() {} + virtual void placeholderMachineAxisInput15() {} + virtual void placeholderMachineAxisInput16() {} + virtual void placeholderMachineAxisInput17() {} + virtual void placeholderMachineAxisInput18() {} + virtual void placeholderMachineAxisInput19() {} + virtual void placeholderMachineAxisInput20() {} + virtual void placeholderMachineAxisInput21() {} + virtual void placeholderMachineAxisInput22() {} +}; + +// Inline wrappers + +inline MachineAxisTypes MachineAxisInput::axisType() const +{ + MachineAxisTypes res = axisType_raw(); + return res; +} + +inline std::string MachineAxisInput::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool MachineAxisInput::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline double MachineAxisInput::homePosition() const +{ + double res = homePosition_raw(); + return res; +} + +inline bool MachineAxisInput::homePosition(double value) +{ + return homePosition_raw(value); +} + +inline double MachineAxisInput::physicalMin() const +{ + double res = physicalMin_raw(); + return res; +} + +inline bool MachineAxisInput::physicalMin(double value) +{ + return physicalMin_raw(value); +} + +inline double MachineAxisInput::physicalMax() const +{ + double res = physicalMax_raw(); + return res; +} + +inline bool MachineAxisInput::physicalMax(double value) +{ + return physicalMax_raw(value); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_MACHINEAXISINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/MachineCapabilities.h b/usr/autodesk/CPP/include/CAM/Machine/MachineCapabilities.h new file mode 100644 index 0000000..2e1ed3a --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/MachineCapabilities.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_MACHINECAPABILITIES_CPP__ +# define ADSK_CAM_MACHINECAPABILITIES_API XI_EXPORT +# else +# define ADSK_CAM_MACHINECAPABILITIES_API +# endif +#else +# define ADSK_CAM_MACHINECAPABILITIES_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// Object that represents the capabilities of the machine. +class MachineCapabilities : public core::Base { +public: + + /// Gets and sets if the machine is capable of subtractive milling. + bool isMillingSupported() const; + bool isMillingSupported(bool value); + + /// Gets and sets if the machine is capable of subtractive turning. + bool isTurningSupported() const; + bool isTurningSupported(bool value); + + /// Gets and sets if the machine is capable of subtractive cutting. + bool isCuttingSupported() const; + bool isCuttingSupported(bool value); + + ADSK_CAM_MACHINECAPABILITIES_API static const char* classType(); + ADSK_CAM_MACHINECAPABILITIES_API const char* objectType() const override; + ADSK_CAM_MACHINECAPABILITIES_API void* queryInterface(const char* id) const override; + ADSK_CAM_MACHINECAPABILITIES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isMillingSupported_raw() const = 0; + virtual bool isMillingSupported_raw(bool value) = 0; + virtual bool isTurningSupported_raw() const = 0; + virtual bool isTurningSupported_raw(bool value) = 0; + virtual bool isCuttingSupported_raw() const = 0; + virtual bool isCuttingSupported_raw(bool value) = 0; +}; + +// Inline wrappers + +inline bool MachineCapabilities::isMillingSupported() const +{ + bool res = isMillingSupported_raw(); + return res; +} + +inline bool MachineCapabilities::isMillingSupported(bool value) +{ + return isMillingSupported_raw(value); +} + +inline bool MachineCapabilities::isTurningSupported() const +{ + bool res = isTurningSupported_raw(); + return res; +} + +inline bool MachineCapabilities::isTurningSupported(bool value) +{ + return isTurningSupported_raw(value); +} + +inline bool MachineCapabilities::isCuttingSupported() const +{ + bool res = isCuttingSupported_raw(); + return res; +} + +inline bool MachineCapabilities::isCuttingSupported(bool value) +{ + return isCuttingSupported_raw(value); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_MACHINECAPABILITIES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/MachineKinematics.h b/usr/autodesk/CPP/include/CAM/Machine/MachineKinematics.h new file mode 100644 index 0000000..e76da40 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/MachineKinematics.h @@ -0,0 +1,63 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_MACHINEKINEMATICS_CPP__ +# define ADSK_CAM_MACHINEKINEMATICS_API XI_EXPORT +# else +# define ADSK_CAM_MACHINEKINEMATICS_API +# endif +#else +# define ADSK_CAM_MACHINEKINEMATICS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class MachineParts; +}} + +namespace adsk { namespace cam { + +/// Object that represents the kinematics tree in the machine. +class MachineKinematics : public core::Base { +public: + + /// Get the root parts collection. + core::Ptr parts() const; + + ADSK_CAM_MACHINEKINEMATICS_API static const char* classType(); + ADSK_CAM_MACHINEKINEMATICS_API const char* objectType() const override; + ADSK_CAM_MACHINEKINEMATICS_API void* queryInterface(const char* id) const override; + ADSK_CAM_MACHINEKINEMATICS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual MachineParts* parts_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr MachineKinematics::parts() const +{ + core::Ptr res = parts_raw(); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_MACHINEKINEMATICS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/MachinePart.h b/usr/autodesk/CPP/include/CAM/Machine/MachinePart.h new file mode 100644 index 0000000..78a6bed --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/MachinePart.h @@ -0,0 +1,135 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_MACHINEPART_CPP__ +# define ADSK_CAM_MACHINEPART_API XI_EXPORT +# else +# define ADSK_CAM_MACHINEPART_API +# endif +#else +# define ADSK_CAM_MACHINEPART_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class MachineAxis; + class MachineParts; +}} + +namespace adsk { namespace cam { + +/// Object representing some part of a machine, such as the static base of the machine, an +/// axis, or the attachment points for tools and fixtures. +class MachinePart : public core::Base { +public: + + /// Delete this part and its children from the kinematics tree. + void deleteMe(); + + /// Get the collection of child parts. + core::Ptr children() const; + + /// Get or set the parent of this part. + /// Setting the parent will add this part to the end of the parent's children + /// collection. Setting the parent will throw an error if the new parent is this + /// part or a child this part. + core::Ptr parent() const; + bool parent(const core::Ptr& value); + + /// Get the type of this part. + MachinePartTypes partType() const; + + /// Get the internal ID of the part. + /// This is unique with respect to other MachineParts in the Machine. + std::string id() const; + + /// Get the axis object for this part used to reference this part for other + /// operations. + /// Only valid when partType is Axis, otherwise returns null + core::Ptr axis() const; + + ADSK_CAM_MACHINEPART_API static const char* classType(); + ADSK_CAM_MACHINEPART_API const char* objectType() const override; + ADSK_CAM_MACHINEPART_API void* queryInterface(const char* id) const override; + ADSK_CAM_MACHINEPART_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual void deleteMe_raw() = 0; + virtual MachineParts* children_raw() const = 0; + virtual MachinePart* parent_raw() const = 0; + virtual bool parent_raw(MachinePart* value) = 0; + virtual MachinePartTypes partType_raw() const = 0; + virtual char* id_raw() const = 0; + virtual MachineAxis* axis_raw() const = 0; +}; + +// Inline wrappers + +inline void MachinePart::deleteMe() +{ + deleteMe_raw(); +} + +inline core::Ptr MachinePart::children() const +{ + core::Ptr res = children_raw(); + return res; +} + +inline core::Ptr MachinePart::parent() const +{ + core::Ptr res = parent_raw(); + return res; +} + +inline bool MachinePart::parent(const core::Ptr& value) +{ + return parent_raw(value.get()); +} + +inline MachinePartTypes MachinePart::partType() const +{ + MachinePartTypes res = partType_raw(); + return res; +} + +inline std::string MachinePart::id() const +{ + std::string res; + + char* p= id_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr MachinePart::axis() const +{ + core::Ptr res = axis_raw(); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_MACHINEPART_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/MachinePartInput.h b/usr/autodesk/CPP/include/CAM/Machine/MachinePartInput.h new file mode 100644 index 0000000..3008aa4 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/MachinePartInput.h @@ -0,0 +1,124 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_MACHINEPARTINPUT_CPP__ +# define ADSK_CAM_MACHINEPARTINPUT_API XI_EXPORT +# else +# define ADSK_CAM_MACHINEPARTINPUT_API +# endif +#else +# define ADSK_CAM_MACHINEPARTINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class MachineAxisInput; +}} + +namespace adsk { namespace cam { + +/// Object representing the set of inputs required to create a new MachinePart. +/// Set an MachineAxisInput object on this object's axisInput parameter to create +/// a new MachineAxis with this part. +class MachinePartInput : public core::Base { +public: + + /// Get or set the internal ID of the part, used to reference this part for other + /// operations. This ID can be any string. + /// This must be unique with respect to other MachineParts in the Machine. + std::string id() const; + bool id(const std::string& value); + + /// Get the type of part this input will create. + MachinePartTypes partType() const; + + /// Create a new MachineAxisInput object to be used to create a new MachineAxis. + /// Set this object on to an axis type MachinePartInput to create a new MachineAxis + /// with that part. + /// axisType : The type of MachineAxisInput to create. + /// Returns a LinearMachineAxisInput or RotaryMachineAxisInput, or null if the creation failed. + core::Ptr createAxisInput(MachineAxisTypes axisType); + + /// Get or Set an axis input object to create a new MachineAxis with this part. + /// Only valid when partType is Axis. + core::Ptr axisInput() const; + bool axisInput(const core::Ptr& value); + + ADSK_CAM_MACHINEPARTINPUT_API static const char* classType(); + ADSK_CAM_MACHINEPARTINPUT_API const char* objectType() const override; + ADSK_CAM_MACHINEPARTINPUT_API void* queryInterface(const char* id) const override; + ADSK_CAM_MACHINEPARTINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* id_raw() const = 0; + virtual bool id_raw(const char * value) = 0; + virtual MachinePartTypes partType_raw() const = 0; + virtual MachineAxisInput* createAxisInput_raw(MachineAxisTypes axisType) = 0; + virtual MachineAxisInput* axisInput_raw() const = 0; + virtual bool axisInput_raw(MachineAxisInput* value) = 0; +}; + +// Inline wrappers + +inline std::string MachinePartInput::id() const +{ + std::string res; + + char* p= id_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool MachinePartInput::id(const std::string& value) +{ + return id_raw(value.c_str()); +} + +inline MachinePartTypes MachinePartInput::partType() const +{ + MachinePartTypes res = partType_raw(); + return res; +} + +inline core::Ptr MachinePartInput::createAxisInput(MachineAxisTypes axisType) +{ + core::Ptr res = createAxisInput_raw(axisType); + return res; +} + +inline core::Ptr MachinePartInput::axisInput() const +{ + core::Ptr res = axisInput_raw(); + return res; +} + +inline bool MachinePartInput::axisInput(const core::Ptr& value) +{ + return axisInput_raw(value.get()); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_MACHINEPARTINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/MachineParts.h b/usr/autodesk/CPP/include/CAM/Machine/MachineParts.h new file mode 100644 index 0000000..31ed50b --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/MachineParts.h @@ -0,0 +1,130 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_MACHINEPARTS_CPP__ +# define ADSK_CAM_MACHINEPARTS_API XI_EXPORT +# else +# define ADSK_CAM_MACHINEPARTS_API +# endif +#else +# define ADSK_CAM_MACHINEPARTS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class MachinePart; + class MachinePartInput; +}} + +namespace adsk { namespace cam { + +/// Object that represents a collection of machine parts. +/// These parts are the children of another part or the collection of base parts from MachineKinematics +class MachineParts : public core::Base { +public: + + /// Add a new part to this collection. The part's parent will be set to the the owner of + /// this collection, or null if this is the root parts collection. + /// If the passed MachinePartInput has a MachineAxisInput a new MachineAxis will be created. + /// partInput : Part input object used to create the new MachinePart. + /// Returns the newly creted MachinePart or null if creation failed. + core::Ptr add(const core::Ptr& partInput); + + /// Create a new MachinePartInput. + /// partType : The type of part to create. + /// When this parameter is Axis, you must set a value for axisInput. + /// Returns the new MachinePartInput or null if creation failed. + core::Ptr createPartInput(MachinePartTypes partType); + + /// Get the part at index in this collection. + /// index : The index of the part. + /// The MachinePart at index. + core::Ptr item(int index) const; + + /// Get the part with the given ID. + /// id : The ID for the part to get. + /// Returns the MachinePart with the given ID, or null if the given ID does not + /// match any part in the collection. + core::Ptr itemById(const std::string& id) const; + + /// Get the number of parts in this collection. + size_t count() const; + + typedef MachinePart iterable_type; + template void copyTo(OutputIterator result); + + ADSK_CAM_MACHINEPARTS_API static const char* classType(); + ADSK_CAM_MACHINEPARTS_API const char* objectType() const override; + ADSK_CAM_MACHINEPARTS_API void* queryInterface(const char* id) const override; + ADSK_CAM_MACHINEPARTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual MachinePart* add_raw(MachinePartInput* partInput) = 0; + virtual MachinePartInput* createPartInput_raw(MachinePartTypes partType) = 0; + virtual MachinePart* item_raw(int index) const = 0; + virtual MachinePart* itemById_raw(const char * id) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr MachineParts::add(const core::Ptr& partInput) +{ + core::Ptr res = add_raw(partInput.get()); + return res; +} + +inline core::Ptr MachineParts::createPartInput(MachinePartTypes partType) +{ + core::Ptr res = createPartInput_raw(partType); + return res; +} + +inline core::Ptr MachineParts::item(int index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr MachineParts::itemById(const std::string& id) const +{ + core::Ptr res = itemById_raw(id.c_str()); + return res; +} + +inline size_t MachineParts::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void MachineParts::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_MACHINEPARTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/RotaryMachineAxis.h b/usr/autodesk/CPP/include/CAM/Machine/RotaryMachineAxis.h new file mode 100644 index 0000000..fa72aa3 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/RotaryMachineAxis.h @@ -0,0 +1,69 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "MachineAxis.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_ROTARYMACHINEAXIS_CPP__ +# define ADSK_CAM_ROTARYMACHINEAXIS_API XI_EXPORT +# else +# define ADSK_CAM_ROTARYMACHINEAXIS_API +# endif +#else +# define ADSK_CAM_ROTARYMACHINEAXIS_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class InfiniteLine3D; +}} + +namespace adsk { namespace cam { + +/// Object that represents an axis with rotary motion (e.g. A, B, and C). +class RotaryMachineAxis : public MachineAxis { +public: + + /// The infinite line that defines the direction and location of the axis of rotation. + core::Ptr rotationAxis() const; + bool rotationAxis(const core::Ptr& value); + + ADSK_CAM_ROTARYMACHINEAXIS_API static const char* classType(); + ADSK_CAM_ROTARYMACHINEAXIS_API const char* objectType() const override; + ADSK_CAM_ROTARYMACHINEAXIS_API void* queryInterface(const char* id) const override; + ADSK_CAM_ROTARYMACHINEAXIS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::InfiniteLine3D* rotationAxis_raw() const = 0; + virtual bool rotationAxis_raw(core::InfiniteLine3D* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr RotaryMachineAxis::rotationAxis() const +{ + core::Ptr res = rotationAxis_raw(); + return res; +} + +inline bool RotaryMachineAxis::rotationAxis(const core::Ptr& value) +{ + return rotationAxis_raw(value.get()); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_ROTARYMACHINEAXIS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Machine/RotaryMachineAxisInput.h b/usr/autodesk/CPP/include/CAM/Machine/RotaryMachineAxisInput.h new file mode 100644 index 0000000..eba5e0c --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Machine/RotaryMachineAxisInput.h @@ -0,0 +1,71 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "MachineAxisInput.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_ROTARYMACHINEAXISINPUT_CPP__ +# define ADSK_CAM_ROTARYMACHINEAXISINPUT_API XI_EXPORT +# else +# define ADSK_CAM_ROTARYMACHINEAXISINPUT_API +# endif +#else +# define ADSK_CAM_ROTARYMACHINEAXISINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class InfiniteLine3D; +}} + +namespace adsk { namespace cam { + +/// Object that defines the properties required to create a new rotary machine axis object. +class RotaryMachineAxisInput : public MachineAxisInput { +public: + + /// The infinite line that defines the direction and location of the axis of rotation. + /// This direction is in the machine's coordinate system (e.g. an A axis would + /// typically use (1,0,0) for the direction), and follows the right-hand rule. + core::Ptr rotationAxis() const; + bool rotationAxis(const core::Ptr& value); + + ADSK_CAM_ROTARYMACHINEAXISINPUT_API static const char* classType(); + ADSK_CAM_ROTARYMACHINEAXISINPUT_API const char* objectType() const override; + ADSK_CAM_ROTARYMACHINEAXISINPUT_API void* queryInterface(const char* id) const override; + ADSK_CAM_ROTARYMACHINEAXISINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::InfiniteLine3D* rotationAxis_raw() const = 0; + virtual bool rotationAxis_raw(core::InfiniteLine3D* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr RotaryMachineAxisInput::rotationAxis() const +{ + core::Ptr res = rotationAxis_raw(); + return res; +} + +inline bool RotaryMachineAxisInput::rotationAxis(const core::Ptr& value) +{ + return rotationAxis_raw(value.get()); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_ROTARYMACHINEAXISINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Operations/CAMParameter.h b/usr/autodesk/CPP/include/CAM/Operations/CAMParameter.h new file mode 100644 index 0000000..b12c60d --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Operations/CAMParameter.h @@ -0,0 +1,154 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_CAMPARAMETER_CPP__ +# define ADSK_CAM_CAMPARAMETER_API XI_EXPORT +# else +# define ADSK_CAM_CAMPARAMETER_API +# endif +#else +# define ADSK_CAM_CAMPARAMETER_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// Base class for representing parameter of an operation. +class CAMParameter : public core::Base { +public: + + /// Gets the name (internal name) of the parameter. + std::string name() const; + + /// Returns the title of this parameter as seen in the user interface. + /// This title is localized and can change based on the current language + std::string title() const; + + /// Gets and sets the value expression of the parameter. + std::string expression() const; + bool expression(const std::string& value); + + /// Gets if this parameter is enabled. Some parameters are enabled/disabled depending on the values + /// set for other parameters. + bool isEnabled() const; + + /// Returns a message corresponding to any active error associated with the value of this parameter. + std::string error() const; + + /// Returns a message corresponding to any active warning associated with the value of this parameter. + std::string warning() const; + + ADSK_CAM_CAMPARAMETER_API static const char* classType(); + ADSK_CAM_CAMPARAMETER_API const char* objectType() const override; + ADSK_CAM_CAMPARAMETER_API void* queryInterface(const char* id) const override; + ADSK_CAM_CAMPARAMETER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* name_raw() const = 0; + virtual char* title_raw() const = 0; + virtual char* expression_raw() const = 0; + virtual bool expression_raw(const char * value) = 0; + virtual bool isEnabled_raw() const = 0; + virtual char* error_raw() const = 0; + virtual char* warning_raw() const = 0; +}; + +// Inline wrappers + +inline std::string CAMParameter::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CAMParameter::title() const +{ + std::string res; + + char* p= title_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CAMParameter::expression() const +{ + std::string res; + + char* p= expression_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool CAMParameter::expression(const std::string& value) +{ + return expression_raw(value.c_str()); +} + +inline bool CAMParameter::isEnabled() const +{ + bool res = isEnabled_raw(); + return res; +} + +inline std::string CAMParameter::error() const +{ + std::string res; + + char* p= error_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CAMParameter::warning() const +{ + std::string res; + + char* p= warning_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_CAMPARAMETER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Operations/CAMParameters.h b/usr/autodesk/CPP/include/CAM/Operations/CAMParameters.h new file mode 100644 index 0000000..3fe06a8 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Operations/CAMParameters.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_CAMPARAMETERS_CPP__ +# define ADSK_CAM_CAMPARAMETERS_API XI_EXPORT +# else +# define ADSK_CAM_CAMPARAMETERS_API +# endif +#else +# define ADSK_CAM_CAMPARAMETERS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class CAMParameter; +}} + +namespace adsk { namespace cam { + +/// Collection that provides access to the parameters of an existing operation. +class CAMParameters : public core::Base { +public: + + /// Function that returns the specified parameter using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the parameter of the specified id (internal name). + /// internalName : The id (internal name) of the parameter. + /// Returns the specified parameter or null in the case where there is no parameter with the specified id. + core::Ptr itemByName(const std::string& internalName) const; + + /// The number of items in the collection. + size_t count() const; + + typedef CAMParameter iterable_type; + template void copyTo(OutputIterator result); + + ADSK_CAM_CAMPARAMETERS_API static const char* classType(); + ADSK_CAM_CAMPARAMETERS_API const char* objectType() const override; + ADSK_CAM_CAMPARAMETERS_API void* queryInterface(const char* id) const override; + ADSK_CAM_CAMPARAMETERS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CAMParameter* item_raw(size_t index) const = 0; + virtual CAMParameter* itemByName_raw(const char * internalName) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr CAMParameters::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr CAMParameters::itemByName(const std::string& internalName) const +{ + core::Ptr res = itemByName_raw(internalName.c_str()); + return res; +} + +inline size_t CAMParameters::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void CAMParameters::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_CAMPARAMETERS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Operations/Operation.h b/usr/autodesk/CPP/include/CAM/Operations/Operation.h new file mode 100644 index 0000000..c06cd06 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Operations/Operation.h @@ -0,0 +1,185 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../CAMTypeDefs.h" +#include "OperationBase.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_OPERATION_CPP__ +# define ADSK_CAM_OPERATION_API XI_EXPORT +# else +# define ADSK_CAM_OPERATION_API +# endif +#else +# define ADSK_CAM_OPERATION_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + +/// Object that represents an operation in an existing Setup, Folder or Pattern. +class Operation : public OperationBase { +public: + + /// Gets the strategy type for this operation. + OperationStrategyTypes strategyType() const; + + /// Gets if the toolpath for this operation is currently valid. (has not become invalidated by model changes). + bool isToolpathValid() const; + + /// Gets if the toolpath is in the process of generating. + bool isGenerating() const; + + /// Gets if problems were encountered when generating the toolpath for this operation. + bool hasWarning() const; + + /// Returns the parent Setup, Folder or Pattern for this operation. + core::Ptr parent() const; + + /// Gets if a toolpath currently exists (has been generated) for this operation. + bool hasToolpath() const; + + /// Gets the current state of this operation. + OperationStates operationState() const; + + /// Gets the toolpath generation progress value for this operation. + std::string generatingProgress() const; + + /// Get or set the tool in JSON format for this operation. Adds tool to the document. + std::string toolJson() const; + bool toolJson(const std::string& value); + + /// Get or set the id of the tool preset to be used. Must be valid for the applied tool. + std::string toolPresetId() const; + bool toolPresetId(const std::string& value); + + ADSK_CAM_OPERATION_API static const char* classType(); + ADSK_CAM_OPERATION_API const char* objectType() const override; + ADSK_CAM_OPERATION_API void* queryInterface(const char* id) const override; + ADSK_CAM_OPERATION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual OperationStrategyTypes strategyType_raw() const = 0; + virtual bool isToolpathValid_raw() const = 0; + virtual bool isGenerating_raw() const = 0; + virtual bool hasWarning_raw() const = 0; + virtual core::Base* parent_raw() const = 0; + virtual bool hasToolpath_raw() const = 0; + virtual OperationStates operationState_raw() const = 0; + virtual char* generatingProgress_raw() const = 0; + virtual char* toolJson_raw() const = 0; + virtual bool toolJson_raw(const char * value) = 0; + virtual char* toolPresetId_raw() const = 0; + virtual bool toolPresetId_raw(const char * value) = 0; +}; + +// Inline wrappers + +inline OperationStrategyTypes Operation::strategyType() const +{ + OperationStrategyTypes res = strategyType_raw(); + return res; +} + +inline bool Operation::isToolpathValid() const +{ + bool res = isToolpathValid_raw(); + return res; +} + +inline bool Operation::isGenerating() const +{ + bool res = isGenerating_raw(); + return res; +} + +inline bool Operation::hasWarning() const +{ + bool res = hasWarning_raw(); + return res; +} + +inline core::Ptr Operation::parent() const +{ + core::Ptr res = parent_raw(); + return res; +} + +inline bool Operation::hasToolpath() const +{ + bool res = hasToolpath_raw(); + return res; +} + +inline OperationStates Operation::operationState() const +{ + OperationStates res = operationState_raw(); + return res; +} + +inline std::string Operation::generatingProgress() const +{ + std::string res; + + char* p= generatingProgress_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string Operation::toolJson() const +{ + std::string res; + + char* p= toolJson_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Operation::toolJson(const std::string& value) +{ + return toolJson_raw(value.c_str()); +} + +inline std::string Operation::toolPresetId() const +{ + std::string res; + + char* p= toolPresetId_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Operation::toolPresetId(const std::string& value) +{ + return toolPresetId_raw(value.c_str()); +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_OPERATION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Operations/OperationBase.h b/usr/autodesk/CPP/include/CAM/Operations/OperationBase.h new file mode 100644 index 0000000..6cb2e98 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Operations/OperationBase.h @@ -0,0 +1,263 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_OPERATIONBASE_CPP__ +# define ADSK_CAM_OPERATIONBASE_API XI_EXPORT +# else +# define ADSK_CAM_OPERATIONBASE_API +# endif +#else +# define ADSK_CAM_OPERATIONBASE_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class CAMParameters; + class Setup; +}} +namespace adsk { namespace core { + class Attributes; +}} + +namespace adsk { namespace cam { + +/// Base class object representing all operations, folders, patterns and setups. +class OperationBase : public core::Base { +public: + + /// Gets and sets the name of the operation as seen in the browser. This name is unique as compared + /// to the names of all other operations in the document. + std::string name() const; + bool name(const std::string& value); + + /// Gets and sets the "protected" property value of the operation. + /// Gets/sets true if the operation is protected. + bool isProtected() const; + bool isProtected(bool value); + + /// Gets and sets the "Optional" property value of the operation. + /// Gets/sets true if the operation is optional. + bool isOptional() const; + bool isOptional(bool value); + + /// Gets and sets the "Suppressed" property value of the operation. + /// Gets/sets true if the operation is suppressed. + bool isSuppressed() const; + bool isSuppressed(bool value); + + /// Gets the Setup this operation belongs to. + core::Ptr parentSetup() const; + + /// Gets if this operation is selected in the 'Setups' browser. + bool isSelected() const; + + /// Gets and sets the notes of the operation. + std::string notes() const; + bool notes(const std::string& value); + + /// Returns the id of the operation. This id is unique as compared + /// to the ids of all other operations in the document. + /// This id will not change when changing the order or parent of the operation. + /// This id will remain valid when the document is saved and reloaded. + int operationId() const; + + /// Gets the CAMParameters collection for this operation. + core::Ptr parameters() const; + + /// Returns the collection of attributes associated with this object. + core::Ptr attributes() const; + + ADSK_CAM_OPERATIONBASE_API static const char* classType(); + ADSK_CAM_OPERATIONBASE_API const char* objectType() const override; + ADSK_CAM_OPERATIONBASE_API void* queryInterface(const char* id) const override; + ADSK_CAM_OPERATIONBASE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual bool isProtected_raw() const = 0; + virtual bool isProtected_raw(bool value) = 0; + virtual bool isOptional_raw() const = 0; + virtual bool isOptional_raw(bool value) = 0; + virtual bool isSuppressed_raw() const = 0; + virtual bool isSuppressed_raw(bool value) = 0; + virtual Setup* parentSetup_raw() const = 0; + virtual bool isSelected_raw() const = 0; + virtual char* notes_raw() const = 0; + virtual bool notes_raw(const char * value) = 0; + virtual int operationId_raw() const = 0; + virtual CAMParameters* parameters_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual void placeholderOperationBase0() {} + virtual void placeholderOperationBase1() {} + virtual void placeholderOperationBase2() {} + virtual void placeholderOperationBase3() {} + virtual void placeholderOperationBase4() {} + virtual void placeholderOperationBase5() {} + virtual void placeholderOperationBase6() {} + virtual void placeholderOperationBase7() {} + virtual void placeholderOperationBase8() {} + virtual void placeholderOperationBase9() {} + virtual void placeholderOperationBase10() {} + virtual void placeholderOperationBase11() {} + virtual void placeholderOperationBase12() {} + virtual void placeholderOperationBase13() {} + virtual void placeholderOperationBase14() {} + virtual void placeholderOperationBase15() {} + virtual void placeholderOperationBase16() {} + virtual void placeholderOperationBase17() {} + virtual void placeholderOperationBase18() {} + virtual void placeholderOperationBase19() {} + virtual void placeholderOperationBase20() {} + virtual void placeholderOperationBase21() {} + virtual void placeholderOperationBase22() {} + virtual void placeholderOperationBase23() {} + virtual void placeholderOperationBase24() {} + virtual void placeholderOperationBase25() {} + virtual void placeholderOperationBase26() {} + virtual void placeholderOperationBase27() {} + virtual void placeholderOperationBase28() {} + virtual void placeholderOperationBase29() {} + virtual void placeholderOperationBase30() {} + virtual void placeholderOperationBase31() {} + virtual void placeholderOperationBase32() {} + virtual void placeholderOperationBase33() {} + virtual void placeholderOperationBase34() {} + virtual void placeholderOperationBase35() {} + virtual void placeholderOperationBase36() {} + virtual void placeholderOperationBase37() {} + virtual void placeholderOperationBase38() {} + virtual void placeholderOperationBase39() {} + virtual void placeholderOperationBase40() {} + virtual void placeholderOperationBase41() {} + virtual void placeholderOperationBase42() {} + virtual void placeholderOperationBase43() {} + virtual void placeholderOperationBase44() {} + virtual void placeholderOperationBase45() {} + virtual void placeholderOperationBase46() {} + virtual void placeholderOperationBase47() {} + virtual void placeholderOperationBase48() {} +}; + +// Inline wrappers + +inline std::string OperationBase::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool OperationBase::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline bool OperationBase::isProtected() const +{ + bool res = isProtected_raw(); + return res; +} + +inline bool OperationBase::isProtected(bool value) +{ + return isProtected_raw(value); +} + +inline bool OperationBase::isOptional() const +{ + bool res = isOptional_raw(); + return res; +} + +inline bool OperationBase::isOptional(bool value) +{ + return isOptional_raw(value); +} + +inline bool OperationBase::isSuppressed() const +{ + bool res = isSuppressed_raw(); + return res; +} + +inline bool OperationBase::isSuppressed(bool value) +{ + return isSuppressed_raw(value); +} + +inline core::Ptr OperationBase::parentSetup() const +{ + core::Ptr res = parentSetup_raw(); + return res; +} + +inline bool OperationBase::isSelected() const +{ + bool res = isSelected_raw(); + return res; +} + +inline std::string OperationBase::notes() const +{ + std::string res; + + char* p= notes_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool OperationBase::notes(const std::string& value) +{ + return notes_raw(value.c_str()); +} + +inline int OperationBase::operationId() const +{ + int res = operationId_raw(); + return res; +} + +inline core::Ptr OperationBase::parameters() const +{ + core::Ptr res = parameters_raw(); + return res; +} + +inline core::Ptr OperationBase::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_OPERATIONBASE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/Operations/Operations.h b/usr/autodesk/CPP/include/CAM/Operations/Operations.h new file mode 100644 index 0000000..81d74c2 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/Operations/Operations.h @@ -0,0 +1,112 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_CAM_OPERATIONS_CPP__ +# define ADSK_CAM_OPERATIONS_API XI_EXPORT +# else +# define ADSK_CAM_OPERATIONS_API +# endif +#else +# define ADSK_CAM_OPERATIONS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class Operation; +}} + +namespace adsk { namespace cam { + +/// Collection that provides access to the individual operations within an existing setup, folder or pattern. +class Operations : public core::Base { +public: + + /// Function that returns the specified operation using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the operation with the specified name (as appears in the browser). + /// name : The name (as it appears in the browser) of the operation. + /// Returns the specified operation or null in the case where there is no operation with the specified name. + core::Ptr itemByName(const std::string& name) const; + + /// The number of items in the collection. + size_t count() const; + + /// Returns the operation with the specified operation id. + /// id : The id of the operation. + /// Returns the specified operation or null in the case where there is no operation with the specified operation id. + core::Ptr itemByOperationId(int id) const; + + typedef Operation iterable_type; + template void copyTo(OutputIterator result); + + ADSK_CAM_OPERATIONS_API static const char* classType(); + ADSK_CAM_OPERATIONS_API const char* objectType() const override; + ADSK_CAM_OPERATIONS_API void* queryInterface(const char* id) const override; + ADSK_CAM_OPERATIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Operation* item_raw(size_t index) const = 0; + virtual Operation* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual Operation* itemByOperationId_raw(int id) const = 0; +}; + +// Inline wrappers + +inline core::Ptr Operations::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr Operations::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t Operations::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr Operations::itemByOperationId(int id) const +{ + core::Ptr res = itemByOperationId_raw(id); + return res; +} + +template inline void Operations::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace cam +}// namespace adsk + +#undef ADSK_CAM_OPERATIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/SandvikIntegration/SandvikIntegration.h b/usr/autodesk/CPP/include/CAM/SandvikIntegration/SandvikIntegration.h new file mode 100644 index 0000000..a320d41 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/SandvikIntegration/SandvikIntegration.h @@ -0,0 +1,180 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../CAMTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_SANDVIKINTEGRATION_CPP__ +# define SANDVIKINTEGRATION_API XI_EXPORT +# else +# define SANDVIKINTEGRATION_API +# endif +#else +# define SANDVIKINTEGRATION_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class SandvikIntegrationEvent; + class SandvikPreIntegrationEvent; + class Setup; +}} + +namespace adsk { namespace cam { + +/// This singleton object provides access to application-level events and properties +/// that relate to the CAM (Manufacture) workspace in Fusion 360. +class SandvikIntegration : public core::Base { +public: + + /// Access to the root CAMGlobal object. + /// Return the root SandvikIntegration object or null if it failed. + static core::Ptr get(); + + /// This event will be fired just before an operation/setup dialog (create/edit) is + /// presented. This will allow the addin to indicate which, if any, of the integration + /// actions should be shown, as well as details of the presentation. See + /// SandvikPreIntegrationEventArgs for details. + core::Ptr preIntegrationEvent() const; + + /// An integration event will be fired when any of the buttons related to the + /// integration is pressed. The event arguments will provide information about which + /// button was pressed, and will provide contextual information, such as the object + /// active at the time. + core::Ptr integrationEvent() const; + + /// Provides a mechanism to store and retrieve user-specific information as a hidden system preference. + std::string settings() const; + bool settings(const std::string& value); + + /// Get the stock material id specified for the Setup. + /// setup : The Setup object to get the stock material id for. + /// The ID of the stock material set for the Setup. + std::string getStockMaterialId(const core::Ptr& setup); + + /// Set the stock material id for the Setup. + /// setup : The Setup object to set the stock material id for. + /// Returns true if successful. + bool setStockMaterialId(const core::Ptr& setup, const std::string& id); + + /// Get the stock material id specified for the Setup. + /// setup : The Setup object to get the stock material id for. + /// The ID of the stock material set for the Setup. + std::string getStockMaterialText(const core::Ptr& setup); + + /// Set the stock material text for the Setup. This will be displayed in the user interface. + /// setup : The Setup object to set the stock material text for. + /// Returns true if successful. + bool setStockMaterialText(const core::Ptr& setup, const std::string& text); + + SANDVIKINTEGRATION_API static const char* classType(); + SANDVIKINTEGRATION_API const char* objectType() const override; + SANDVIKINTEGRATION_API void* queryInterface(const char* id) const override; + SANDVIKINTEGRATION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + SANDVIKINTEGRATION_API static SandvikIntegration* get_raw(); + virtual SandvikPreIntegrationEvent* preIntegrationEvent_raw() const = 0; + virtual SandvikIntegrationEvent* integrationEvent_raw() const = 0; + virtual char* settings_raw() const = 0; + virtual bool settings_raw(const char * value) = 0; + virtual char* getStockMaterialId_raw(Setup* setup) = 0; + virtual bool setStockMaterialId_raw(Setup* setup, const char * id) = 0; + virtual char* getStockMaterialText_raw(Setup* setup) = 0; + virtual bool setStockMaterialText_raw(Setup* setup, const char * text) = 0; +}; + +// Inline wrappers + +inline core::Ptr SandvikIntegration::get() +{ + core::Ptr res = get_raw(); + return res; +} + +inline core::Ptr SandvikIntegration::preIntegrationEvent() const +{ + core::Ptr res = preIntegrationEvent_raw(); + return res; +} + +inline core::Ptr SandvikIntegration::integrationEvent() const +{ + core::Ptr res = integrationEvent_raw(); + return res; +} + +inline std::string SandvikIntegration::settings() const +{ + std::string res; + + char* p= settings_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool SandvikIntegration::settings(const std::string& value) +{ + return settings_raw(value.c_str()); +} + +inline std::string SandvikIntegration::getStockMaterialId(const core::Ptr& setup) +{ + std::string res; + + char* p= getStockMaterialId_raw(setup.get()); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool SandvikIntegration::setStockMaterialId(const core::Ptr& setup, const std::string& id) +{ + bool res = setStockMaterialId_raw(setup.get(), id.c_str()); + return res; +} + +inline std::string SandvikIntegration::getStockMaterialText(const core::Ptr& setup) +{ + std::string res; + + char* p= getStockMaterialText_raw(setup.get()); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool SandvikIntegration::setStockMaterialText(const core::Ptr& setup, const std::string& text) +{ + bool res = setStockMaterialText_raw(setup.get(), text.c_str()); + return res; +} +}// namespace cam +}// namespace adsk + +#undef SANDVIKINTEGRATION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/CAM/SandvikIntegration/SandvikIntegrationEvents.h b/usr/autodesk/CPP/include/CAM/SandvikIntegration/SandvikIntegrationEvents.h new file mode 100644 index 0000000..354c879 --- /dev/null +++ b/usr/autodesk/CPP/include/CAM/SandvikIntegration/SandvikIntegrationEvents.h @@ -0,0 +1,287 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Application/Events.h" +#include "../../Core/Application/EventHandler.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef CAMXINTERFACE_EXPORTS +# ifdef __COMPILING_SANDVIKINTEGRATIONEVENTS_CPP__ +# define SANDVIKINTEGRATIONEVENTS_API XI_EXPORT +# else +# define SANDVIKINTEGRATIONEVENTS_API +# endif +#else +# define SANDVIKINTEGRATIONEVENTS_API XI_IMPORT +#endif + +namespace adsk { namespace cam { + class OperationBase; + class SandvikIntegrationEvent; + class SandvikIntegrationEventArgs; + class SandvikIntegrationEventHandler; + class SandvikPreIntegrationEventArgs; + class SandvikPreIntegrationEventHandler; +}} + +namespace adsk { namespace cam { + +/// +class SandvikPreIntegrationEvent : public core::Event { +public: + + /// Add a handler to be notified when the SandvikPreIntegrationEvent occurs. + /// handler : The handler object to be called when this event is fired. + /// Returns true if the addition of the handler was successful. + bool add(SandvikPreIntegrationEventHandler* handler); + + /// Removes a handler from the SandvikPreIntegrationEvent. + /// handler : The handler object to be removed from the event. + /// Returns true if removal of the handler was successful. + bool remove(SandvikPreIntegrationEventHandler* handler); + + SANDVIKINTEGRATIONEVENTS_API static const char* classType(); + SANDVIKINTEGRATIONEVENTS_API const char* objectType() const override; + SANDVIKINTEGRATIONEVENTS_API void* queryInterface(const char* id) const override; + SANDVIKINTEGRATIONEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool add_raw(SandvikPreIntegrationEventHandler* handler) = 0; + virtual bool remove_raw(SandvikPreIntegrationEventHandler* handler) = 0; +}; + +// Inline wrappers + +inline bool SandvikPreIntegrationEvent::add(SandvikPreIntegrationEventHandler* handler) +{ + bool res = add_raw(handler); + return res; +} + +inline bool SandvikPreIntegrationEvent::remove(SandvikPreIntegrationEventHandler* handler) +{ + bool res = remove_raw(handler); + return res; +} + +/// +class SandvikIntegrationEvent : public core::Event { +public: + + /// Add a handler to be notified when the SandvikIntegrationEvent occurs. + /// handler : The handler object to be called when this event is fired. + /// Returns true if the addition of the handler was successful. + bool add(SandvikIntegrationEventHandler* handler); + + /// Removes a handler from the SandvikIntegrationEvent. + /// handler : The handler object to be removed from the event. + /// Returns true if removal of the handler was successful. + bool remove(SandvikIntegrationEventHandler* handler); + + SANDVIKINTEGRATIONEVENTS_API static const char* classType(); + SANDVIKINTEGRATIONEVENTS_API const char* objectType() const override; + SANDVIKINTEGRATIONEVENTS_API void* queryInterface(const char* id) const override; + SANDVIKINTEGRATIONEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool add_raw(SandvikIntegrationEventHandler* handler) = 0; + virtual bool remove_raw(SandvikIntegrationEventHandler* handler) = 0; +}; + +// Inline wrappers + +inline bool SandvikIntegrationEvent::add(SandvikIntegrationEventHandler* handler) +{ + bool res = add_raw(handler); + return res; +} + +inline bool SandvikIntegrationEvent::remove(SandvikIntegrationEventHandler* handler) +{ + bool res = remove_raw(handler); + return res; +} + +/// Event handler for the SandvikPreIntegrationEvent event. +class SandvikPreIntegrationEventHandler : public core::EventHandler { +public: + + /// The function called by CAM when the associated event is fired. + /// eventArgs : Returns an object that provides access to additional information associated with the event. + SANDVIKINTEGRATIONEVENTS_API virtual void notify(const core::Ptr& eventArgs) = 0; +}; + +/// This EventArgs object will be sent with the SandvikPreIntegrationEvent. +class SandvikPreIntegrationEventArgs : public core::EventArgs { +public: + + /// Provides access to the object that is being edited or created. + core::Ptr contextObject() const; + + /// Initially false, this should be set to true to enable the display of the "Set Material" + /// action on the Setup create/edit dialog. + bool showSetMaterial() const; + bool showSetMaterial(bool value); + + /// Initially false, this should be set to true to enable the display of the "Select Tool Assembly" + /// action on the Operation create/edit dialog. + bool showSelectToolAssembly() const; + bool showSelectToolAssembly(bool value); + + /// Initially false, this should be set to true to enable the display of the "Get Tool Recommendation" + /// action on the Operation create/edit dialog. + bool showGetToolRecommendation() const; + bool showGetToolRecommendation(bool value); + + /// Initially false, this should be set to true to enable the display of the "Get Cutting Data" + /// action on the Operation create/edit dialog. + bool showGetCuttingData() const; + bool showGetCuttingData(bool value); + + SANDVIKINTEGRATIONEVENTS_API static const char* classType(); + SANDVIKINTEGRATIONEVENTS_API const char* objectType() const override; + SANDVIKINTEGRATIONEVENTS_API void* queryInterface(const char* id) const override; + SANDVIKINTEGRATIONEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual OperationBase* contextObject_raw() const = 0; + virtual bool showSetMaterial_raw() const = 0; + virtual bool showSetMaterial_raw(bool value) = 0; + virtual bool showSelectToolAssembly_raw() const = 0; + virtual bool showSelectToolAssembly_raw(bool value) = 0; + virtual bool showGetToolRecommendation_raw() const = 0; + virtual bool showGetToolRecommendation_raw(bool value) = 0; + virtual bool showGetCuttingData_raw() const = 0; + virtual bool showGetCuttingData_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr SandvikPreIntegrationEventArgs::contextObject() const +{ + core::Ptr res = contextObject_raw(); + return res; +} + +inline bool SandvikPreIntegrationEventArgs::showSetMaterial() const +{ + bool res = showSetMaterial_raw(); + return res; +} + +inline bool SandvikPreIntegrationEventArgs::showSetMaterial(bool value) +{ + return showSetMaterial_raw(value); +} + +inline bool SandvikPreIntegrationEventArgs::showSelectToolAssembly() const +{ + bool res = showSelectToolAssembly_raw(); + return res; +} + +inline bool SandvikPreIntegrationEventArgs::showSelectToolAssembly(bool value) +{ + return showSelectToolAssembly_raw(value); +} + +inline bool SandvikPreIntegrationEventArgs::showGetToolRecommendation() const +{ + bool res = showGetToolRecommendation_raw(); + return res; +} + +inline bool SandvikPreIntegrationEventArgs::showGetToolRecommendation(bool value) +{ + return showGetToolRecommendation_raw(value); +} + +inline bool SandvikPreIntegrationEventArgs::showGetCuttingData() const +{ + bool res = showGetCuttingData_raw(); + return res; +} + +inline bool SandvikPreIntegrationEventArgs::showGetCuttingData(bool value) +{ + return showGetCuttingData_raw(value); +} + +/// Event handler for the SandvikIntegrationEvent event. +class SandvikIntegrationEventHandler : public core::EventHandler { +public: + + /// The function called by CAM when the associated event is fired. + /// eventArgs : Returns an object that provides access to additional information associated with the event. + SANDVIKINTEGRATIONEVENTS_API virtual void notify(const core::Ptr& eventArgs) = 0; +}; + +/// This EventArgs object will be sent with the SandvikIntegrationEvent. +class SandvikIntegrationEventArgs : public core::EventArgs { +public: + + /// The action to be performed -- by convention with Sandvik. + /// Actions include: + /// "selectAssembly" + /// "getToolRecommendation" + /// "getCuttingData" + /// "setMaterial" + std::string action() const; + + /// Provides access to the object that is being edited or created. + core::Ptr contextObject() const; + + SANDVIKINTEGRATIONEVENTS_API static const char* classType(); + SANDVIKINTEGRATIONEVENTS_API const char* objectType() const override; + SANDVIKINTEGRATIONEVENTS_API void* queryInterface(const char* id) const override; + SANDVIKINTEGRATIONEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* action_raw() const = 0; + virtual OperationBase* contextObject_raw() const = 0; +}; + +// Inline wrappers + +inline std::string SandvikIntegrationEventArgs::action() const +{ + std::string res; + + char* p= action_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr SandvikIntegrationEventArgs::contextObject() const +{ + core::Ptr res = contextObject_raw(); + return res; +} +}// namespace cam +}// namespace adsk + +#undef SANDVIKINTEGRATIONEVENTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Core/.gitignore b/usr/autodesk/CPP/include/Core/.gitignore new file mode 100644 index 0000000..8f613bc --- /dev/null +++ b/usr/autodesk/CPP/include/Core/.gitignore @@ -0,0 +1,9 @@ +* +!.gitignore +!Application/EventHandler.h +!Application/ScriptHandler.h +!Base.h +!Deallocator.h +!Memory.h +!OSMacros.h +!Utils.h diff --git a/usr/autodesk/CPP/include/Core/Base.h b/usr/autodesk/CPP/include/Core/Base.h new file mode 100644 index 0000000..d7e3567 --- /dev/null +++ b/usr/autodesk/CPP/include/Core/Base.h @@ -0,0 +1,127 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "Memory.h" + +// THIS CLASS IS USED BY AN API CLIENT + + +#include "OSMacros.h" + +#ifdef XINTERFACE_EXPORTS +# ifdef __COMPILING_xIBASE_CPP__ +# define xIBASE_API XI_EXPORT +# else +# define xIBASE_API +# endif +#else +# define xIBASE_API XI_IMPORT +#endif + +namespace Ns { + class UniqueString; +} + + +namespace adsk +{ +namespace core +{ + +// Base class for all xInterface classes. The functions in this +// class are visible to and callable by an API client. +// The class does RTTI via the pObject->query() method. +class Base : public ReferenceCounted +{ +public: + + // All xInterface classes (except this one) + // have to implement the following + // and return a unique address that is based on the class name. + // static const char* classType(); + // We will do this via code generation from NIDL. + xIBASE_API static const char* classType(); + + // Get the interfaceId of the most derived (most specific) type of this reference. + virtual const char* objectType() const = 0; + + // Indicates if this object is still valid, i.e. hasn't been deleted + // or some other action done to invalidate the reference. + virtual bool isValid() const = 0; + + // This is used to do RTTI via a templatized pObject->query() method. + // It is used by API clients to do RTTI between xInterface classes. + template + Ptr cast() const; + + // Debug aid to get the total live instance count + xIBASE_API static size_t instances(); +protected: + + xIBASE_API Base(void); + xIBASE_API virtual ~Base(void); + + // This is used to do RTTI via a templatized pObject->query_raw() method. + // It is used internally to do RTTI to implementation (e.g. xLayer) classes + // (API clients will not have the implementation header files and can't do this). + // Public for implementation convenience, but not intended for normal client use. + // The result is equivalent to a cast and no reference count is added to the reference returned. +public: + template + T* query() const + { + return static_cast(this->queryInterface(T::interfaceId())); + } + + // For internal use. Just forwards to classType. + static const char* interfaceId() { return classType(); } +protected: + + // This will be implemented in the xInterface classes via + // code generation from NIDL. + // The result is equivalent to a cast and no reference count is added to the reference returned. + xIBASE_API virtual void* queryInterface(const char* interfaceId) const; + virtual void* queryInterface(const Ns::UniqueString* id) const = 0; + +private: + + virtual void placeholderBase0() {} + virtual void placeholderBase1() {} + virtual void placeholderBase2() {} + virtual void placeholderBase3() {} + virtual void placeholderBase4() {} + virtual void placeholderBase5() {} + virtual void placeholderBase6() {} + virtual void placeholderBase7() {} + virtual void placeholderBase8() {} + virtual void placeholderBase9() {} + virtual void placeholderBase10() {} + virtual void placeholderBase11() {} + virtual void placeholderBase12() {} + virtual void placeholderBase13() {} + virtual void placeholderBase14() {} + virtual void placeholderBase15() {} +}; + + +template +inline Ptr Base::cast() const +{ + T* pT = query(); + return Ptr(pT, false); +} + + +} // namespace core +} // namespace adsk + +#undef xIBASE_API diff --git a/usr/autodesk/CPP/include/Core/Deallocator.h b/usr/autodesk/CPP/include/Core/Deallocator.h new file mode 100644 index 0000000..9ea4062 --- /dev/null +++ b/usr/autodesk/CPP/include/Core/Deallocator.h @@ -0,0 +1,91 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "OSMacros.h" + +#ifdef XINTERFACE_EXPORTS +# ifdef __COMPILING_xIDEALLOCATOR_CPP__ +# define xIDEALLOCATOR_API XI_EXPORT +# else +# define xIDEALLOCATOR_API +# endif +#else +# define xIDEALLOCATOR_API XI_IMPORT +#endif + + +#define DEALLOCATEARRAYINTERNAL(T) \ + namespace adsk { namespace core {\ + xIDEALLOCATOR_API void DeallocateArrayInternal(T* p);\ + }} + +#define DEALLOCATEARRAYINTERNALCLASS(space, T) \ + namespace adsk { namespace space {\ + class T;\ + }}\ + DEALLOCATEARRAYINTERNAL(adsk::space::T*) + +DEALLOCATEARRAYINTERNAL(char) +DEALLOCATEARRAYINTERNAL(char*) +DEALLOCATEARRAYINTERNAL(int) +DEALLOCATEARRAYINTERNAL(short) +DEALLOCATEARRAYINTERNAL(double) +DEALLOCATEARRAYINTERNAL(bool) +DEALLOCATEARRAYINTERNAL(float) +DEALLOCATEARRAYINTERNAL(size_t) +DEALLOCATEARRAYINTERNALCLASS(core, Attribute) +DEALLOCATEARRAYINTERNALCLASS(core, DataFile) +DEALLOCATEARRAYINTERNALCLASS(core, DataFolder) +DEALLOCATEARRAYINTERNALCLASS(core, DataHub) +DEALLOCATEARRAYINTERNALCLASS(core, DataProject) +DEALLOCATEARRAYINTERNALCLASS(core, Point3D) +DEALLOCATEARRAYINTERNALCLASS(core, Point2D) +DEALLOCATEARRAYINTERNALCLASS(core, CommandDefinition) +DEALLOCATEARRAYINTERNALCLASS(core, Vector3D) +DEALLOCATEARRAYINTERNALCLASS(core, Vector2D) +DEALLOCATEARRAYINTERNALCLASS(core, Color) +DEALLOCATEARRAYINTERNALCLASS(core, Base) +DEALLOCATEARRAYINTERNALCLASS(core, Curve3D) +DEALLOCATEARRAYINTERNALCLASS(core, User) +DEALLOCATEARRAYINTERNALCLASS(core, Selection) +DEALLOCATEARRAYINTERNALCLASS(fusion, BRepBody) +DEALLOCATEARRAYINTERNALCLASS(fusion, BRepEdge) +DEALLOCATEARRAYINTERNALCLASS(fusion, BRepLoop) +DEALLOCATEARRAYINTERNALCLASS(fusion, BRepFace) +DEALLOCATEARRAYINTERNALCLASS(fusion, ConstructionPlane) +DEALLOCATEARRAYINTERNALCLASS(fusion, ConstructionPoint) +DEALLOCATEARRAYINTERNALCLASS(fusion, ConstructionAxis) +DEALLOCATEARRAYINTERNALCLASS(fusion, Sketch) +DEALLOCATEARRAYINTERNALCLASS(fusion, MeshBody) +DEALLOCATEARRAYINTERNALCLASS(fusion, Occurrence) +DEALLOCATEARRAYINTERNALCLASS(fusion, SketchCurve) +DEALLOCATEARRAYINTERNALCLASS(fusion, SketchEntity) +DEALLOCATEARRAYINTERNALCLASS(fusion, SketchLine) +DEALLOCATEARRAYINTERNALCLASS(fusion, Joint) +DEALLOCATEARRAYINTERNALCLASS(fusion, AsBuiltJoint) +DEALLOCATEARRAYINTERNALCLASS(fusion, RigidGroup) +DEALLOCATEARRAYINTERNALCLASS(fusion, JointOrigin) +DEALLOCATEARRAYINTERNALCLASS(fusion, CustomGraphicsCoordinates) +DEALLOCATEARRAYINTERNALCLASS(cam, Machine) +DEALLOCATEARRAYINTERNALCLASS(cam, MachineDescription) + +namespace adsk +{ +namespace core +{ + // delete an allocated address returned from an interface + template void DeallocateArray(T* p) { DeallocateArrayInternal(p); } + +} // namespace core +} // namespace adsk + +#undef xIDEALLOCATOR_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Core/Memory.h b/usr/autodesk/CPP/include/Core/Memory.h new file mode 100644 index 0000000..2e1edf9 --- /dev/null +++ b/usr/autodesk/CPP/include/Core/Memory.h @@ -0,0 +1,190 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include +#include + +// THESE TYPES ARE USED BY AN API CLIENT + +#include "OSMacros.h" +#include "Deallocator.h" + +#ifdef XINTERFACE_EXPORTS +# ifdef __COMPILING_xIMEMORY_CPP__ +# define xIMEMORY_API XI_EXPORT +# else +# define xIMEMORY_API +# endif +#else +# define xIMEMORY_API XI_IMPORT +#endif + +namespace adsk +{ +namespace core +{ + +template class Iterator; + +class ReferenceCounted +{ +public: + // Reference counting on the interface. all interfaces returned from apis will have a reference count of + // at least one, and the caller is responsible for calling release. This reference counting should be hidden + // from clients through smart pointer wrappers defined in the interface. + virtual void addref() = 0; + virtual void release() = 0; + virtual int refcount() const = 0; +}; + +class IncompleteType +{ +public: + template static void addref(void* ptr) { reinterpret_cast(ptr)->addref(); } + template static void release(void* ptr) { reinterpret_cast(ptr)->release(); } +}; + +class CompleteType +{ +public: + template static void addref(T* ptr) { ptr->addref(); } + template static void release(T* ptr) { ptr->release(); } +}; + +template +class Ptr +{ +public: + + typedef T element_type; + + Ptr() : ptr_(nullptr) {} + Ptr(const Ptr& rhs) : ptr_(nullptr) { reset(rhs.ptr_); } + Ptr(const T* ptr, bool attach = true) : ptr_(nullptr) { reset(ptr, attach); } + + // casting constructor. call operator bool to verify if cast was successful + template + Ptr(const Ptr& rhs) : ptr_(nullptr) { + if (rhs) + reset(rhs->template query(), false); + } + + ~Ptr() { reset(nullptr); } + + void operator=(const Ptr& rhs) { if (&rhs != this) reset(rhs.ptr_); } + void operator=(const T* ptr) { reset(ptr, true); } + + // casting assignment operator. call operator bool to verify if cast was successful + template + void operator=(const Ptr& rhs) { + if (rhs) + reset(rhs->template query(), false); + else + reset(nullptr); + } + + void reset(const T* ptr, bool attach = false) { + if (ptr_ != ptr) + { + if (ptr_) + PT::template release(ptr_); + ptr_ = const_cast(ptr); + if (!attach && ptr_) + PT::template addref(ptr_); + } + } + + T* operator->() const { assert(ptr_ != nullptr); if (ptr_ == nullptr) throw std::exception(); return ptr_; } + + // Test if this pointer is empty (if operator-> will throw) + /*explicit*/ operator bool() const { return ptr_ != nullptr; } + + bool operator==(const Ptr& rhs) const { return ptr_ == rhs.ptr_; } + bool operator!=(const Ptr& rhs) const { return ptr_ != rhs.ptr_; } + bool operator<(const Ptr& rhs) const { return ptr_ < rhs.ptr_; } + + + // Iteration support. Only usable if T has count and item members and an iterable_type + typedef Iterator iterator; + iterator begin() const { return Iterator(*this); } + iterator end() const { return Iterator(*this, true); } + + // Caution the following functions if used incorrectly can cause a reference count leak + T* get() const { return ptr_; } + T* detach() { T* t = ptr_; ptr_ = nullptr; return t; } + +private: + + T* ptr_; +}; + + +template +class Iterator : public std::iterator> +{ +public: + + Iterator(const Ptr& container, bool end = false) : container_(container), i_(0), end_(end) + { if (!end && container_->count() == 0) end_ = true; assert(container_); } + Iterator(const Iterator& rhs) : container_(rhs.container_), current_(rhs.current_), i_(rhs.i_), end_(rhs.end_) {} + + Iterator& operator++() + { + assert(!end_); // undefined to advance an iterator at end, but just noop + if (!end_) + { + current_.reset(nullptr); + assert(container_); // should never fire unless constructed improperly + size_t count = container_->count(); + if (i_ < count) + ++i_; + if (i_ >= count) + end_ = true; + } + return *this; + } + + typename Iterator::value_type& operator*() + { + assert(!end_); + assert(container_); // should never fire unless constructed improplerly + if (!end_ && !current_ && container_) + { + current_ = container_->item(i_); + assert(current_); // assume container is not poplulated with null values, so this should indicate a container error, check getLastError + } + return current_; + } + + bool operator==(const Iterator& rhs) const + { + return container_ == rhs.container_ && end_ == rhs.end_ && (end_ || i_ == rhs.i_); + } + + Iterator operator++(int) { Iterator tmp(*this); operator++(); return tmp; } + typename Iterator::value_type& operator->() { return operator*(); } + bool operator!=(const Iterator& rhs) const { return !operator==(rhs); } + + +private: + + Ptr container_; + typename Iterator::value_type current_; + size_t i_; + bool end_; +}; + +} // namespace core +} // namespace adsk + +#undef xIMEMORY_API diff --git a/usr/autodesk/CPP/include/Core/OSMacros.h b/usr/autodesk/CPP/include/Core/OSMacros.h new file mode 100644 index 0000000..2e79397 --- /dev/null +++ b/usr/autodesk/CPP/include/Core/OSMacros.h @@ -0,0 +1,27 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#if defined(_WINDOWS) || defined(_WIN64) +# define XI_WIN +#elif defined(__APPLE__) && defined(__MACH__) +# define XI_OSX +#else +# error "Operating System Not Supported By Neutron. Only Windows and Mac OS X Supported" +#endif + +#if defined(XI_WIN) +# define XI_EXPORT __declspec(dllexport) +# define XI_IMPORT __declspec(dllimport) +#elif defined(XI_OSX) +# define XI_EXPORT __attribute__ ((visibility("default"))) +# define XI_IMPORT +#endif \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Core/Utils.h b/usr/autodesk/CPP/include/Core/Utils.h new file mode 100644 index 0000000..8bd457f --- /dev/null +++ b/usr/autodesk/CPP/include/Core/Utils.h @@ -0,0 +1,35 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "OSMacros.h" + +#ifdef XINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_UTILS_CPP__ +# define ADSK_UTILS_API XI_EXPORT +# else +# define ADSK_UTILS_API +# endif +#else +# define ADSK_UTILS_API XI_IMPORT +#endif + + +namespace adsk +{ + ADSK_UTILS_API bool terminate(); + + ADSK_UTILS_API bool autoTerminate(); + + ADSK_UTILS_API bool autoTerminate(bool value); + + ADSK_UTILS_API bool doEvents(); +} // namespace adsk \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Drawing/Drawing/Drawing.h b/usr/autodesk/CPP/include/Drawing/Drawing/Drawing.h new file mode 100644 index 0000000..5fd06e4 --- /dev/null +++ b/usr/autodesk/CPP/include/Drawing/Drawing/Drawing.h @@ -0,0 +1,63 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Application/Product.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef DRAWINGXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_DRAWING_DRAWING_CPP__ +# define ADSK_DRAWING_DRAWING_API XI_EXPORT +# else +# define ADSK_DRAWING_DRAWING_API +# endif +#else +# define ADSK_DRAWING_DRAWING_API XI_IMPORT +#endif + +namespace adsk { namespace drawing { + class DrawingExportManager; +}} + +namespace adsk { namespace drawing { + +/// Object that represents the drawing specific data within a drawing document. +class Drawing : public core::Product { +public: + + /// Returns the DrawingExportManager for this drawing. You use the ExportManager + /// to export the drawing in various formats. + core::Ptr exportManager() const; + + ADSK_DRAWING_DRAWING_API static const char* classType(); + ADSK_DRAWING_DRAWING_API const char* objectType() const override; + ADSK_DRAWING_DRAWING_API void* queryInterface(const char* id) const override; + ADSK_DRAWING_DRAWING_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual DrawingExportManager* exportManager_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr Drawing::exportManager() const +{ + core::Ptr res = exportManager_raw(); + return res; +} +}// namespace drawing +}// namespace adsk + +#undef ADSK_DRAWING_DRAWING_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Drawing/Drawing/DrawingDocument.h b/usr/autodesk/CPP/include/Drawing/Drawing/DrawingDocument.h new file mode 100644 index 0000000..c0f5ca6 --- /dev/null +++ b/usr/autodesk/CPP/include/Drawing/Drawing/DrawingDocument.h @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Application/Document.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef DRAWINGXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_DRAWING_DRAWINGDOCUMENT_CPP__ +# define ADSK_DRAWING_DRAWINGDOCUMENT_API XI_EXPORT +# else +# define ADSK_DRAWING_DRAWINGDOCUMENT_API +# endif +#else +# define ADSK_DRAWING_DRAWINGDOCUMENT_API XI_IMPORT +#endif + +namespace adsk { namespace drawing { + class Drawing; +}} + +namespace adsk { namespace drawing { + +/// Object that represents a Fusion 360 drawing document. +class DrawingDocument : public core::Document { +public: + + /// Returns the Drawing product object associated with this drawing document. + core::Ptr drawing() const; + + ADSK_DRAWING_DRAWINGDOCUMENT_API static const char* classType(); + ADSK_DRAWING_DRAWINGDOCUMENT_API const char* objectType() const override; + ADSK_DRAWING_DRAWINGDOCUMENT_API void* queryInterface(const char* id) const override; + ADSK_DRAWING_DRAWINGDOCUMENT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Drawing* drawing_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr DrawingDocument::drawing() const +{ + core::Ptr res = drawing_raw(); + return res; +} +}// namespace drawing +}// namespace adsk + +#undef ADSK_DRAWING_DRAWINGDOCUMENT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Drawing/Drawing/DrawingExportManager.h b/usr/autodesk/CPP/include/Drawing/Drawing/DrawingExportManager.h new file mode 100644 index 0000000..3ec3a7a --- /dev/null +++ b/usr/autodesk/CPP/include/Drawing/Drawing/DrawingExportManager.h @@ -0,0 +1,81 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../DrawingTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef DRAWINGXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_DRAWING_DRAWINGEXPORTMANAGER_CPP__ +# define ADSK_DRAWING_DRAWINGEXPORTMANAGER_API XI_EXPORT +# else +# define ADSK_DRAWING_DRAWINGEXPORTMANAGER_API +# endif +#else +# define ADSK_DRAWING_DRAWINGEXPORTMANAGER_API XI_IMPORT +#endif + +namespace adsk { namespace drawing { + class DrawingExportOptions; + class PDFExportOptions; +}} + +namespace adsk { namespace drawing { + +/// Provides support to export the drawing in various formats. +class DrawingExportManager : public core::Base { +public: + + /// Defines the various settings for a STEP export. + /// filename : The name of the file to export to. Use settings on the returned PDFExportOptions + /// object to change other settings. + /// Returns a PDFExportOptions object if successful and null if it should fail. + core::Ptr createPDFExportOptions(const std::string& filename); + + /// Executes the export operation to create the file in the format specified by the input ExportOptions object. + /// exportOptions : A DrawingExportOptions object that is created using one of the create methods on the DrawingExportManager object. + /// This defines the type of export and defines the options supported for that file type. + /// Returns true if the export was successful. + bool execute(const core::Ptr& exportOptions); + + ADSK_DRAWING_DRAWINGEXPORTMANAGER_API static const char* classType(); + ADSK_DRAWING_DRAWINGEXPORTMANAGER_API const char* objectType() const override; + ADSK_DRAWING_DRAWINGEXPORTMANAGER_API void* queryInterface(const char* id) const override; + ADSK_DRAWING_DRAWINGEXPORTMANAGER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual PDFExportOptions* createPDFExportOptions_raw(const char * filename) = 0; + virtual bool execute_raw(DrawingExportOptions* exportOptions) = 0; +}; + +// Inline wrappers + +inline core::Ptr DrawingExportManager::createPDFExportOptions(const std::string& filename) +{ + core::Ptr res = createPDFExportOptions_raw(filename.c_str()); + return res; +} + +inline bool DrawingExportManager::execute(const core::Ptr& exportOptions) +{ + bool res = execute_raw(exportOptions.get()); + return res; +} +}// namespace drawing +}// namespace adsk + +#undef ADSK_DRAWING_DRAWINGEXPORTMANAGER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Drawing/Drawing/DrawingExportOptions.h b/usr/autodesk/CPP/include/Drawing/Drawing/DrawingExportOptions.h new file mode 100644 index 0000000..01fd2bc --- /dev/null +++ b/usr/autodesk/CPP/include/Drawing/Drawing/DrawingExportOptions.h @@ -0,0 +1,106 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../DrawingTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef DRAWINGXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_DRAWING_DRAWINGEXPORTOPTIONS_CPP__ +# define ADSK_DRAWING_DRAWINGEXPORTOPTIONS_API XI_EXPORT +# else +# define ADSK_DRAWING_DRAWINGEXPORTOPTIONS_API +# endif +#else +# define ADSK_DRAWING_DRAWINGEXPORTOPTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace drawing { + +/// The base class for the different drawing export types. This class is never directly used +/// in an export because you need the specific export type to specify the type of +/// export to be performed. +class DrawingExportOptions : public core::Base { +public: + + /// Gets and sets the filename that the exported file will be written to. + std::string filename() const; + bool filename(const std::string& value); + + ADSK_DRAWING_DRAWINGEXPORTOPTIONS_API static const char* classType(); + ADSK_DRAWING_DRAWINGEXPORTOPTIONS_API const char* objectType() const override; + ADSK_DRAWING_DRAWINGEXPORTOPTIONS_API void* queryInterface(const char* id) const override; + ADSK_DRAWING_DRAWINGEXPORTOPTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* filename_raw() const = 0; + virtual bool filename_raw(const char * value) = 0; + virtual void placeholderDrawingExportOptions0() {} + virtual void placeholderDrawingExportOptions1() {} + virtual void placeholderDrawingExportOptions2() {} + virtual void placeholderDrawingExportOptions3() {} + virtual void placeholderDrawingExportOptions4() {} + virtual void placeholderDrawingExportOptions5() {} + virtual void placeholderDrawingExportOptions6() {} + virtual void placeholderDrawingExportOptions7() {} + virtual void placeholderDrawingExportOptions8() {} + virtual void placeholderDrawingExportOptions9() {} + virtual void placeholderDrawingExportOptions10() {} + virtual void placeholderDrawingExportOptions11() {} + virtual void placeholderDrawingExportOptions12() {} + virtual void placeholderDrawingExportOptions13() {} + virtual void placeholderDrawingExportOptions14() {} + virtual void placeholderDrawingExportOptions15() {} + virtual void placeholderDrawingExportOptions16() {} + virtual void placeholderDrawingExportOptions17() {} + virtual void placeholderDrawingExportOptions18() {} + virtual void placeholderDrawingExportOptions19() {} + virtual void placeholderDrawingExportOptions20() {} + virtual void placeholderDrawingExportOptions21() {} + virtual void placeholderDrawingExportOptions22() {} + virtual void placeholderDrawingExportOptions23() {} + virtual void placeholderDrawingExportOptions24() {} + virtual void placeholderDrawingExportOptions25() {} + virtual void placeholderDrawingExportOptions26() {} + virtual void placeholderDrawingExportOptions27() {} + virtual void placeholderDrawingExportOptions28() {} + virtual void placeholderDrawingExportOptions29() {} +}; + +// Inline wrappers + +inline std::string DrawingExportOptions::filename() const +{ + std::string res; + + char* p= filename_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool DrawingExportOptions::filename(const std::string& value) +{ + return filename_raw(value.c_str()); +} +}// namespace drawing +}// namespace adsk + +#undef ADSK_DRAWING_DRAWINGEXPORTOPTIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Drawing/Drawing/PDFExportOptions.h b/usr/autodesk/CPP/include/Drawing/Drawing/PDFExportOptions.h new file mode 100644 index 0000000..56e388f --- /dev/null +++ b/usr/autodesk/CPP/include/Drawing/Drawing/PDFExportOptions.h @@ -0,0 +1,133 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../DrawingTypeDefs.h" +#include "DrawingExportOptions.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef DRAWINGXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_DRAWING_PDFEXPORTOPTIONS_CPP__ +# define ADSK_DRAWING_PDFEXPORTOPTIONS_API XI_EXPORT +# else +# define ADSK_DRAWING_PDFEXPORTOPTIONS_API +# endif +#else +# define ADSK_DRAWING_PDFEXPORTOPTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace drawing { + +/// Defines the inputs needed to export the drawing as PDF. +class PDFExportOptions : public DrawingExportOptions { +public: + + /// Defines which sheets to export. Defaults to AllPDFSheets which + /// will create a single PDF file containing all sheets in the drawing. + /// the SelectedPDFSheets and CurrentPDFSheet options are dependent on + /// the current selections in the user interface. + /// To set this to RangePDFSheets, use the sheetRange property to define + /// the range of sheets to print. + PDFSheetsExport sheetsToExport() const; + bool sheetsToExport(PDFSheetsExport value); + + /// Defines the range of sheets to export. This can be a string like + /// "1-3" or "1-2,5" where you can define a range of sheets and also + /// specific sheets. Setting this property will automatically set + /// the sheetsToExport setting to SelectedPDFSheets. + std::string sheetRange() const; + bool sheetRange(const std::string& value); + + /// Specifies that the PDF file will be opened after export. + bool openPDF() const; + bool openPDF(bool value); + + /// Specifies if line weights should be used in the exported PDF file. + bool useLineWeights() const; + bool useLineWeights(bool value); + + ADSK_DRAWING_PDFEXPORTOPTIONS_API static const char* classType(); + ADSK_DRAWING_PDFEXPORTOPTIONS_API const char* objectType() const override; + ADSK_DRAWING_PDFEXPORTOPTIONS_API void* queryInterface(const char* id) const override; + ADSK_DRAWING_PDFEXPORTOPTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual PDFSheetsExport sheetsToExport_raw() const = 0; + virtual bool sheetsToExport_raw(PDFSheetsExport value) = 0; + virtual char* sheetRange_raw() const = 0; + virtual bool sheetRange_raw(const char * value) = 0; + virtual bool openPDF_raw() const = 0; + virtual bool openPDF_raw(bool value) = 0; + virtual bool useLineWeights_raw() const = 0; + virtual bool useLineWeights_raw(bool value) = 0; +}; + +// Inline wrappers + +inline PDFSheetsExport PDFExportOptions::sheetsToExport() const +{ + PDFSheetsExport res = sheetsToExport_raw(); + return res; +} + +inline bool PDFExportOptions::sheetsToExport(PDFSheetsExport value) +{ + return sheetsToExport_raw(value); +} + +inline std::string PDFExportOptions::sheetRange() const +{ + std::string res; + + char* p= sheetRange_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool PDFExportOptions::sheetRange(const std::string& value) +{ + return sheetRange_raw(value.c_str()); +} + +inline bool PDFExportOptions::openPDF() const +{ + bool res = openPDF_raw(); + return res; +} + +inline bool PDFExportOptions::openPDF(bool value) +{ + return openPDF_raw(value); +} + +inline bool PDFExportOptions::useLineWeights() const +{ + bool res = useLineWeights_raw(); + return res; +} + +inline bool PDFExportOptions::useLineWeights(bool value) +{ + return useLineWeights_raw(value); +} +}// namespace drawing +}// namespace adsk + +#undef ADSK_DRAWING_PDFEXPORTOPTIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Drawing/DrawingAll.h b/usr/autodesk/CPP/include/Drawing/DrawingAll.h new file mode 100644 index 0000000..d994119 --- /dev/null +++ b/usr/autodesk/CPP/include/Drawing/DrawingAll.h @@ -0,0 +1,6 @@ +#include +#include +#include +#include +#include +#include diff --git a/usr/autodesk/CPP/include/Drawing/DrawingTypeDefs.h b/usr/autodesk/CPP/include/Drawing/DrawingTypeDefs.h new file mode 100644 index 0000000..bcffe4f --- /dev/null +++ b/usr/autodesk/CPP/include/Drawing/DrawingTypeDefs.h @@ -0,0 +1,24 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once + +namespace adsk { namespace drawing { + +/// The various options that define which sheets to print. +enum PDFSheetsExport +{ + AllPDFSheetsExport, + SelectedPDFSheetsExport, + CurrentPDFSheetExport, + RangePDFSheetsExport +}; +}// namespace drawing +}// namespace adsk diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepBodies.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepBodies.h new file mode 100644 index 0000000..27afee2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepBodies.h @@ -0,0 +1,126 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPBODIES_CPP__ +# define ADSK_FUSION_BREPBODIES_API XI_EXPORT +# else +# define ADSK_FUSION_BREPBODIES_API +# endif +#else +# define ADSK_FUSION_BREPBODIES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepBody; +}} + +namespace adsk { namespace fusion { + +/// The BRepBodies collection provides access to all of the B-Rep +/// bodies within a component. +class BRepBodies : public core::Base { +public: + + /// Function that returns the specified body using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns a specific body using the name of the body within the collection. + /// name : The name of the body, as seen in the browser, to return. + /// The BRepBody or null if a body with the defined name is not found. + core::Ptr itemByName(const std::string& name) const; + + /// Returns the number of bodies in the collection. + size_t count() const; + + /// Creates a new BRepBody object. The input can be a persisted or transient BRepBody and the + /// result is a persisted BRepBody. In a model where the design history is ignored (direct edit model) + /// the BRepBody is created within the component the BRepBodies collection was obtained from. In + /// a model where the design history is captured (parametric model), the new BRepBody is created + /// within the specified Base Feature. + /// Because of a current limitation, if you want to create a BRepBody in a parametric model, + /// you must first call the edit method of the base feature, then use the add method to create + /// the body, and finally call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + /// body : The input BRepBody. Typically this is a transient BRepBody but that's not a requirement. In + /// any case, there is not any association back to the original BRepBody. + /// targetBaseFeature : The BaseFeature object that this B-Rep body will be associated with. This is an optional + /// requirement but is required when the model design history is being captured (parametric model) but is + /// ignored otherwise (direct edit model). + /// Returns the newly created BRepBody or null if the creation failed. + core::Ptr add(const core::Ptr& body, const core::Ptr& targetBaseFeature = NULL); + + typedef BRepBody iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPBODIES_API static const char* classType(); + ADSK_FUSION_BREPBODIES_API const char* objectType() const override; + ADSK_FUSION_BREPBODIES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPBODIES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepBody* item_raw(size_t index) const = 0; + virtual BRepBody* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual BRepBody* add_raw(BRepBody* body, BaseFeature* targetBaseFeature) = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepBodies::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr BRepBodies::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t BRepBodies::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr BRepBodies::add(const core::Ptr& body, const core::Ptr& targetBaseFeature) +{ + core::Ptr res = add_raw(body.get(), targetBaseFeature.get()); + return res; +} + +template inline void BRepBodies::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPBODIES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepBody.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepBody.h new file mode 100644 index 0000000..f683fd5 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepBody.h @@ -0,0 +1,681 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/CoreTypeDefs.h" +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPBODY_CPP__ +# define ADSK_FUSION_BREPBODY_API XI_EXPORT +# else +# define ADSK_FUSION_BREPBODY_API +# endif +#else +# define ADSK_FUSION_BREPBODY_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepEdges; + class BRepFaces; + class BRepLumps; + class BRepShells; + class BRepVertices; + class BRepWires; + class Component; + class MeshManager; + class Occurrence; + class PhysicalProperties; +}} +namespace adsk { namespace core { + class Appearance; + class Attributes; + class BoundingBox3D; + class Material; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// Represents a B-Rep (Boundary Representation) body. +class BRepBody : public core::Base { +public: + + /// Returns the component this body is owned by. + core::Ptr parentComponent() const; + + /// Returns a collection of all of the lumps in the body. + core::Ptr lumps() const; + + /// Returns a collection of all of the shells in the body. + core::Ptr shells() const; + + /// Returns a collection of all of the faces in the body. + core::Ptr faces() const; + + /// Returns a collection of all of the edges in the body. + core::Ptr edges() const; + + /// Returns a collection of all of the vertices in the body. + core::Ptr vertices() const; + + /// Returns whether this body is closed (solid) or not. + bool isSolid() const; + + /// Returns the bounding box of this body. + core::Ptr boundingBox() const; + + /// Returns all of the edges that connect concave faces. + core::Ptr concaveEdges() const; + + /// Returns all of the edges that connect convex faces. + core::Ptr convexEdges() const; + + /// Returns the area in cm ^ 2. + double area() const; + + /// Returns the volume in cm ^ 3. Returns 0 in the case the body is not solid. + double volume() const; + + /// Determines the relationship of the input point with respect to this body. + /// point : The point to do the containment check for. + /// Returns a value from the PointContainment enum indicating the relationship of + /// the input point to the body. + PointContainment pointContainment(const core::Ptr& point); + + /// Indicates if this body is represented in the model or is transient. + bool isTransient() const; + + /// Gets and sets the name of the body. + /// This property is only valid if the IsTransient property is false. + std::string name() const; + bool name(const std::string& value); + + /// Gets if this body is currently visible in the graphics window. Use the + /// isLightBulbOn to change if the light bulb beside the body node in the + /// browser is on or not. Parent nodes in the browser can have their light + /// bulb off which affects all of their children. This property indicates + /// the final result and whether this body is actually visible or not. + /// This property is only valid if the IsTransient property is false. + bool isVisible() const; + bool isVisible(bool value); + + /// Gets and sets if this body is selectable. + /// This property is only valid if the IsTransient property is false. + bool isSelectable() const; + bool isSelectable(bool value); + + /// Deletes the body. + /// This property is only valid if the IsTransient property is false. + /// Returns true if the delete was successful. + bool deleteMe(); + + /// Copies the body to the clipboard. + /// This property is only valid if the IsTransient property is false. + /// Returns true if the copy was successful. + bool copy(); + + /// Cuts the body to the clipboard. + /// This property is only valid if the IsTransient property is false. + /// Returns true if the cut was successful. + bool cut(); + + /// Read-write property that gets and sets the current appearance of the body. Setting this property will result in applying + /// an override appearance to the body and the AppearanceSourceType property will return OverrideAppearanceSource. Setting + /// this property to null will remove any override. + /// This property is only valid if the IsTransient property is false. + core::Ptr appearance() const; + bool appearance(const core::Ptr& value); + + /// Read-write property that gets the source of the appearance for the body. If this returns OverrideAppearanceSource, an override exists + /// on this body. The override can be removed by setting the Appearance property to null. + /// This property is only valid if the IsTransient property is false. + core::AppearanceSourceTypes appearanceSourceType() const; + + /// Gets and sets the material assigned to this body. + /// This property is only valid if the IsTransient property is false. + core::Ptr material() const; + bool material(const core::Ptr& value); + + /// Returns the mesh manager object for this body. + core::Ptr meshManager() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// BRepBody object is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. Also returns null in the case + /// where this body is transient. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// This method is only valid if the IsTransient property is false. + /// occurrence : The occurrence that defines the context for the created proxy. + /// Returns the new BRepBoy proxy or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Creates a new component and occurrence within the component that currently owns this body. + /// This body is moved into the new component and returned. The newly created component can be + /// obtained by using the parentComponent property of the BRepBody object. + /// This method is only valid if the IsTransient property is false. + /// Returns the BRrepBody in the new component or null in the case the creation failed. + core::Ptr createComponent(); + + /// Moves this body from it's current component into the root component or the component owned by the + /// specified occurrence. + /// target : The target can be either the root component or an occurrence. + /// In the case where an occurrence is specified, the body will be moved into the parent component of the target + /// occurrence and the target occurrence defines the transform of how the body will be copied so that the body + /// maintains it's same position with respect to the assembly. + /// Returns the moved BRepBody or null in the case the move failed. + core::Ptr moveToComponent(const core::Ptr& target); + + /// Creates a copy of this body into the specified target. + /// target : The target can be either the root component or an occurrence. + /// In the case where an occurrence is specified, the body will be copied into the parent component of the target + /// occurrence and the target occurrence defines the transform of how the body will be copied so that the body + /// maintains it's same position with respect to the assembly. + /// If target is null, then a copy of the body is created in the owning component of the original body. + /// Returns the moved BRepBody or null in the case the move failed. + core::Ptr copyToComponent(const core::Ptr& target); + + /// Returns the PhysicalProperties object that has properties for getting the area, density, mass, volume, moments, etc + /// of this body. Property values will be calculated using the 'LowCalculationAccuracy' setting when using this property + /// to get the PhysicalProperties object. To specify a higher calculation tolerance, use the getPhysicalProperties method + /// on the Design class instead. + core::Ptr physicalProperties() const; + + /// Gets and set if the light bulb beside the body node in the + /// browser is on or not. Parent nodes in the browser can have their light + /// bulb off which affects all of their children so this property does not + /// indicate if the body is actually visible, just that it should be visible + /// if all of it's parent nodes are also visible. Use the isVisible property + /// to determine if it's actually visible. + /// This property is only valid if the IsTransient property is false. + bool isLightBulbOn() const; + bool isLightBulbOn(bool value); + + /// Returns the collection of attributes associated with this face. + core::Ptr attributes() const; + + /// If this body is associated with a base feature, this property will return that base feature. + /// If it's not associated with a base feature, this property will return null. + core::Ptr baseFeature() const; + + /// Creates a new body where the faces and edges are converted to different + /// types of geometry based on the input options. This is particularly useful + /// when you need a body made up entirely of NURBS surfaces. + /// The tempId on the faces, edges, and vertices on the new body will match + /// with the corresponding tempId on the original body. In cases where faces are + /// split as a result of the conversion there can be more than one face or edge in + /// the new body that matches to a single face or edge in the original body. The + /// findByTempId method will find the entity with the matching id. + /// options : Input options that define how the conversion should be done. These are + /// bitwise options so they can be combined. + /// Returns the new converted body or null in the case of failure. + core::Ptr convert(BRepConvertOptions options); + + /// Returns all of the faces, edges, or vertices that match the input ID. + /// tempId : The ID of the B-Rep entity to find. + /// Returns an array of entities that have the specified ID. This + /// returns an array because it's possible that a body created by converting a + /// body can have multiple entities with the same ID in the case where a curve + /// or face was split. Returns an empty array in the case where no match is found. + std::vector> findByTempId(int tempId); + + /// Gets and sets the opacity override assigned to this body. A value of 1.0 specifies + /// that is it completely opaque and a value of 0.0 specifies that is it completely transparent. + /// This value is not necessarily related to what the user sees because the opacity is inherited. + /// For example, if you this body is in a component and that component's opacity is set to something + /// other than 1.0, the body will also be shown as slightly transparent even though the opacity + /// property for the body will return 1.0. Because the component that contains the body can be + /// referenced as an occurrence in other components and they can have different opacity settings, + /// it's possible that different instances of the same body can display using different opacity levels. + /// To get the opacity that it is being displayed with use the BrepBody.visibleOpacity property. + /// This is the API equivalent of the "Opacity Control" command available for the body in the browser. + double opacity() const; + bool opacity(double value); + + /// The user can set an override opacity for components and bodies these opacity overrides combine if + /// children and parent components have overrides. This property returns the actual opacity that is + /// being used to render the body. To set the opacity use the opacity property of the BRepBody object. + double visibleOpacity() const; + + /// Returns the current revision ID of the body. This ID changes any time the body is modified in any way. By getting + /// and saving the ID when you create any data that is dependent on the body, you can then compare the saved + /// ID with the current ID to determine if the body has changed to know if you should update your data. + std::string revisionId() const; + + /// Returns any wire bodies that exist within this body. + core::Ptr wires() const; + + /// Indicates if this body is represented in the model or is temporary. + bool isTemporary() const; + + /// Returns a token for the BRepBody object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same body. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + /// This is only valid for bodies that exist in the design, (the isTemporary + /// property is false). + std::string entityToken() const; + + /// Returns the PhysicalProperties object that has properties for getting the area, density, mass, volume, moments, etc + /// of this body. + /// accuracy : Specifies the desired level of computational accuracy of the property calculations. + /// The default value of 'LowCalculationAccuracy' returns results within a +/- 1% error margin. + core::Ptr getPhysicalProperties(CalculationAccuracy accuracy = adsk::fusion::LowCalculationAccuracy) const; + + ADSK_FUSION_BREPBODY_API static const char* classType(); + ADSK_FUSION_BREPBODY_API const char* objectType() const override; + ADSK_FUSION_BREPBODY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPBODY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Component* parentComponent_raw() const = 0; + virtual BRepLumps* lumps_raw() const = 0; + virtual BRepShells* shells_raw() const = 0; + virtual BRepFaces* faces_raw() const = 0; + virtual BRepEdges* edges_raw() const = 0; + virtual BRepVertices* vertices_raw() const = 0; + virtual bool isSolid_raw() const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual BRepEdges* concaveEdges_raw() const = 0; + virtual BRepEdges* convexEdges_raw() const = 0; + virtual double area_raw() const = 0; + virtual double volume_raw() const = 0; + virtual PointContainment pointContainment_raw(core::Point3D* point) = 0; + virtual bool isTransient_raw() const = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual bool isVisible_raw() const = 0; + virtual bool isVisible_raw(bool value) = 0; + virtual bool isSelectable_raw() const = 0; + virtual bool isSelectable_raw(bool value) = 0; + virtual bool deleteMe_raw() = 0; + virtual bool copy_raw() = 0; + virtual bool cut_raw() = 0; + virtual core::Appearance* appearance_raw() const = 0; + virtual bool appearance_raw(core::Appearance* value) = 0; + virtual core::AppearanceSourceTypes appearanceSourceType_raw() const = 0; + virtual core::Material* material_raw() const = 0; + virtual bool material_raw(core::Material* value) = 0; + virtual MeshManager* meshManager_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual BRepBody* nativeObject_raw() const = 0; + virtual BRepBody* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual BRepBody* createComponent_raw() = 0; + virtual BRepBody* moveToComponent_raw(core::Base* target) = 0; + virtual BRepBody* copyToComponent_raw(core::Base* target) = 0; + virtual PhysicalProperties* physicalProperties_raw() const = 0; + virtual bool isLightBulbOn_raw() const = 0; + virtual bool isLightBulbOn_raw(bool value) = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual BaseFeature* baseFeature_raw() const = 0; + virtual BRepBody* convert_raw(BRepConvertOptions options) = 0; + virtual core::Base** findByTempId_raw(int tempId, size_t& return_size) = 0; + virtual double opacity_raw() const = 0; + virtual bool opacity_raw(double value) = 0; + virtual double visibleOpacity_raw() const = 0; + virtual char* revisionId_raw() const = 0; + virtual BRepWires* wires_raw() const = 0; + virtual bool isTemporary_raw() const = 0; + virtual char* entityToken_raw() const = 0; + virtual PhysicalProperties* getPhysicalProperties_raw(CalculationAccuracy accuracy) const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepBody::parentComponent() const +{ + core::Ptr res = parentComponent_raw(); + return res; +} + +inline core::Ptr BRepBody::lumps() const +{ + core::Ptr res = lumps_raw(); + return res; +} + +inline core::Ptr BRepBody::shells() const +{ + core::Ptr res = shells_raw(); + return res; +} + +inline core::Ptr BRepBody::faces() const +{ + core::Ptr res = faces_raw(); + return res; +} + +inline core::Ptr BRepBody::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline core::Ptr BRepBody::vertices() const +{ + core::Ptr res = vertices_raw(); + return res; +} + +inline bool BRepBody::isSolid() const +{ + bool res = isSolid_raw(); + return res; +} + +inline core::Ptr BRepBody::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline core::Ptr BRepBody::concaveEdges() const +{ + core::Ptr res = concaveEdges_raw(); + return res; +} + +inline core::Ptr BRepBody::convexEdges() const +{ + core::Ptr res = convexEdges_raw(); + return res; +} + +inline double BRepBody::area() const +{ + double res = area_raw(); + return res; +} + +inline double BRepBody::volume() const +{ + double res = volume_raw(); + return res; +} + +inline PointContainment BRepBody::pointContainment(const core::Ptr& point) +{ + PointContainment res = pointContainment_raw(point.get()); + return res; +} + +inline bool BRepBody::isTransient() const +{ + bool res = isTransient_raw(); + return res; +} + +inline std::string BRepBody::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool BRepBody::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline bool BRepBody::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline bool BRepBody::isVisible(bool value) +{ + return isVisible_raw(value); +} + +inline bool BRepBody::isSelectable() const +{ + bool res = isSelectable_raw(); + return res; +} + +inline bool BRepBody::isSelectable(bool value) +{ + return isSelectable_raw(value); +} + +inline bool BRepBody::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline bool BRepBody::copy() +{ + bool res = copy_raw(); + return res; +} + +inline bool BRepBody::cut() +{ + bool res = cut_raw(); + return res; +} + +inline core::Ptr BRepBody::appearance() const +{ + core::Ptr res = appearance_raw(); + return res; +} + +inline bool BRepBody::appearance(const core::Ptr& value) +{ + return appearance_raw(value.get()); +} + +inline core::AppearanceSourceTypes BRepBody::appearanceSourceType() const +{ + core::AppearanceSourceTypes res = appearanceSourceType_raw(); + return res; +} + +inline core::Ptr BRepBody::material() const +{ + core::Ptr res = material_raw(); + return res; +} + +inline bool BRepBody::material(const core::Ptr& value) +{ + return material_raw(value.get()); +} + +inline core::Ptr BRepBody::meshManager() const +{ + core::Ptr res = meshManager_raw(); + return res; +} + +inline core::Ptr BRepBody::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr BRepBody::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BRepBody::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr BRepBody::createComponent() +{ + core::Ptr res = createComponent_raw(); + return res; +} + +inline core::Ptr BRepBody::moveToComponent(const core::Ptr& target) +{ + core::Ptr res = moveToComponent_raw(target.get()); + return res; +} + +inline core::Ptr BRepBody::copyToComponent(const core::Ptr& target) +{ + core::Ptr res = copyToComponent_raw(target.get()); + return res; +} + +inline core::Ptr BRepBody::physicalProperties() const +{ + core::Ptr res = physicalProperties_raw(); + return res; +} + +inline bool BRepBody::isLightBulbOn() const +{ + bool res = isLightBulbOn_raw(); + return res; +} + +inline bool BRepBody::isLightBulbOn(bool value) +{ + return isLightBulbOn_raw(value); +} + +inline core::Ptr BRepBody::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline core::Ptr BRepBody::baseFeature() const +{ + core::Ptr res = baseFeature_raw(); + return res; +} + +inline core::Ptr BRepBody::convert(BRepConvertOptions options) +{ + core::Ptr res = convert_raw(options); + return res; +} + +inline std::vector> BRepBody::findByTempId(int tempId) +{ + std::vector> res; + size_t s; + + core::Base** p= findByTempId_raw(tempId, s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline double BRepBody::opacity() const +{ + double res = opacity_raw(); + return res; +} + +inline bool BRepBody::opacity(double value) +{ + return opacity_raw(value); +} + +inline double BRepBody::visibleOpacity() const +{ + double res = visibleOpacity_raw(); + return res; +} + +inline std::string BRepBody::revisionId() const +{ + std::string res; + + char* p= revisionId_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr BRepBody::wires() const +{ + core::Ptr res = wires_raw(); + return res; +} + +inline bool BRepBody::isTemporary() const +{ + bool res = isTemporary_raw(); + return res; +} + +inline std::string BRepBody::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr BRepBody::getPhysicalProperties(CalculationAccuracy accuracy) const +{ + core::Ptr res = getPhysicalProperties_raw(accuracy); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPBODY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepBodyDefinition.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepBodyDefinition.h new file mode 100644 index 0000000..a311a18 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepBodyDefinition.h @@ -0,0 +1,187 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPBODYDEFINITION_CPP__ +# define ADSK_FUSION_BREPBODYDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_BREPBODYDEFINITION_API +# endif +#else +# define ADSK_FUSION_BREPBODYDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepEdgeDefinition; + class BRepLumpDefinitions; + class BRepVertexDefinition; +}} +namespace adsk { namespace core { + class Curve3D; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// This object is used to define a temporary B-Rep body. This includes solid, surface, and wire +/// bodies. The class supports the ability to define the geometry and topology of the B-Rep and +/// once the definition is complete, it supports the creation of a temporary BRepBody object. +class BRepBodyDefinition : public core::Base { +public: + + /// Static function that creates a new BRepBodyDefinition object. It's initially empty but you can use + /// the functionality it provides to define the geometry and topology of the B-Rep + /// object you want to create. + /// Returns the newly created BRepBodyDefinition object. + static core::Ptr create(); + + /// Attempts to create a temporary BRepBody object using the definition + /// provided by this BRepBodyDefinition object. Properties on this BRepBodyDefinition + /// are used to define some of the criteria that control how the body is created. + /// Returns the newly created BRepBody object if successful, otherwise null is returned. + /// Information about the body creation can be obtained by using the outcomeInfo property. + /// The outcome info is especially useful when initially writing and debugging your code to understand + /// why the creation of the body is failing. + core::Ptr createBody(); + + /// Specifies if full healing is done when creating the body. This defaults to true and it's highly recommended + /// that you do full healing because it can find and correct problems with the input. If you're sure that the + /// B-Rep definition that you've constructed is correct then you can set this to false to skip the full + /// healing process. + bool doFullHealing() const; + bool doFullHealing(bool value); + + /// Returns an array of strings that contain information about the outcome of the previous + /// call of the createBody method. This is especially useful when the createBody method fails, + /// (returns null), because it provides information about why the failure occurred. It can + /// also sometimes provide some information even when createBody succeeds. + /// Each string that's returned represents a single set of information and is packaged as JSON + /// such as '{"description":"vertex data is null or inconsistent with edge geometry","associativeID":"unknown","code":37}' + /// The description is an English description of the error or warning. The associativeID maps back to the + /// entity provided that is the cause of the problem. The ID is the associative ID you can optionally + /// assign to the entity definition. The code is an internal code for the error or warning. + /// An empty array is returned if createBody succeeded and there's no additional information. + std::vector outcomeInfo() const; + + /// Provides access to the BRepLumpDefinitions object associated with this BRepBodyDefinition. + /// It's through the returned collection that you can create new BRepLumpDefinition objects. + core::Ptr lumpDefinitions() const; + + /// Using a curve in model space it creates a new BRepEdgeDefinition object that's associated with the body. + /// startVertex : Vertex definition that defines the start of the edge. For a closed curve, like a circle, you still + /// need to provide a vertex on the curve but you should use the same BRepVertexDefinition for both the start and end vertices. + /// endVertex : Vertex definition that defines the end of the edge. For a closed curve, like a circle, this should be the + /// same vertex as used for the start vertex. + /// modelSpaceCurve : A Curve3D object that defines the shape of the edge using 3D geometry in model space. + /// Valid input is an Arc3D, NurbsCurve3D, Circle3D, Ellipse3D, EllipticalArc3D, or Line3D. + /// Returns the created BRepEdgeDefinition object or null in the case of failure. + core::Ptr createEdgeDefinitionByCurve(const core::Ptr& startVertex, const core::Ptr& endVertex, const core::Ptr& modelSpaceCurve); + + /// Creates a new BRepVertexDefinition object that's associated with the body. + /// position : Specifies the position of the vertex in model space. + /// Returns the created BRepVertexDefinition object or null in the case of failure. + core::Ptr createVertexDefinition(const core::Ptr& position); + + ADSK_FUSION_BREPBODYDEFINITION_API static const char* classType(); + ADSK_FUSION_BREPBODYDEFINITION_API const char* objectType() const override; + ADSK_FUSION_BREPBODYDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPBODYDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_BREPBODYDEFINITION_API static BRepBodyDefinition* create_raw(); + virtual BRepBody* createBody_raw() = 0; + virtual bool doFullHealing_raw() const = 0; + virtual bool doFullHealing_raw(bool value) = 0; + virtual char** outcomeInfo_raw(size_t& return_size) const = 0; + virtual BRepLumpDefinitions* lumpDefinitions_raw() const = 0; + virtual BRepEdgeDefinition* createEdgeDefinitionByCurve_raw(BRepVertexDefinition* startVertex, BRepVertexDefinition* endVertex, core::Curve3D* modelSpaceCurve) = 0; + virtual BRepVertexDefinition* createVertexDefinition_raw(core::Point3D* position) = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepBodyDefinition::create() +{ + core::Ptr res = create_raw(); + return res; +} + +inline core::Ptr BRepBodyDefinition::createBody() +{ + core::Ptr res = createBody_raw(); + return res; +} + +inline bool BRepBodyDefinition::doFullHealing() const +{ + bool res = doFullHealing_raw(); + return res; +} + +inline bool BRepBodyDefinition::doFullHealing(bool value) +{ + return doFullHealing_raw(value); +} + +inline std::vector BRepBodyDefinition::outcomeInfo() const +{ + std::vector res; + size_t s; + + char** p= outcomeInfo_raw(s); + if(p) + { + res.resize(s); + for(size_t i=0; i BRepBodyDefinition::lumpDefinitions() const +{ + core::Ptr res = lumpDefinitions_raw(); + return res; +} + +inline core::Ptr BRepBodyDefinition::createEdgeDefinitionByCurve(const core::Ptr& startVertex, const core::Ptr& endVertex, const core::Ptr& modelSpaceCurve) +{ + core::Ptr res = createEdgeDefinitionByCurve_raw(startVertex.get(), endVertex.get(), modelSpaceCurve.get()); + return res; +} + +inline core::Ptr BRepBodyDefinition::createVertexDefinition(const core::Ptr& position) +{ + core::Ptr res = createVertexDefinition_raw(position.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPBODYDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdge.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdge.h new file mode 100644 index 0000000..15853f4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdge.h @@ -0,0 +1,232 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPCOEDGE_CPP__ +# define ADSK_FUSION_BREPCOEDGE_API XI_EXPORT +# else +# define ADSK_FUSION_BREPCOEDGE_API +# endif +#else +# define ADSK_FUSION_BREPCOEDGE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepEdge; + class BRepLoop; + class Occurrence; +}} +namespace adsk { namespace core { + class Curve2D; + class CurveEvaluator2D; +}} + +namespace adsk { namespace fusion { + +/// Represents the use of a BRepEdge by a BRepFace. +class BRepCoEdge : public core::Base { +public: + + /// Returns the edge this co-edge is associated with. + core::Ptr edge() const; + + /// Returns the loop this co-edge is part of. + core::Ptr loop() const; + + /// Returns a curve evaluator that can be used to perform geometric evaluations on the co-edge. + core::Ptr evaluator() const; + + /// Returns a geometry object that represents the shape of this co-edge in parameter space of the parent face's surface. + core::Ptr geometry() const; + + /// Indicates if the orientation of this co-edge is in the same direction or opposed to its associated edge. + bool isOpposedToEdge() const; + + /// Returns if the parametric direction of this co-edge is reversed + /// from the parametric direction of the underlying curve obtained from the geometry property. + /// A co-edge's parametric direction is from the start vertex to the end vertex. + /// But the underlying curve geometry may have the opposite parameterization. + /// This property indicates if the parameterization order of the evaluator obtained from + /// this co-edge is reversed from the order of the geometry curve's evaluator. + bool isParamReversed() const; + + /// Returns the next co-edge in the loop. + core::Ptr next() const; + + /// Returns the body this co-edge is part of. + core::Ptr body() const; + + /// Returns the co-edge on the adjacent face + core::Ptr partner() const; + + /// Returns the previous co-edge in the loop. + core::Ptr previous() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// BRepCoEdge object is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context for the created proxy. + /// Returns the new BrepCoEdge proxy or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns a token for the BRepCoEdge object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same co-edge. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + /// This is only valid for co-edges that exist in the design, (the isTemporary + /// property is false). + std::string entityToken() const; + + ADSK_FUSION_BREPCOEDGE_API static const char* classType(); + ADSK_FUSION_BREPCOEDGE_API const char* objectType() const override; + ADSK_FUSION_BREPCOEDGE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPCOEDGE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepEdge* edge_raw() const = 0; + virtual BRepLoop* loop_raw() const = 0; + virtual core::CurveEvaluator2D* evaluator_raw() const = 0; + virtual core::Curve2D* geometry_raw() const = 0; + virtual bool isOpposedToEdge_raw() const = 0; + virtual bool isParamReversed_raw() const = 0; + virtual BRepCoEdge* next_raw() const = 0; + virtual BRepBody* body_raw() const = 0; + virtual BRepCoEdge* partner_raw() const = 0; + virtual BRepCoEdge* previous_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual BRepCoEdge* nativeObject_raw() const = 0; + virtual BRepCoEdge* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepCoEdge::edge() const +{ + core::Ptr res = edge_raw(); + return res; +} + +inline core::Ptr BRepCoEdge::loop() const +{ + core::Ptr res = loop_raw(); + return res; +} + +inline core::Ptr BRepCoEdge::evaluator() const +{ + core::Ptr res = evaluator_raw(); + return res; +} + +inline core::Ptr BRepCoEdge::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline bool BRepCoEdge::isOpposedToEdge() const +{ + bool res = isOpposedToEdge_raw(); + return res; +} + +inline bool BRepCoEdge::isParamReversed() const +{ + bool res = isParamReversed_raw(); + return res; +} + +inline core::Ptr BRepCoEdge::next() const +{ + core::Ptr res = next_raw(); + return res; +} + +inline core::Ptr BRepCoEdge::body() const +{ + core::Ptr res = body_raw(); + return res; +} + +inline core::Ptr BRepCoEdge::partner() const +{ + core::Ptr res = partner_raw(); + return res; +} + +inline core::Ptr BRepCoEdge::previous() const +{ + core::Ptr res = previous_raw(); + return res; +} + +inline core::Ptr BRepCoEdge::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr BRepCoEdge::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BRepCoEdge::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline std::string BRepCoEdge::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPCOEDGE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdgeDefinition.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdgeDefinition.h new file mode 100644 index 0000000..910dc48 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdgeDefinition.h @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPCOEDGEDEFINITION_CPP__ +# define ADSK_FUSION_BREPCOEDGEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_BREPCOEDGEDEFINITION_API +# endif +#else +# define ADSK_FUSION_BREPCOEDGEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepEdgeDefinition; +}} + +namespace adsk { namespace fusion { + +/// Represents the definition of a B-Rep co-edge that can be used as input to create a BRepBody that includes this co-edge. +class BRepCoEdgeDefinition : public core::Base { +public: + + /// Gets and sets the BRepEdgeDefinition object associated with this BrepCoEdgeDefinition object. + core::Ptr edgeDefinition() const; + bool edgeDefinition(const core::Ptr& value); + + /// Gets and sets if the orientation of this BRepCoEdgeDefinition object is reversed with + /// respect to the associated BRepEdgeDefinition object. + bool isOpposedToEdge() const; + bool isOpposedToEdge(bool value); + + ADSK_FUSION_BREPCOEDGEDEFINITION_API static const char* classType(); + ADSK_FUSION_BREPCOEDGEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_BREPCOEDGEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPCOEDGEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepEdgeDefinition* edgeDefinition_raw() const = 0; + virtual bool edgeDefinition_raw(BRepEdgeDefinition* value) = 0; + virtual bool isOpposedToEdge_raw() const = 0; + virtual bool isOpposedToEdge_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepCoEdgeDefinition::edgeDefinition() const +{ + core::Ptr res = edgeDefinition_raw(); + return res; +} + +inline bool BRepCoEdgeDefinition::edgeDefinition(const core::Ptr& value) +{ + return edgeDefinition_raw(value.get()); +} + +inline bool BRepCoEdgeDefinition::isOpposedToEdge() const +{ + bool res = isOpposedToEdge_raw(); + return res; +} + +inline bool BRepCoEdgeDefinition::isOpposedToEdge(bool value) +{ + return isOpposedToEdge_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPCOEDGEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdgeDefinitions.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdgeDefinitions.h new file mode 100644 index 0000000..97b4d8c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdgeDefinitions.h @@ -0,0 +1,103 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPCOEDGEDEFINITIONS_CPP__ +# define ADSK_FUSION_BREPCOEDGEDEFINITIONS_API XI_EXPORT +# else +# define ADSK_FUSION_BREPCOEDGEDEFINITIONS_API +# endif +#else +# define ADSK_FUSION_BREPCOEDGEDEFINITIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepCoEdgeDefinition; + class BRepEdgeDefinition; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the BRepCoEdgeDefinition objects associated with the parent BRepLoopDefinition object. +/// It's through this object that you create new BRepCoEdgeDefinition objects. +class BRepCoEdgeDefinitions : public core::Base { +public: + + /// Function that returns the specified BRepCoEdgeDefinition object using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of B-Rep co-edge definition objects in the collection. + size_t count() const; + + /// Creates a new BrepCoEdgeDefinition object associated with the parent BrepLoopDefinition object. + /// edgeDefinition : The BRepEdgeDefinition object this co-edge is related to. + /// isOpposedToEdge : Boolean that indicates if the orientation of this BRepCoEdgeDefinition is reversed with respect + /// to the associated BRepEdgeDefinition object. + /// Returns the newly created BrepCoEdgeDefinition object or null in the case of failure. + core::Ptr add(const core::Ptr& edgeDefinition, bool isOpposedToEdge); + + typedef BRepCoEdgeDefinition iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPCOEDGEDEFINITIONS_API static const char* classType(); + ADSK_FUSION_BREPCOEDGEDEFINITIONS_API const char* objectType() const override; + ADSK_FUSION_BREPCOEDGEDEFINITIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPCOEDGEDEFINITIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepCoEdgeDefinition* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual BRepCoEdgeDefinition* add_raw(BRepEdgeDefinition* edgeDefinition, bool isOpposedToEdge) = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepCoEdgeDefinitions::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepCoEdgeDefinitions::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr BRepCoEdgeDefinitions::add(const core::Ptr& edgeDefinition, bool isOpposedToEdge) +{ + core::Ptr res = add_raw(edgeDefinition.get(), isOpposedToEdge); + return res; +} + +template inline void BRepCoEdgeDefinitions::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPCOEDGEDEFINITIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdges.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdges.h new file mode 100644 index 0000000..ac3efff --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepCoEdges.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPCOEDGES_CPP__ +# define ADSK_FUSION_BREPCOEDGES_API XI_EXPORT +# else +# define ADSK_FUSION_BREPCOEDGES_API +# endif +#else +# define ADSK_FUSION_BREPCOEDGES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepCoEdge; +}} + +namespace adsk { namespace fusion { + +/// BRepCoEdge Collection. +class BRepCoEdges : public core::Base { +public: + + /// Function that returns the specified co-edge using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of co-edges in the collection. + size_t count() const; + + typedef BRepCoEdge iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPCOEDGES_API static const char* classType(); + ADSK_FUSION_BREPCOEDGES_API const char* objectType() const override; + ADSK_FUSION_BREPCOEDGES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPCOEDGES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepCoEdge* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepCoEdges::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepCoEdges::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void BRepCoEdges::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPCOEDGES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepEdge.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepEdge.h new file mode 100644 index 0000000..abea1d4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepEdge.h @@ -0,0 +1,326 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPEDGE_CPP__ +# define ADSK_FUSION_BREPEDGE_API XI_EXPORT +# else +# define ADSK_FUSION_BREPEDGE_API +# endif +#else +# define ADSK_FUSION_BREPEDGE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepCoEdges; + class BRepFaces; + class BRepShell; + class BRepVertex; + class Occurrence; +}} +namespace adsk { namespace core { + class Attributes; + class BoundingBox3D; + class Curve3D; + class CurveEvaluator3D; + class ObjectCollection; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// Represents a one-dimensional topological element that can be used to bound a BRepFace A BRepEdge uses a single, connected and bounded subset of a curve for it geometry. +class BRepEdge : public core::Base { +public: + + /// Returns the BRepVertex that bounds its low parameter end. + core::Ptr startVertex() const; + + /// Returns the BRepVertex that bounds its high parameter end. + core::Ptr endVertex() const; + + /// Returns the BRepFaces that are associated with this edge through its BRepCoEdges. + core::Ptr faces() const; + + /// Returns the parent shell of the edge. + core::Ptr shell() const; + + /// Returns the parent body of the edge. + core::Ptr body() const; + + /// Returns if the edge's geometry is degenerate. + /// For example, the apex of a cone is a degenerate edge. + bool isDegenerate() const; + + /// Returns CurveEvaluator3D for evaluation. + core::Ptr evaluator() const; + + /// Returns the underlying curve geometry of the edge. + core::Ptr geometry() const; + + /// Returns if the edge is tolerant. + /// The tolerance used is available from the tolerance property. + bool isTolerant() const; + + /// Returns the tolerance used by a tolerant edge. + /// This value is only useful when isTolerant is true. + double tolerance() const; + + /// Returns a sample point guaranteed to lie on the edge's curve, within its boundaries, + /// and not on a vertex (unless this is a degenerate edge). + core::Ptr pointOnEdge() const; + + /// Returns the BRepCoEdges on the edge. + core::Ptr coEdges() const; + + /// Returns if the parametric direction of this edge is reversed + /// from the parametric direction of the underlying curve obtained from the geometry property. + /// An edge's parametric direction is from the start vertex to the end vertex. + /// But the underlying curve geometry may have the opposite parameterization. + /// This property indicates if the parameterization order of the evaluator obtained from + /// this edge is reversed from the order of the geometry curve's evaluator. + bool isParamReversed() const; + + /// Returns a collection of edges that includes all of the edges tangentially connected + /// to this edge. The result includes this edge. The edges are in the collection + /// in their connected order. + core::Ptr tangentiallyConnectedEdges() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// BRepEdge object is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context for the created proxy. + /// Returns the new BrepEdge proxy or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the collection of attributes associated with this face. + core::Ptr attributes() const; + + /// Returns the length of the edge in centimeters. + double length() const; + + /// Returns the temporary ID of this edge. This ID is only good while the document + /// remains open and as long as the owning BRepBody is not modified in any way. + /// The findByTempId method of the BRepBody will return the entity in the body with the given ID. + int tempId() const; + + /// Returns the bounding box of this edge. + core::Ptr boundingBox() const; + + /// Returns a token for the BRepEdge object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same edge. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + /// This is only valid for edges that exist in the design, (the isTemporary + /// property is false). + std::string entityToken() const; + + ADSK_FUSION_BREPEDGE_API static const char* classType(); + ADSK_FUSION_BREPEDGE_API const char* objectType() const override; + ADSK_FUSION_BREPEDGE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPEDGE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepVertex* startVertex_raw() const = 0; + virtual BRepVertex* endVertex_raw() const = 0; + virtual BRepFaces* faces_raw() const = 0; + virtual BRepShell* shell_raw() const = 0; + virtual BRepBody* body_raw() const = 0; + virtual bool isDegenerate_raw() const = 0; + virtual core::CurveEvaluator3D* evaluator_raw() const = 0; + virtual core::Curve3D* geometry_raw() const = 0; + virtual bool isTolerant_raw() const = 0; + virtual double tolerance_raw() const = 0; + virtual core::Point3D* pointOnEdge_raw() const = 0; + virtual BRepCoEdges* coEdges_raw() const = 0; + virtual bool isParamReversed_raw() const = 0; + virtual core::ObjectCollection* tangentiallyConnectedEdges_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual BRepEdge* nativeObject_raw() const = 0; + virtual BRepEdge* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual double length_raw() const = 0; + virtual int tempId_raw() const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepEdge::startVertex() const +{ + core::Ptr res = startVertex_raw(); + return res; +} + +inline core::Ptr BRepEdge::endVertex() const +{ + core::Ptr res = endVertex_raw(); + return res; +} + +inline core::Ptr BRepEdge::faces() const +{ + core::Ptr res = faces_raw(); + return res; +} + +inline core::Ptr BRepEdge::shell() const +{ + core::Ptr res = shell_raw(); + return res; +} + +inline core::Ptr BRepEdge::body() const +{ + core::Ptr res = body_raw(); + return res; +} + +inline bool BRepEdge::isDegenerate() const +{ + bool res = isDegenerate_raw(); + return res; +} + +inline core::Ptr BRepEdge::evaluator() const +{ + core::Ptr res = evaluator_raw(); + return res; +} + +inline core::Ptr BRepEdge::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline bool BRepEdge::isTolerant() const +{ + bool res = isTolerant_raw(); + return res; +} + +inline double BRepEdge::tolerance() const +{ + double res = tolerance_raw(); + return res; +} + +inline core::Ptr BRepEdge::pointOnEdge() const +{ + core::Ptr res = pointOnEdge_raw(); + return res; +} + +inline core::Ptr BRepEdge::coEdges() const +{ + core::Ptr res = coEdges_raw(); + return res; +} + +inline bool BRepEdge::isParamReversed() const +{ + bool res = isParamReversed_raw(); + return res; +} + +inline core::Ptr BRepEdge::tangentiallyConnectedEdges() const +{ + core::Ptr res = tangentiallyConnectedEdges_raw(); + return res; +} + +inline core::Ptr BRepEdge::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr BRepEdge::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BRepEdge::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr BRepEdge::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline double BRepEdge::length() const +{ + double res = length_raw(); + return res; +} + +inline int BRepEdge::tempId() const +{ + int res = tempId_raw(); + return res; +} + +inline core::Ptr BRepEdge::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline std::string BRepEdge::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPEDGE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepEdgeDefinition.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepEdgeDefinition.h new file mode 100644 index 0000000..674b1a6 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepEdgeDefinition.h @@ -0,0 +1,149 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPEDGEDEFINITION_CPP__ +# define ADSK_FUSION_BREPEDGEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_BREPEDGEDEFINITION_API +# endif +#else +# define ADSK_FUSION_BREPEDGEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepVertexDefinition; +}} +namespace adsk { namespace core { + class Curve3D; +}} + +namespace adsk { namespace fusion { + +/// Represents the definition of a B-Rep edge that can be used as input to create a BRepBody. +class BRepEdgeDefinition : public core::Base { +public: + + /// Gets and sets the associate ID of this edge definition. This ID will be copied to the corresponding + /// edge when the BRepBodyDefinition is used to create a BrepBody. It is used internally by Fusion360 as + /// the identifier for the edge and is used for tracking this geometry for parametric recomputes. + int associativeID() const; + bool associativeID(int value); + + /// Gets and sets the start vertex of the edge definition. + core::Ptr startVertex() const; + bool startVertex(const core::Ptr& value); + + /// Gets and sets the end vertex of the edge definition. + core::Ptr endVertex() const; + bool endVertex(const core::Ptr& value); + + /// Gets and sets the curve that defines the shape of the edge. + core::Ptr modelSpaceCurve() const; + bool modelSpaceCurve(const core::Ptr& value); + + /// Gets and sets if the two faces that share this edge can be merged along this + /// edge. This property defaults to true so that merging is always done but this + /// can be set to false in cases where you want to preserve the edge. + /// An example where merging is typically done is when you have multiple planar + /// faces that all lie on the same plane and are connected. When merging is allowed + /// these faces can be replaced by a single face and the edges connecting the + /// faces (the merged edges) are no longer part of the body. + bool isMergeable() const; + bool isMergeable(bool value); + + ADSK_FUSION_BREPEDGEDEFINITION_API static const char* classType(); + ADSK_FUSION_BREPEDGEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_BREPEDGEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPEDGEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual int associativeID_raw() const = 0; + virtual bool associativeID_raw(int value) = 0; + virtual BRepVertexDefinition* startVertex_raw() const = 0; + virtual bool startVertex_raw(BRepVertexDefinition* value) = 0; + virtual BRepVertexDefinition* endVertex_raw() const = 0; + virtual bool endVertex_raw(BRepVertexDefinition* value) = 0; + virtual core::Curve3D* modelSpaceCurve_raw() const = 0; + virtual bool modelSpaceCurve_raw(core::Curve3D* value) = 0; + virtual bool isMergeable_raw() const = 0; + virtual bool isMergeable_raw(bool value) = 0; +}; + +// Inline wrappers + +inline int BRepEdgeDefinition::associativeID() const +{ + int res = associativeID_raw(); + return res; +} + +inline bool BRepEdgeDefinition::associativeID(int value) +{ + return associativeID_raw(value); +} + +inline core::Ptr BRepEdgeDefinition::startVertex() const +{ + core::Ptr res = startVertex_raw(); + return res; +} + +inline bool BRepEdgeDefinition::startVertex(const core::Ptr& value) +{ + return startVertex_raw(value.get()); +} + +inline core::Ptr BRepEdgeDefinition::endVertex() const +{ + core::Ptr res = endVertex_raw(); + return res; +} + +inline bool BRepEdgeDefinition::endVertex(const core::Ptr& value) +{ + return endVertex_raw(value.get()); +} + +inline core::Ptr BRepEdgeDefinition::modelSpaceCurve() const +{ + core::Ptr res = modelSpaceCurve_raw(); + return res; +} + +inline bool BRepEdgeDefinition::modelSpaceCurve(const core::Ptr& value) +{ + return modelSpaceCurve_raw(value.get()); +} + +inline bool BRepEdgeDefinition::isMergeable() const +{ + bool res = isMergeable_raw(); + return res; +} + +inline bool BRepEdgeDefinition::isMergeable(bool value) +{ + return isMergeable_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPEDGEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepEdges.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepEdges.h new file mode 100644 index 0000000..a8dcebc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepEdges.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPEDGES_CPP__ +# define ADSK_FUSION_BREPEDGES_API XI_EXPORT +# else +# define ADSK_FUSION_BREPEDGES_API +# endif +#else +# define ADSK_FUSION_BREPEDGES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepEdge; +}} + +namespace adsk { namespace fusion { + +/// BRepEdge collection. +class BRepEdges : public core::Base { +public: + + /// Function that returns the specified edge using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of edges in the collection. + size_t count() const; + + typedef BRepEdge iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPEDGES_API static const char* classType(); + ADSK_FUSION_BREPEDGES_API const char* objectType() const override; + ADSK_FUSION_BREPEDGES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPEDGES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepEdge* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepEdges::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepEdges::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void BRepEdges::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPEDGES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepFace.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepFace.h new file mode 100644 index 0000000..c076316 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepFace.h @@ -0,0 +1,351 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/CoreTypeDefs.h" +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPFACE_CPP__ +# define ADSK_FUSION_BREPFACE_API XI_EXPORT +# else +# define ADSK_FUSION_BREPFACE_API +# endif +#else +# define ADSK_FUSION_BREPFACE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepEdges; + class BRepFaces; + class BRepLoops; + class BRepShell; + class BRepVertices; + class MeshManager; + class Occurrence; +}} +namespace adsk { namespace core { + class Appearance; + class Attributes; + class BoundingBox3D; + class Point3D; + class Surface; + class SurfaceEvaluator; +}} + +namespace adsk { namespace fusion { + +/// Represent a connected region on a single geometric surface. +class BRepFace : public core::Base { +public: + + /// Returns the BRepEdges used by this face + core::Ptr edges() const; + + /// Returns the BRepVertices used by this face + core::Ptr vertices() const; + + /// Returns the parent shell of the face. + core::Ptr shell() const; + + /// Returns the BRepLoops owned by this face + core::Ptr loops() const; + + /// Returns the parent body of the face. + core::Ptr body() const; + + /// Returns the underlying surface geometry of this face + core::Ptr geometry() const; + + /// Returns a SurfaceEvaluator to allow geometric evaluations across the face's surface. + /// This evaluator differs from the evaluator available from the Surface obtained from the geometry + /// property by being bounded by the topological boundaries of this face. + core::Ptr evaluator() const; + + /// Returns a sample point guaranteed to lie on the face's surface, within the face's boundaries, and not on a boundary edge. + core::Ptr pointOnFace() const; + + /// Returns the set of faces that are tangentially adjacent to this face. + /// In other words, it is the set of faces that are adjacent to this face's edges + /// and have a smooth transition across those edges. + core::Ptr tangentiallyConnectedFaces() const; + + /// Returns a MeshManager object that allows access to existing and new meshes of this face. + core::Ptr meshManager() const; + + /// Read-write property that gets and sets the current appearance of the face. Setting this property will result in applying + /// an override appearance to the face and the AppearanceSourceType property will return OverrideAppearanceSource. Setting + /// this property to null will remove any override. + core::Ptr appearance() const; + bool appearance(const core::Ptr& value); + + /// Read-write property that gets the source of the appearance for the face. If this returns OverrideAppearanceSource, an override exists + /// on this face. The override can be removed by setting the Appearance property to null. + core::AppearanceSourceTypes appearanceSourceType() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// BRepFace object is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context for the created proxy. + /// Returns the new BRepFace proxy or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the area in cm ^ 2. + double area() const; + + /// Returns the bounding box of this face + core::Ptr boundingBox() const; + + /// Returns a point at the centroid (aka, geometric center) of the face. + core::Ptr centroid() const; + + /// Returns the collection of attributes associated with this face. + core::Ptr attributes() const; + + /// Returns the temporary ID of this face. This ID is only good while the document + /// remains open and as long as the owning BRepBody is not modified in any way. + /// The findByTempId method of the BRepBody will return the entity in the body with the given ID. + int tempId() const; + + /// Creates a new body where this face and its edges are converted to different + /// types of geometry based on the input options. + /// The tempId on the faces, edges, and vertices on the new body will match + /// with the corresponding tempId on the original body. In cases where the face is + /// split as a result of the conversion there can be more than one face or edge in + /// the new body that matches to a single face or edge in the original body. + /// options : Input options that define how the conversion should be done. These are + /// bitwise options so they can be combined. + /// Returns the new converted body or null in the case of failure. + core::Ptr convert(BRepConvertOptions options); + + /// Gets if the normal of this face is reversed with respect to the surface geometry associated + /// with this face. + bool isParamReversed() const; + + /// Returns a token for the BRepFace object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same face. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + /// This is only valid for faces that exist in the design, (the isTemporary + /// property is false). + std::string entityToken() const; + + ADSK_FUSION_BREPFACE_API static const char* classType(); + ADSK_FUSION_BREPFACE_API const char* objectType() const override; + ADSK_FUSION_BREPFACE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPFACE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepEdges* edges_raw() const = 0; + virtual BRepVertices* vertices_raw() const = 0; + virtual BRepShell* shell_raw() const = 0; + virtual BRepLoops* loops_raw() const = 0; + virtual BRepBody* body_raw() const = 0; + virtual core::Surface* geometry_raw() const = 0; + virtual core::SurfaceEvaluator* evaluator_raw() const = 0; + virtual core::Point3D* pointOnFace_raw() const = 0; + virtual BRepFaces* tangentiallyConnectedFaces_raw() const = 0; + virtual MeshManager* meshManager_raw() const = 0; + virtual core::Appearance* appearance_raw() const = 0; + virtual bool appearance_raw(core::Appearance* value) = 0; + virtual core::AppearanceSourceTypes appearanceSourceType_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual BRepFace* nativeObject_raw() const = 0; + virtual BRepFace* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual double area_raw() const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual core::Point3D* centroid_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual int tempId_raw() const = 0; + virtual BRepBody* convert_raw(BRepConvertOptions options) = 0; + virtual bool isParamReversed_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepFace::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline core::Ptr BRepFace::vertices() const +{ + core::Ptr res = vertices_raw(); + return res; +} + +inline core::Ptr BRepFace::shell() const +{ + core::Ptr res = shell_raw(); + return res; +} + +inline core::Ptr BRepFace::loops() const +{ + core::Ptr res = loops_raw(); + return res; +} + +inline core::Ptr BRepFace::body() const +{ + core::Ptr res = body_raw(); + return res; +} + +inline core::Ptr BRepFace::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr BRepFace::evaluator() const +{ + core::Ptr res = evaluator_raw(); + return res; +} + +inline core::Ptr BRepFace::pointOnFace() const +{ + core::Ptr res = pointOnFace_raw(); + return res; +} + +inline core::Ptr BRepFace::tangentiallyConnectedFaces() const +{ + core::Ptr res = tangentiallyConnectedFaces_raw(); + return res; +} + +inline core::Ptr BRepFace::meshManager() const +{ + core::Ptr res = meshManager_raw(); + return res; +} + +inline core::Ptr BRepFace::appearance() const +{ + core::Ptr res = appearance_raw(); + return res; +} + +inline bool BRepFace::appearance(const core::Ptr& value) +{ + return appearance_raw(value.get()); +} + +inline core::AppearanceSourceTypes BRepFace::appearanceSourceType() const +{ + core::AppearanceSourceTypes res = appearanceSourceType_raw(); + return res; +} + +inline core::Ptr BRepFace::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr BRepFace::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BRepFace::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline double BRepFace::area() const +{ + double res = area_raw(); + return res; +} + +inline core::Ptr BRepFace::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline core::Ptr BRepFace::centroid() const +{ + core::Ptr res = centroid_raw(); + return res; +} + +inline core::Ptr BRepFace::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline int BRepFace::tempId() const +{ + int res = tempId_raw(); + return res; +} + +inline core::Ptr BRepFace::convert(BRepConvertOptions options) +{ + core::Ptr res = convert_raw(options); + return res; +} + +inline bool BRepFace::isParamReversed() const +{ + bool res = isParamReversed_raw(); + return res; +} + +inline std::string BRepFace::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPFACE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepFaceDefinition.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepFaceDefinition.h new file mode 100644 index 0000000..0a288b3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepFaceDefinition.h @@ -0,0 +1,121 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPFACEDEFINITION_CPP__ +# define ADSK_FUSION_BREPFACEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_BREPFACEDEFINITION_API +# endif +#else +# define ADSK_FUSION_BREPFACEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepLoopDefinitions; +}} +namespace adsk { namespace core { + class Surface; +}} + +namespace adsk { namespace fusion { + +/// Represents the definition of a B-Rep face that can be used as input to create a BRepBody that includes this face. +class BRepFaceDefinition : public core::Base { +public: + + /// Gets and sets the associate ID of this face definition. This ID will be copied to the corresponding + /// face when the BRepBodyDefinition is used to create a BrepBody. It is used by Fusion360 as + /// the identifier for the face and is used for tracking this geometry for parametric recomputes. + int associativeID() const; + bool associativeID(int value); + + /// Provides access to the BRepLoopDefinitions object associated with this BRepFaceDefinition. + /// It's through the returned collection that you can create new BRepLoopDefinition objects. + core::Ptr loopDefinitions() const; + + /// Gets and sets the surface geometry associated with this face definition. + core::Ptr surfaceGeometry() const; + bool surfaceGeometry(const core::Ptr& value); + + /// Gets and sets if the normal of this face is reversed with respect to the surface geometry associated + /// with this face definition. + bool isParamReversed() const; + bool isParamReversed(bool value); + + ADSK_FUSION_BREPFACEDEFINITION_API static const char* classType(); + ADSK_FUSION_BREPFACEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_BREPFACEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPFACEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual int associativeID_raw() const = 0; + virtual bool associativeID_raw(int value) = 0; + virtual BRepLoopDefinitions* loopDefinitions_raw() const = 0; + virtual core::Surface* surfaceGeometry_raw() const = 0; + virtual bool surfaceGeometry_raw(core::Surface* value) = 0; + virtual bool isParamReversed_raw() const = 0; + virtual bool isParamReversed_raw(bool value) = 0; +}; + +// Inline wrappers + +inline int BRepFaceDefinition::associativeID() const +{ + int res = associativeID_raw(); + return res; +} + +inline bool BRepFaceDefinition::associativeID(int value) +{ + return associativeID_raw(value); +} + +inline core::Ptr BRepFaceDefinition::loopDefinitions() const +{ + core::Ptr res = loopDefinitions_raw(); + return res; +} + +inline core::Ptr BRepFaceDefinition::surfaceGeometry() const +{ + core::Ptr res = surfaceGeometry_raw(); + return res; +} + +inline bool BRepFaceDefinition::surfaceGeometry(const core::Ptr& value) +{ + return surfaceGeometry_raw(value.get()); +} + +inline bool BRepFaceDefinition::isParamReversed() const +{ + bool res = isParamReversed_raw(); + return res; +} + +inline bool BRepFaceDefinition::isParamReversed(bool value) +{ + return isParamReversed_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPFACEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepFaceDefinitions.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepFaceDefinitions.h new file mode 100644 index 0000000..aacc07a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepFaceDefinitions.h @@ -0,0 +1,106 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPFACEDEFINITIONS_CPP__ +# define ADSK_FUSION_BREPFACEDEFINITIONS_API XI_EXPORT +# else +# define ADSK_FUSION_BREPFACEDEFINITIONS_API +# endif +#else +# define ADSK_FUSION_BREPFACEDEFINITIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFaceDefinition; +}} +namespace adsk { namespace core { + class Surface; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the BRepFaceDefinition objects associated with the object the collection was obtained from. +/// It's through this object that you create new BRepFaceDefinition objects. +class BRepFaceDefinitions : public core::Base { +public: + + /// Function that returns the specified BRepFaceDefinition object using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of B-Rep face definition objects in the collection. + size_t count() const; + + /// Creates a new BrepFaceDefinition within the parent BRepShellDefinition object. + /// surfaceGeometry : Input surface object that defines the geometry of the face. Valid objects for input are + /// NurbsSurface, Cone, Cylinder, EllipticalCone, EllipticalCylinder, Plane, Sphere, and Torus. + /// isParamReversed : Input Boolean that indicates if the normal of this face is reversed with respect to the + /// surface geometry associated with this face definition. + /// Returns the newly created BRepFaceDefinition object or null in the case of failure. + core::Ptr add(const core::Ptr& surfaceGeometry, bool isParamReversed); + + typedef BRepFaceDefinition iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPFACEDEFINITIONS_API static const char* classType(); + ADSK_FUSION_BREPFACEDEFINITIONS_API const char* objectType() const override; + ADSK_FUSION_BREPFACEDEFINITIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPFACEDEFINITIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFaceDefinition* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual BRepFaceDefinition* add_raw(core::Surface* surfaceGeometry, bool isParamReversed) = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepFaceDefinitions::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepFaceDefinitions::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr BRepFaceDefinitions::add(const core::Ptr& surfaceGeometry, bool isParamReversed) +{ + core::Ptr res = add_raw(surfaceGeometry.get(), isParamReversed); + return res; +} + +template inline void BRepFaceDefinitions::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPFACEDEFINITIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepFaces.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepFaces.h new file mode 100644 index 0000000..cf1286a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepFaces.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPFACES_CPP__ +# define ADSK_FUSION_BREPFACES_API XI_EXPORT +# else +# define ADSK_FUSION_BREPFACES_API +# endif +#else +# define ADSK_FUSION_BREPFACES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; +}} + +namespace adsk { namespace fusion { + +/// BRepFace collection. +class BRepFaces : public core::Base { +public: + + /// Function that returns the specified face using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of faces in the collection. + size_t count() const; + + typedef BRepFace iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPFACES_API static const char* classType(); + ADSK_FUSION_BREPFACES_API const char* objectType() const override; + ADSK_FUSION_BREPFACES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPFACES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepFaces::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepFaces::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void BRepFaces::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPFACES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepLoop.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepLoop.h new file mode 100644 index 0000000..20983ea --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepLoop.h @@ -0,0 +1,187 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPLOOP_CPP__ +# define ADSK_FUSION_BREPLOOP_API XI_EXPORT +# else +# define ADSK_FUSION_BREPLOOP_API +# endif +#else +# define ADSK_FUSION_BREPLOOP_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepCoEdges; + class BRepEdges; + class BRepFace; + class Occurrence; +}} +namespace adsk { namespace core { + class BoundingBox3D; +}} + +namespace adsk { namespace fusion { + +/// Represents a connected portion of a BRepFace boundary. It consists of a chain of BRepCoEdges. +class BRepLoop : public core::Base { +public: + + /// Returns the BRepEdges used by this loop + core::Ptr edges() const; + + /// Returns the BRepCoEdges consisting this loop + core::Ptr coEdges() const; + + /// Returns true of this loop is an outer loop of a face + bool isOuter() const; + + /// Returns the bounding box of this loop + core::Ptr boundingBox() const; + + /// Returns the parent face of the loop. + core::Ptr face() const; + + /// Returns the parent body of the loop. + core::Ptr body() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// BRepLoop object is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context for the created proxy. + /// Returns the new BrepLoop proxy or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns a token for the BRepLoop object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same loop. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + /// This is only valid for loops that exist in the design, (the isTemporary + /// property is false). + std::string entityToken() const; + + ADSK_FUSION_BREPLOOP_API static const char* classType(); + ADSK_FUSION_BREPLOOP_API const char* objectType() const override; + ADSK_FUSION_BREPLOOP_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPLOOP_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepEdges* edges_raw() const = 0; + virtual BRepCoEdges* coEdges_raw() const = 0; + virtual bool isOuter_raw() const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual BRepFace* face_raw() const = 0; + virtual BRepBody* body_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual BRepLoop* nativeObject_raw() const = 0; + virtual BRepLoop* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepLoop::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline core::Ptr BRepLoop::coEdges() const +{ + core::Ptr res = coEdges_raw(); + return res; +} + +inline bool BRepLoop::isOuter() const +{ + bool res = isOuter_raw(); + return res; +} + +inline core::Ptr BRepLoop::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline core::Ptr BRepLoop::face() const +{ + core::Ptr res = face_raw(); + return res; +} + +inline core::Ptr BRepLoop::body() const +{ + core::Ptr res = body_raw(); + return res; +} + +inline core::Ptr BRepLoop::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr BRepLoop::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BRepLoop::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline std::string BRepLoop::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPLOOP_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepLoopDefinition.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepLoopDefinition.h new file mode 100644 index 0000000..6845900 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepLoopDefinition.h @@ -0,0 +1,64 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPLOOPDEFINITION_CPP__ +# define ADSK_FUSION_BREPLOOPDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_BREPLOOPDEFINITION_API +# endif +#else +# define ADSK_FUSION_BREPLOOPDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepCoEdgeDefinitions; +}} + +namespace adsk { namespace fusion { + +/// Represents the definition of a B-Rep loop that can be used as input to create a BRepBody that includes this loop. +class BRepLoopDefinition : public core::Base { +public: + + /// Provides access to the BRepCoEdgeDefinitions object associated with the parent BRepFaceDefinition object. + /// It's through the returned collection that you can create new BRepCoEdgeDefinition objects. + core::Ptr bRepCoEdgeDefinitions() const; + + ADSK_FUSION_BREPLOOPDEFINITION_API static const char* classType(); + ADSK_FUSION_BREPLOOPDEFINITION_API const char* objectType() const override; + ADSK_FUSION_BREPLOOPDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPLOOPDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepCoEdgeDefinitions* bRepCoEdgeDefinitions_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepLoopDefinition::bRepCoEdgeDefinitions() const +{ + core::Ptr res = bRepCoEdgeDefinitions_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPLOOPDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepLoopDefinitions.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepLoopDefinitions.h new file mode 100644 index 0000000..ee9dc03 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepLoopDefinitions.h @@ -0,0 +1,99 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPLOOPDEFINITIONS_CPP__ +# define ADSK_FUSION_BREPLOOPDEFINITIONS_API XI_EXPORT +# else +# define ADSK_FUSION_BREPLOOPDEFINITIONS_API +# endif +#else +# define ADSK_FUSION_BREPLOOPDEFINITIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepLoopDefinition; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the BRepLoopDefinition objects associated with the parent BRepFaceDefinition object. +/// It's through this object that you create new BRepLoopDefinition objects. +class BRepLoopDefinitions : public core::Base { +public: + + /// Function that returns the specified BRepLoopDefinition object using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of B-Rep loop definition objects in the collection. + size_t count() const; + + /// Creates a new empty loop associated with the parent face definition. + /// Returns the newly created BRepLoopDefinition object. + core::Ptr add(); + + typedef BRepLoopDefinition iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPLOOPDEFINITIONS_API static const char* classType(); + ADSK_FUSION_BREPLOOPDEFINITIONS_API const char* objectType() const override; + ADSK_FUSION_BREPLOOPDEFINITIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPLOOPDEFINITIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepLoopDefinition* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual BRepLoopDefinition* add_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepLoopDefinitions::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepLoopDefinitions::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr BRepLoopDefinitions::add() +{ + core::Ptr res = add_raw(); + return res; +} + +template inline void BRepLoopDefinitions::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPLOOPDEFINITIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepLoops.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepLoops.h new file mode 100644 index 0000000..170becc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepLoops.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPLOOPS_CPP__ +# define ADSK_FUSION_BREPLOOPS_API XI_EXPORT +# else +# define ADSK_FUSION_BREPLOOPS_API +# endif +#else +# define ADSK_FUSION_BREPLOOPS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepLoop; +}} + +namespace adsk { namespace fusion { + +/// BRepLoop collection. +class BRepLoops : public core::Base { +public: + + /// Function that returns the specified loop using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of loops in the collection. + size_t count() const; + + typedef BRepLoop iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPLOOPS_API static const char* classType(); + ADSK_FUSION_BREPLOOPS_API const char* objectType() const override; + ADSK_FUSION_BREPLOOPS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPLOOPS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepLoop* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepLoops::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepLoops::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void BRepLoops::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPLOOPS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepLump.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepLump.h new file mode 100644 index 0000000..4c375ed --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepLump.h @@ -0,0 +1,243 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPLUMP_CPP__ +# define ADSK_FUSION_BREPLUMP_API XI_EXPORT +# else +# define ADSK_FUSION_BREPLUMP_API +# endif +#else +# define ADSK_FUSION_BREPLUMP_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepEdges; + class BRepFaces; + class BRepShells; + class BRepVertices; + class MeshManager; + class Occurrence; +}} +namespace adsk { namespace core { + class BoundingBox3D; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// Represents an entirely connected set of entities. A BRepBody consists of BRepLumps. +class BRepLump : public core::Base { +public: + + /// Returns the BRepShells owned by the lump + core::Ptr shells() const; + + /// Returns the BRepFaces owned by the lump + core::Ptr faces() const; + + /// Returns the BRepEdges owned by the lump + core::Ptr edges() const; + + /// Returns the BRepVertices owned by the lump + core::Ptr vertices() const; + + /// Returns the immediate owner BRepBody of the lump + core::Ptr body() const; + + /// Returns true of the lump is closed + bool isClosed() const; + + /// Returns the bounding box of the lump + core::Ptr boundingBox() const; + + /// Returns the area in cm ^ 2. + double area() const; + + /// Returns the volume in cm ^ 3. Returns 0 in the case the lump is not solid. + double volume() const; + + /// Determines the relationship of the input point with respect to this lump. + /// point : The point to do the containment check for. + /// Returns a value from the PointContainment enum indicating the relationship of + /// the input point to the lump. + PointContainment pointContainment(const core::Ptr& point); + + /// Returns the mesh manager object for this lump. + core::Ptr meshManager() const; + + /// Returns the assembly context that is directly referencing this + /// object in an assembly. This is only valid in the case where this + /// BRepLump object is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context for the created proxy. + /// Returns the new BrepLump proxy or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns a token for the BRepLump object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same lump. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + /// This is only valid for lump that exist in the design, (the isTemporary + /// property is false). + std::string entityToken() const; + + ADSK_FUSION_BREPLUMP_API static const char* classType(); + ADSK_FUSION_BREPLUMP_API const char* objectType() const override; + ADSK_FUSION_BREPLUMP_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPLUMP_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepShells* shells_raw() const = 0; + virtual BRepFaces* faces_raw() const = 0; + virtual BRepEdges* edges_raw() const = 0; + virtual BRepVertices* vertices_raw() const = 0; + virtual BRepBody* body_raw() const = 0; + virtual bool isClosed_raw() const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual double area_raw() const = 0; + virtual double volume_raw() const = 0; + virtual PointContainment pointContainment_raw(core::Point3D* point) = 0; + virtual MeshManager* meshManager_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual BRepLump* nativeObject_raw() const = 0; + virtual BRepLump* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepLump::shells() const +{ + core::Ptr res = shells_raw(); + return res; +} + +inline core::Ptr BRepLump::faces() const +{ + core::Ptr res = faces_raw(); + return res; +} + +inline core::Ptr BRepLump::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline core::Ptr BRepLump::vertices() const +{ + core::Ptr res = vertices_raw(); + return res; +} + +inline core::Ptr BRepLump::body() const +{ + core::Ptr res = body_raw(); + return res; +} + +inline bool BRepLump::isClosed() const +{ + bool res = isClosed_raw(); + return res; +} + +inline core::Ptr BRepLump::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline double BRepLump::area() const +{ + double res = area_raw(); + return res; +} + +inline double BRepLump::volume() const +{ + double res = volume_raw(); + return res; +} + +inline PointContainment BRepLump::pointContainment(const core::Ptr& point) +{ + PointContainment res = pointContainment_raw(point.get()); + return res; +} + +inline core::Ptr BRepLump::meshManager() const +{ + core::Ptr res = meshManager_raw(); + return res; +} + +inline core::Ptr BRepLump::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr BRepLump::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BRepLump::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline std::string BRepLump::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPLUMP_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepLumpDefinition.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepLumpDefinition.h new file mode 100644 index 0000000..c68dc7f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepLumpDefinition.h @@ -0,0 +1,64 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPLUMPDEFINITION_CPP__ +# define ADSK_FUSION_BREPLUMPDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_BREPLUMPDEFINITION_API +# endif +#else +# define ADSK_FUSION_BREPLUMPDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepShellDefinitions; +}} + +namespace adsk { namespace fusion { + +/// Represents the definition of a B-Rep lump which is used in defining the topology of a B-Rep body. +class BRepLumpDefinition : public core::Base { +public: + + /// Provides access to the BRepShellDefinitions object associated with this BRepLumpDefinition. + /// It's through the returned collection that you can create new BRepShellDefinition objects. + core::Ptr shellDefinitions() const; + + ADSK_FUSION_BREPLUMPDEFINITION_API static const char* classType(); + ADSK_FUSION_BREPLUMPDEFINITION_API const char* objectType() const override; + ADSK_FUSION_BREPLUMPDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPLUMPDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepShellDefinitions* shellDefinitions_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepLumpDefinition::shellDefinitions() const +{ + core::Ptr res = shellDefinitions_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPLUMPDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepLumpDefinitions.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepLumpDefinitions.h new file mode 100644 index 0000000..72f9499 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepLumpDefinitions.h @@ -0,0 +1,99 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPLUMPDEFINITIONS_CPP__ +# define ADSK_FUSION_BREPLUMPDEFINITIONS_API XI_EXPORT +# else +# define ADSK_FUSION_BREPLUMPDEFINITIONS_API +# endif +#else +# define ADSK_FUSION_BREPLUMPDEFINITIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepLumpDefinition; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the BRepLumpDefinition objects associated with the BRepBodyDefinition +/// and it's through this object that you create new BRepLumpDefinition objects. +class BRepLumpDefinitions : public core::Base { +public: + + /// Function that returns the specified BRepLumpDefinition object using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of B-Rep lump definition objects in the collection. + size_t count() const; + + /// Creates a new empty BRepLumpDefinition associated with the parent BRepBodyDefinition object. + /// Returns the newly created BRepLumpDefinition object. + core::Ptr add(); + + typedef BRepLumpDefinition iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPLUMPDEFINITIONS_API static const char* classType(); + ADSK_FUSION_BREPLUMPDEFINITIONS_API const char* objectType() const override; + ADSK_FUSION_BREPLUMPDEFINITIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPLUMPDEFINITIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepLumpDefinition* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual BRepLumpDefinition* add_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepLumpDefinitions::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepLumpDefinitions::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr BRepLumpDefinitions::add() +{ + core::Ptr res = add_raw(); + return res; +} + +template inline void BRepLumpDefinitions::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPLUMPDEFINITIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepLumps.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepLumps.h new file mode 100644 index 0000000..957866a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepLumps.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPLUMPS_CPP__ +# define ADSK_FUSION_BREPLUMPS_API XI_EXPORT +# else +# define ADSK_FUSION_BREPLUMPS_API +# endif +#else +# define ADSK_FUSION_BREPLUMPS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepLump; +}} + +namespace adsk { namespace fusion { + +/// BRepLump collection. +class BRepLumps : public core::Base { +public: + + /// Function that returns the specified lump using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of lumps in the collection. + size_t count() const; + + typedef BRepLump iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPLUMPS_API static const char* classType(); + ADSK_FUSION_BREPLUMPS_API const char* objectType() const override; + ADSK_FUSION_BREPLUMPS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPLUMPS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepLump* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepLumps::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepLumps::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void BRepLumps::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPLUMPS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepShell.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepShell.h new file mode 100644 index 0000000..16ab5ff --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepShell.h @@ -0,0 +1,265 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPSHELL_CPP__ +# define ADSK_FUSION_BREPSHELL_API XI_EXPORT +# else +# define ADSK_FUSION_BREPSHELL_API +# endif +#else +# define ADSK_FUSION_BREPSHELL_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepEdges; + class BRepFaces; + class BRepLump; + class BRepVertices; + class BRepWire; + class MeshManager; + class Occurrence; +}} +namespace adsk { namespace core { + class BoundingBox3D; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// Represents an entirely connected set of BRepFaces. A BRepLump may contain multiple BRepShells. +class BRepShell : public core::Base { +public: + + /// Returns the BRepFaces directly owned by this shell + core::Ptr faces() const; + + /// returns the BRepEdges owned by this shell + core::Ptr edges() const; + + /// Returns the BRepVertices owned by this shell + core::Ptr vertices() const; + + /// Returns the parent lump of this shell. + core::Ptr lump() const; + + /// Returns the parent body of the shell. + core::Ptr body() const; + + /// Returns the bounding box of this shell + core::Ptr boundingBox() const; + + /// Determines the relationship of the input point with respect to this shell. + /// point : The point to do the containment check for. + /// Returns a value from the PointContainment enum indicating the relationship of + /// the input point to the shell. + PointContainment pointContainment(const core::Ptr& point); + + /// Returns true if this shell is closed + bool isClosed() const; + + /// Returns true if the faces of this shell bound a void or an empty space within an outer shell. + bool isVoid() const; + + /// Returns the area in cm ^ 2. + double area() const; + + /// Returns the volume in cm ^ 3. Returns 0 in the case the shell is not solid. + double volume() const; + + /// Returns the mesh manager object for this shell. + core::Ptr meshManager() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// BRepShell object is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context for the created proxy. + /// Returns the new BrepShell proxy or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the wire body, if any, that exists in this shell. Returns null if the + /// shell doesn't have a wire body. + core::Ptr wire() const; + + /// Returns a token for the BRepShell object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same shell. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + /// This is only valid for shells that exist in the design, (the isTemporary + /// property is false). + std::string entityToken() const; + + ADSK_FUSION_BREPSHELL_API static const char* classType(); + ADSK_FUSION_BREPSHELL_API const char* objectType() const override; + ADSK_FUSION_BREPSHELL_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPSHELL_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFaces* faces_raw() const = 0; + virtual BRepEdges* edges_raw() const = 0; + virtual BRepVertices* vertices_raw() const = 0; + virtual BRepLump* lump_raw() const = 0; + virtual BRepBody* body_raw() const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual PointContainment pointContainment_raw(core::Point3D* point) = 0; + virtual bool isClosed_raw() const = 0; + virtual bool isVoid_raw() const = 0; + virtual double area_raw() const = 0; + virtual double volume_raw() const = 0; + virtual MeshManager* meshManager_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual BRepShell* nativeObject_raw() const = 0; + virtual BRepShell* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual BRepWire* wire_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepShell::faces() const +{ + core::Ptr res = faces_raw(); + return res; +} + +inline core::Ptr BRepShell::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline core::Ptr BRepShell::vertices() const +{ + core::Ptr res = vertices_raw(); + return res; +} + +inline core::Ptr BRepShell::lump() const +{ + core::Ptr res = lump_raw(); + return res; +} + +inline core::Ptr BRepShell::body() const +{ + core::Ptr res = body_raw(); + return res; +} + +inline core::Ptr BRepShell::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline PointContainment BRepShell::pointContainment(const core::Ptr& point) +{ + PointContainment res = pointContainment_raw(point.get()); + return res; +} + +inline bool BRepShell::isClosed() const +{ + bool res = isClosed_raw(); + return res; +} + +inline bool BRepShell::isVoid() const +{ + bool res = isVoid_raw(); + return res; +} + +inline double BRepShell::area() const +{ + double res = area_raw(); + return res; +} + +inline double BRepShell::volume() const +{ + double res = volume_raw(); + return res; +} + +inline core::Ptr BRepShell::meshManager() const +{ + core::Ptr res = meshManager_raw(); + return res; +} + +inline core::Ptr BRepShell::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr BRepShell::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BRepShell::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr BRepShell::wire() const +{ + core::Ptr res = wire_raw(); + return res; +} + +inline std::string BRepShell::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPSHELL_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepShellDefinition.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepShellDefinition.h new file mode 100644 index 0000000..0cdbae8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepShellDefinition.h @@ -0,0 +1,75 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPSHELLDEFINITION_CPP__ +# define ADSK_FUSION_BREPSHELLDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_BREPSHELLDEFINITION_API +# endif +#else +# define ADSK_FUSION_BREPSHELLDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFaceDefinitions; + class BRepWireDefinition; +}} + +namespace adsk { namespace fusion { + +/// Represents the definition of a B-Rep shell that can be used as input to create a BRepBody that includes this shell. +class BRepShellDefinition : public core::Base { +public: + + /// Provides access to the BRepFaceDefinitions object associated with this BRepShellDefinition. + /// It's through the returned collection that you can create new BRepFaceDefinition objects. + core::Ptr faceDefinitions() const; + + /// Returns the single BRepWireDefinition associated with this shell definition. + core::Ptr wireDefinition() const; + + ADSK_FUSION_BREPSHELLDEFINITION_API static const char* classType(); + ADSK_FUSION_BREPSHELLDEFINITION_API const char* objectType() const override; + ADSK_FUSION_BREPSHELLDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPSHELLDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFaceDefinitions* faceDefinitions_raw() const = 0; + virtual BRepWireDefinition* wireDefinition_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepShellDefinition::faceDefinitions() const +{ + core::Ptr res = faceDefinitions_raw(); + return res; +} + +inline core::Ptr BRepShellDefinition::wireDefinition() const +{ + core::Ptr res = wireDefinition_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPSHELLDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepShellDefinitions.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepShellDefinitions.h new file mode 100644 index 0000000..24f0f06 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepShellDefinitions.h @@ -0,0 +1,99 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPSHELLDEFINITIONS_CPP__ +# define ADSK_FUSION_BREPSHELLDEFINITIONS_API XI_EXPORT +# else +# define ADSK_FUSION_BREPSHELLDEFINITIONS_API +# endif +#else +# define ADSK_FUSION_BREPSHELLDEFINITIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepShellDefinition; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the BRepShellDefinition objects associated with the object the collection was obtained from. +/// It's through this object that you create new BRepShellDefinition objects. +class BRepShellDefinitions : public core::Base { +public: + + /// Function that returns the specified BRepShellDefinition object using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of B-Rep shell definition objects in the collection. + size_t count() const; + + /// Creates a new empty BRepShellDefinition object associated with the parent BRepLumpDefinition. + /// Returns the newly created BRepShellDefinition object. + core::Ptr add(); + + typedef BRepShellDefinition iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPSHELLDEFINITIONS_API static const char* classType(); + ADSK_FUSION_BREPSHELLDEFINITIONS_API const char* objectType() const override; + ADSK_FUSION_BREPSHELLDEFINITIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPSHELLDEFINITIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepShellDefinition* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual BRepShellDefinition* add_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepShellDefinitions::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepShellDefinitions::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr BRepShellDefinitions::add() +{ + core::Ptr res = add_raw(); + return res; +} + +template inline void BRepShellDefinitions::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPSHELLDEFINITIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepShells.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepShells.h new file mode 100644 index 0000000..67f37cc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepShells.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPSHELLS_CPP__ +# define ADSK_FUSION_BREPSHELLS_API XI_EXPORT +# else +# define ADSK_FUSION_BREPSHELLS_API +# endif +#else +# define ADSK_FUSION_BREPSHELLS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepShell; +}} + +namespace adsk { namespace fusion { + +/// BRepShell collection. +class BRepShells : public core::Base { +public: + + /// Function that returns the specified shell using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of shells in the collection. + size_t count() const; + + typedef BRepShell iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPSHELLS_API static const char* classType(); + ADSK_FUSION_BREPSHELLS_API const char* objectType() const override; + ADSK_FUSION_BREPSHELLS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPSHELLS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepShell* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepShells::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepShells::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void BRepShells::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPSHELLS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepVertex.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepVertex.h new file mode 100644 index 0000000..880d9e2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepVertex.h @@ -0,0 +1,222 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPVERTEX_CPP__ +# define ADSK_FUSION_BREPVERTEX_API XI_EXPORT +# else +# define ADSK_FUSION_BREPVERTEX_API +# endif +#else +# define ADSK_FUSION_BREPVERTEX_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepEdges; + class BRepFaces; + class BRepShell; + class Occurrence; +}} +namespace adsk { namespace core { + class Attributes; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// A 0-dimensional topological entity that bounds a BRepEdge. +class BRepVertex : public core::Base { +public: + + /// Returns the BRepFaces that uses this vertex through BRepEdge + core::Ptr faces() const; + + /// Returns the BRepEdges bounded by this vertex + core::Ptr edges() const; + + /// Returns if the vertex is tolerant. + /// The tolerance used is available from the tolerance property. + bool isTolerant() const; + + /// Returns the tolerance used by a tolerant vertex. + /// This value is only useful when isTolerant is true. + double tolerance() const; + + /// Returns the underlying geometry point + core::Ptr geometry() const; + + /// Returns the parent shell. + core::Ptr shell() const; + + /// Returns the parent body. + core::Ptr body() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// BRepVertex object is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context for the created proxy. + /// Returns the new BrepVertex proxy or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the collection of attributes associated with this face. + core::Ptr attributes() const; + + /// Returns the temporary ID of this vertex. This ID is only good while the document + /// remains open and as long as the owning BRepBody is not modified in any way. + /// The findByTempId method of the BRepBody will return the entity in the body with the given ID. + int tempId() const; + + /// Returns a token for the BRepVertex object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same vertex. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + /// This is only valid for vertices that exist in the design, (the isTemporary + /// property is false). + std::string entityToken() const; + + ADSK_FUSION_BREPVERTEX_API static const char* classType(); + ADSK_FUSION_BREPVERTEX_API const char* objectType() const override; + ADSK_FUSION_BREPVERTEX_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPVERTEX_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFaces* faces_raw() const = 0; + virtual BRepEdges* edges_raw() const = 0; + virtual bool isTolerant_raw() const = 0; + virtual double tolerance_raw() const = 0; + virtual core::Point3D* geometry_raw() const = 0; + virtual BRepShell* shell_raw() const = 0; + virtual BRepBody* body_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual BRepVertex* nativeObject_raw() const = 0; + virtual BRepVertex* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual int tempId_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepVertex::faces() const +{ + core::Ptr res = faces_raw(); + return res; +} + +inline core::Ptr BRepVertex::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline bool BRepVertex::isTolerant() const +{ + bool res = isTolerant_raw(); + return res; +} + +inline double BRepVertex::tolerance() const +{ + double res = tolerance_raw(); + return res; +} + +inline core::Ptr BRepVertex::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr BRepVertex::shell() const +{ + core::Ptr res = shell_raw(); + return res; +} + +inline core::Ptr BRepVertex::body() const +{ + core::Ptr res = body_raw(); + return res; +} + +inline core::Ptr BRepVertex::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr BRepVertex::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BRepVertex::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr BRepVertex::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline int BRepVertex::tempId() const +{ + int res = tempId_raw(); + return res; +} + +inline std::string BRepVertex::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPVERTEX_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepVertexDefinition.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepVertexDefinition.h new file mode 100644 index 0000000..45c4a15 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepVertexDefinition.h @@ -0,0 +1,70 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPVERTEXDEFINITION_CPP__ +# define ADSK_FUSION_BREPVERTEXDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_BREPVERTEXDEFINITION_API +# endif +#else +# define ADSK_FUSION_BREPVERTEXDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// Represents the definition of a B-Rep vertex that can be used as input to create a BRepBody that includes this vertex. +class BRepVertexDefinition : public core::Base { +public: + + /// Gets and sets the position of the vertex in model space. + core::Ptr position() const; + bool position(const core::Ptr& value); + + ADSK_FUSION_BREPVERTEXDEFINITION_API static const char* classType(); + ADSK_FUSION_BREPVERTEXDEFINITION_API const char* objectType() const override; + ADSK_FUSION_BREPVERTEXDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPVERTEXDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Point3D* position_raw() const = 0; + virtual bool position_raw(core::Point3D* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepVertexDefinition::position() const +{ + core::Ptr res = position_raw(); + return res; +} + +inline bool BRepVertexDefinition::position(const core::Ptr& value) +{ + return position_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPVERTEXDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepVertices.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepVertices.h new file mode 100644 index 0000000..4f2708e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepVertices.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPVERTICES_CPP__ +# define ADSK_FUSION_BREPVERTICES_API XI_EXPORT +# else +# define ADSK_FUSION_BREPVERTICES_API +# endif +#else +# define ADSK_FUSION_BREPVERTICES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepVertex; +}} + +namespace adsk { namespace fusion { + +/// BRepVertex collection. +class BRepVertices : public core::Base { +public: + + /// Function that returns the specified vertex using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of vertices in the collection. + size_t count() const; + + typedef BRepVertex iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPVERTICES_API static const char* classType(); + ADSK_FUSION_BREPVERTICES_API const char* objectType() const override; + ADSK_FUSION_BREPVERTICES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPVERTICES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepVertex* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepVertices::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepVertices::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void BRepVertices::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPVERTICES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepWire.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepWire.h new file mode 100644 index 0000000..9ca6a83 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepWire.h @@ -0,0 +1,174 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPWIRE_CPP__ +# define ADSK_FUSION_BREPWIRE_API XI_EXPORT +# else +# define ADSK_FUSION_BREPWIRE_API +# endif +#else +# define ADSK_FUSION_BREPWIRE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepCoEdges; + class BRepEdges; + class BRepVertices; + class Occurrence; +}} +namespace adsk { namespace core { + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Represents a single B-Rep wire body. A wire body consists of one or +/// more edges and their vertices. +class BRepWire : public core::Base { +public: + + /// Returns the B-Rep edges associated with this wire body. + core::Ptr edges() const; + + /// Returns the B-Rep vertices associated with this wire body. + core::Ptr vertices() const; + + /// Returns the co-edges associated with this wire body. The co-edges record + /// the connections between the edges in the wire body. + core::Ptr coEdges() const; + + /// Indicates if this entities making up this wire body are planar and all lie on the same plane. + bool isPlanar() const; + + /// Returns the parent BRepBody object that contains this wire. + core::Ptr parent() const; + + /// Method that computes the offset for a planar wire. A BRepBody containing the resulting + /// BRepWire object(s) is returned. It's possible that the offset result of a single wire + /// can result in multiple wires. + /// planeNormal : Input Vector3D object that defines the positive direction of the + /// plane the plane the wire lies on. This vector must be normal to the plane and is used to + /// determine the side to offset the curves to. A positive offset distance is in the direction + /// of the cross product (wire_tangent x wire_plane_normal). A negative offset is in the + /// opposite direction. + /// distance : The offset distance in centimeters. See the description for the Normal argument to see how + /// a positive or negative value for the distance specifies the direction of the offset. + /// cornerType : Specifies how the corners are connected when offsetting the curves results in gaps in the corners. + /// See the documentation of the enum for a detailed description of each option. + /// Returns a new temporary BRepBody that contains one or more wires that represent the offset. + core::Ptr offsetPlanarWire(const core::Ptr& planeNormal, double distance, OffsetCornerTypes cornerType); + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// BRepFace object is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context for the created proxy. + /// Returns the new BRepWire proxy or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_BREPWIRE_API static const char* classType(); + ADSK_FUSION_BREPWIRE_API const char* objectType() const override; + ADSK_FUSION_BREPWIRE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPWIRE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepEdges* edges_raw() const = 0; + virtual BRepVertices* vertices_raw() const = 0; + virtual BRepCoEdges* coEdges_raw() const = 0; + virtual bool isPlanar_raw() const = 0; + virtual BRepBody* parent_raw() const = 0; + virtual BRepBody* offsetPlanarWire_raw(core::Vector3D* planeNormal, double distance, OffsetCornerTypes cornerType) = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual BRepWire* nativeObject_raw() const = 0; + virtual BRepWire* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepWire::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline core::Ptr BRepWire::vertices() const +{ + core::Ptr res = vertices_raw(); + return res; +} + +inline core::Ptr BRepWire::coEdges() const +{ + core::Ptr res = coEdges_raw(); + return res; +} + +inline bool BRepWire::isPlanar() const +{ + bool res = isPlanar_raw(); + return res; +} + +inline core::Ptr BRepWire::parent() const +{ + core::Ptr res = parent_raw(); + return res; +} + +inline core::Ptr BRepWire::offsetPlanarWire(const core::Ptr& planeNormal, double distance, OffsetCornerTypes cornerType) +{ + core::Ptr res = offsetPlanarWire_raw(planeNormal.get(), distance, cornerType); + return res; +} + +inline core::Ptr BRepWire::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr BRepWire::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BRepWire::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPWIRE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepWireDefinition.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepWireDefinition.h new file mode 100644 index 0000000..a185af5 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepWireDefinition.h @@ -0,0 +1,64 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPWIREDEFINITION_CPP__ +# define ADSK_FUSION_BREPWIREDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_BREPWIREDEFINITION_API +# endif +#else +# define ADSK_FUSION_BREPWIREDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepWireEdgeDefinitions; +}} + +namespace adsk { namespace fusion { + +/// Represents the definition of a B-Rep wire that can be used as input to create a BRepBody that includes this wire. +class BRepWireDefinition : public core::Base { +public: + + /// Provides access to the BRepWireEdgeDefinitions object associated with the parent BRepWireDefinition object. + /// It's through the returned collection that you can create new BRepWireEdgeDefinitions objects. + core::Ptr wireEdgeDefinitions() const; + + ADSK_FUSION_BREPWIREDEFINITION_API static const char* classType(); + ADSK_FUSION_BREPWIREDEFINITION_API const char* objectType() const override; + ADSK_FUSION_BREPWIREDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPWIREDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepWireEdgeDefinitions* wireEdgeDefinitions_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepWireDefinition::wireEdgeDefinitions() const +{ + core::Ptr res = wireEdgeDefinitions_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPWIREDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepWireEdgeDefinition.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepWireEdgeDefinition.h new file mode 100644 index 0000000..bd99d0e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepWireEdgeDefinition.h @@ -0,0 +1,127 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPWIREEDGEDEFINITION_CPP__ +# define ADSK_FUSION_BREPWIREEDGEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_BREPWIREEDGEDEFINITION_API +# endif +#else +# define ADSK_FUSION_BREPWIREEDGEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepVertexDefinition; +}} +namespace adsk { namespace core { + class Curve3D; +}} + +namespace adsk { namespace fusion { + +/// Represents the definition of an edge in B-Rep wire that can be used as input to create a BRepBody that includes this wire edge. +class BRepWireEdgeDefinition : public core::Base { +public: + + /// Gets and sets the associate ID of this B-Rep wire definition. This ID will be copied to the corresponding + /// edge when the BRepBodyDefinition is used to create a BrepBody. It is used by Fusion360 as + /// the identifier for the edge and is used for tracking this geometry for parametric recomputes. + int associativeID() const; + bool associativeID(int value); + + /// Gets and sets the start vertex of the wire edge definition. + core::Ptr startVertex() const; + bool startVertex(const core::Ptr& value); + + /// Gets and sets the end vertex of the wire edge definition. + core::Ptr endVertex() const; + bool endVertex(const core::Ptr& value); + + /// Gets and sets the Curve3D object that defines the shape of the edge using 3D geometry in model space. + /// Valid objects are an Arc3D, NurbsCurve3D, Circle3D, Ellipse3D, EllipticalArc3D, or Line3D. + core::Ptr modelSpaceCurve() const; + bool modelSpaceCurve(const core::Ptr& value); + + ADSK_FUSION_BREPWIREEDGEDEFINITION_API static const char* classType(); + ADSK_FUSION_BREPWIREEDGEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_BREPWIREEDGEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPWIREEDGEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual int associativeID_raw() const = 0; + virtual bool associativeID_raw(int value) = 0; + virtual BRepVertexDefinition* startVertex_raw() const = 0; + virtual bool startVertex_raw(BRepVertexDefinition* value) = 0; + virtual BRepVertexDefinition* endVertex_raw() const = 0; + virtual bool endVertex_raw(BRepVertexDefinition* value) = 0; + virtual core::Curve3D* modelSpaceCurve_raw() const = 0; + virtual bool modelSpaceCurve_raw(core::Curve3D* value) = 0; +}; + +// Inline wrappers + +inline int BRepWireEdgeDefinition::associativeID() const +{ + int res = associativeID_raw(); + return res; +} + +inline bool BRepWireEdgeDefinition::associativeID(int value) +{ + return associativeID_raw(value); +} + +inline core::Ptr BRepWireEdgeDefinition::startVertex() const +{ + core::Ptr res = startVertex_raw(); + return res; +} + +inline bool BRepWireEdgeDefinition::startVertex(const core::Ptr& value) +{ + return startVertex_raw(value.get()); +} + +inline core::Ptr BRepWireEdgeDefinition::endVertex() const +{ + core::Ptr res = endVertex_raw(); + return res; +} + +inline bool BRepWireEdgeDefinition::endVertex(const core::Ptr& value) +{ + return endVertex_raw(value.get()); +} + +inline core::Ptr BRepWireEdgeDefinition::modelSpaceCurve() const +{ + core::Ptr res = modelSpaceCurve_raw(); + return res; +} + +inline bool BRepWireEdgeDefinition::modelSpaceCurve(const core::Ptr& value) +{ + return modelSpaceCurve_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPWIREEDGEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepWireEdgeDefinitions.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepWireEdgeDefinitions.h new file mode 100644 index 0000000..a62d055 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepWireEdgeDefinitions.h @@ -0,0 +1,108 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPWIREEDGEDEFINITIONS_CPP__ +# define ADSK_FUSION_BREPWIREEDGEDEFINITIONS_API XI_EXPORT +# else +# define ADSK_FUSION_BREPWIREEDGEDEFINITIONS_API +# endif +#else +# define ADSK_FUSION_BREPWIREEDGEDEFINITIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepVertexDefinition; + class BRepWireEdgeDefinition; +}} +namespace adsk { namespace core { + class Curve3D; +}} + +namespace adsk { namespace fusion { + +/// +class BRepWireEdgeDefinitions : public core::Base { +public: + + /// Function that returns the specified BRepWireEdgeDefinition object using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of B-Rep wire edge definition objects in the collection. + size_t count() const; + + /// Creates a new BRepWireEdgeDefinition object associated with the parent BRepWireDefinition object. + /// startVertex : Vertex definition that defines the start of the edge. For a closed curve, like a circle, you still + /// need to provide a vertex on the curve but should use the same BRepVertexDefinition for both the start and end vertices. + /// endVertex : Vertex definition that defines the end of the edge. For a closed curve, like a circle, this should be the + /// same vertex as used for the start vertex. + /// modelSpaceCurve : A Curve3D object that defines the shape of the edge using 3D geometry in model space. + /// Valid input is an Arc3D, NurbsCurve3D, Circle3D, Ellipse3D, EllipticalArc3D, or Line3D. + /// Returns the newly created BRepWireEdgeDefinition object or null in the case of failure. + core::Ptr add(const core::Ptr& startVertex, const core::Ptr& endVertex, const core::Ptr& modelSpaceCurve); + + typedef BRepWireEdgeDefinition iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPWIREEDGEDEFINITIONS_API static const char* classType(); + ADSK_FUSION_BREPWIREEDGEDEFINITIONS_API const char* objectType() const override; + ADSK_FUSION_BREPWIREEDGEDEFINITIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPWIREEDGEDEFINITIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepWireEdgeDefinition* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual BRepWireEdgeDefinition* add_raw(BRepVertexDefinition* startVertex, BRepVertexDefinition* endVertex, core::Curve3D* modelSpaceCurve) = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepWireEdgeDefinitions::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepWireEdgeDefinitions::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr BRepWireEdgeDefinitions::add(const core::Ptr& startVertex, const core::Ptr& endVertex, const core::Ptr& modelSpaceCurve) +{ + core::Ptr res = add_raw(startVertex.get(), endVertex.get(), modelSpaceCurve.get()); + return res; +} + +template inline void BRepWireEdgeDefinitions::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPWIREEDGEDEFINITIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/BRepWires.h b/usr/autodesk/CPP/include/Fusion/BRep/BRepWires.h new file mode 100644 index 0000000..32e0af0 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/BRepWires.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPWIRES_CPP__ +# define ADSK_FUSION_BREPWIRES_API XI_EXPORT +# else +# define ADSK_FUSION_BREPWIRES_API +# endif +#else +# define ADSK_FUSION_BREPWIRES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepWire; +}} + +namespace adsk { namespace fusion { + +/// Provides access to B-Rep wire bodies. +class BRepWires : public core::Base { +public: + + /// Function that returns the specified wire using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of B-Rep wire bodies in the collection. + size_t count() const; + + typedef BRepWire iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPWIRES_API static const char* classType(); + ADSK_FUSION_BREPWIRES_API const char* objectType() const override; + ADSK_FUSION_BREPWIRES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPWIRES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepWire* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepWires::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepWires::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void BRepWires::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPWIRES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/BRep/TemporaryBRepManager.h b/usr/autodesk/CPP/include/Fusion/BRep/TemporaryBRepManager.h new file mode 100644 index 0000000..79f7e00 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/BRep/TemporaryBRepManager.h @@ -0,0 +1,446 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TEMPORARYBREPMANAGER_CPP__ +# define ADSK_FUSION_TEMPORARYBREPMANAGER_API XI_EXPORT +# else +# define ADSK_FUSION_TEMPORARYBREPMANAGER_API +# endif +#else +# define ADSK_FUSION_TEMPORARYBREPMANAGER_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBodies; + class BRepBody; + class BRepEdge; + class BRepFace; + class BRepWire; +}} +namespace adsk { namespace core { + class Curve3D; + class Matrix3D; + class OrientedBoundingBox3D; + class Plane; + class Point3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// A utility object that provides functionality to create and manipulate B-Rep data outside +/// the context of a document. The provides direct access to the modeling core without the +/// overhead of parametrics, persistence, transactions, or graphics. It also provides a way +/// of directly defining and creating B-Rep data. +class TemporaryBRepManager : public core::Base { +public: + + /// Gets the TempoaryBRepManager object. This object provides access to functionality to + /// create an manipulate temporary B-Rep data outside the context of a document. + /// Returns the TemporaryBRepManager object. + static core::Ptr get(); + + /// Creates a temporary copy of the input BRepBody, BRepFace, or BRepEdge object. + /// bRepEntity : The BRepBody, BRepFace, BRepLoop, or BRepEdge to create a copy of. This can be a parametric + /// B-Rep entity or a temporary B-Rep entity. + /// Returns a BRepBody that contains the result. If a BRepBody is input the copy is + /// of the entire body. If a BRepFace is input, then the result is a BRepBody that + /// contains a single face. If a BRepLoop is input then the result is a BRepBody that + /// contains a wire where each edge in the loop will have a corresponding edge in the wire. + /// If a BRepEdge is input then the result is a BRepBody that contains a wire that contains + /// the single edge. + core::Ptr copy(const core::Ptr& bRepEntity); + + /// Calculates the intersection between the input body and plane and creates a + /// wire body that represents the intersection curves. + /// body : The BRepBody to intersection. + /// plane : The geometry Plane to intersect with the body. + /// Returns a BRepBody that contains a wire body that represents the intersection. + core::Ptr planeIntersection(const core::Ptr& body, const core::Ptr& plane); + + /// Creates a new body by creating a ruled surface between the two input wire bodies. + /// sectionOne : BRepWire that defines the shape of the first section. + /// sectionTwo : BRepWire that defines the shape of the second section. + /// Returns the created ruled surface as a BRepBody object. + core::Ptr createRuledSurface(const core::Ptr& sectionOne, const core::Ptr& sectionTwo); + + /// Calculates the silhouette curve geometry for a given face as viewed from a given direction. + /// face : Input BRepFace object to calculate the silhouette curve for. + /// viewDirection : Input Vector3D object that defines the view direction to calculate the silhouette curve relative to. + /// The silhouette curve(s) will lie along the path where the face normal is perpendicular to the view direction. + /// returnCoincidentSilhouettes : Input Boolean that specifies if silhouette curves that are coincident to the edges of the face should be + /// returned or not. If true, these curves will be returned. + /// Returns a SurfaceBody object that will contain one or more BRepWire objects that represent the silhouette curve(s). + /// This method can return null in the case where there is not a silhouette curve for the specified face. + core::Ptr createSilhouetteCurves(const core::Ptr& face, const core::Ptr& viewDirection, bool returnCoincidentSilhouettes); + + /// Deletes one or more faces from a temporary BRepBody. The body that will be modified is determined + /// by getting the parent body of the input faces. + /// faces : An array of BRepFace objects to delete. If more than one face is provided, + /// all of the faces must exist within the same body. + /// deleteSpecifiedFaces : This allows you to either delete the faces that were input or to keep those faces and delete all the + /// other faces in the body. + /// Returns true if the operation was successful. + bool deleteFaces(const std::vector>& faces, bool deleteSpecifiedFaces); + + /// Performs the specified Boolean operation between the two input bodies. The input bodies need + /// not be solid but can be faces that are combined or trimmed. + /// targetBody : The target body that will be modified as a result of the Boolean operation. + /// toolBody : The tool body that will be used to operate on the target body. + /// booleanType : The type of Boolean operation to perform. + /// Returns true if the operation was successful. If successful, the target body is modified as a result of the + /// Boolean operation. Because of this the targetBody must always be a temporary BRepBody. The tool body is not + /// modified. This is analogous to a machining operation where you have the target that is being machined and + /// the tool that removes material. + bool booleanOperation(const core::Ptr& targetBody, const core::Ptr& toolBody, BooleanTypes booleanType); + + /// Transforms the input body using the specified transformation matrix. + /// body : The BRepBody object to transform. + /// transform : The transformation matrix that defines the transform to apply to the body. + /// Returns true if the specified transform was successfully applied to the body. + bool transform(const core::Ptr& body, const core::Ptr& transform); + + /// Creates new BRepBody objects based on the contents of the specified file. + /// filename : The full path and name of the file to read in. This can be a SMT, SMB, SAT, or SAB file. + /// A BRepBodies collection object is returned which can contain multiple BRepBody objects. + /// null is returned in the case where it was unable to read the file. + core::Ptr createFromFile(const std::string& filename); + + /// Exports the input bodies to the specified file. + /// bodies : An array of BRepBody objects that you want to export. + /// filename : The filename to write the BRepBody objects to. The type of file to create + /// is inferred from the extension of the file. The valid extensions are ".sat" and ".smt". + /// Returns true if the export was successful. + bool exportToFile(const std::vector>& bodies, const std::string& filename); + + /// Creates a new temporary solid box BRepBody object. + /// box : The OrientedBoundingBox3D object that defines the position, orientation, and + /// size of the box to crate. + /// Returns the newly created temporary BRepBody object or null in the case of failure. + core::Ptr createBox(const core::Ptr& box); + + /// Creates a temporary solid cylinder or cone BRepBody object. + /// pointOne : A point at one end of the cylinder or cone. + /// pointOneRadius : The radius of the cylinder or cone at the point one end, in centimeters. + /// pointTwo : A point at the opposite end of the cylinder or cone. + /// pointTwoRadius : The radius of the cylinder or cone at the point two end, in centimeters. + /// For a cylinder the pointTwoRadius should be equal to the pointOneRadius. + /// Returns the newly created temporary BRepBody object or null in the case of failure. + core::Ptr createCylinderOrCone(const core::Ptr& pointOne, double pointOneRadius, const core::Ptr& pointTwo, double pointTwoRadius); + + /// Creates a temporary elliptical solid cylinder or cone BrepBody object. + /// pointOne : A point at one end of the cylinder or cone. + /// pointOneMajorRadius : The major radius of the cylinder or cone at the point one end, in centimeters. + /// pointOneMinorRadius : The minor radius of the cylinder or cone at the point one end, in centimeters. + /// pointTwo : A point at the opposite end of the cone. + /// pointTwoMajorRadius : The major radius of the cylinder or cone at the point two end, in centimeters. The + /// minor radius is automatically determined using the point one ratio of the minor and major + /// radii. + /// majorAxisDirection : A Vector3D object that defines the direction of the major axis. + /// Returns the newly created temporary BRepBody object or null in the case of failure. + core::Ptr createEllipticalCylinderOrCone(const core::Ptr& pointOne, double pointOneMajorRadius, double pointOneMinorRadius, const core::Ptr& pointTwo, double pointTwoMajorRadius, const core::Ptr& majorAxisDirection); + + /// Creates a temporary spherical BRepBody object. + /// center : The center point of the sphere. + /// radius : The radius of the sphere in centimeters. + /// Returns the newly created temporary BRepBody object or null in the case of failure. + core::Ptr createSphere(const core::Ptr& center, double radius); + + /// Creates a temporary toroidal BRepBody object. + /// center : The center point of the torus. + /// axis : The axis of the torus. + /// majorRadius : The radius, in centimeters, of the major radius of the torus. If the torus was created + /// by sweeping a circle around another circle this would be the radius of the path circle. + /// minorRadius : The radius, in centimeters, of the minor radius of the torus. If the torus was created + /// by sweeping a circle around another circle this would be the radius of the profile circle. + /// Returns the newly created temporary BRepBody object or null in the case of failure. + core::Ptr createTorus(const core::Ptr& center, const core::Ptr& axis, double majorRadius, double minorRadius); + + /// Creates a body from multiple wires that all lie within the same plane. Multiple wires are + /// used when creating a plane with interior holes. One wire defines the outer shape and the + /// other wires define the interior loops of the created face. + /// wireBodies : An array of bodies that contain planar wires. Each wire must be closed, they should not overlap, + /// and they should all lie on the same plane. + /// Returns a BRepBody containing the created BRepFace object or null in the case of failure. + core::Ptr createFaceFromPlanarWires(const std::vector>& wireBodies); + + ///

Method that finds regions of faces on two bodies which overlap and creates new bodies where the faces + /// are split at the edges of the overlaps. This does not modify the original bodies but creates new + /// temporary bodies that contain the imprints.

+ ///

The picture below shows an example of imprinting. The picture on the left shows the initial two bodies + /// that are positioned so there are coincident faces. The picture on the right shows the two bodies individually + /// so you can see the result of the imprint and how the coincident faces were split.

+ ///


+ ///

The ability to imprint solids can be important to applications that need to mesh models. By creating edges + /// at the points where solids connect, it guarantees that there will be mesh nodes along those boundaries.

+ /// bodyOne : Input BRepBody that will participate in the imprint operation. This body can be either a parametric + /// or temporary body. + /// bodyTwo : Input BRepBody that will participate in the imprint operation. This body can be either a parametric + /// or temporary body. + /// imprintCoincidentEdges :

Input Boolean that indicates if overlapping edges should be included in the result. The picture below + /// shows an example of when this argument will make a difference. The two bodies have overlapping faces + /// and there is also an overlapping edge. If this argument is true, then the edge shown in red below + /// will be included in the output as an overlapping edge. If False it will not be included and only + /// the edges of the overlapping faces will be in the overlapping faces collections.

+ ///

+ /// resultBodyOne : Output temporary BRepBody that contains the imprinted body that corresponds to the body provided through the bodyOne argument. + /// resultBodyTwo : Output temporary BRepBody that contains the imprinted body that corresponds to the body provided through the bodyTwo argument. + /// bodyOneOverlappingFaces : Output array of BRepFace objects that represent the overlapping faces that are part of resultBodyOne. Faces at the same index within the + /// collection returned here and that returned by the bodyTwoOverlappingFaces are overlapping. + /// bodyTwoOverlappingFaces : Output array of BRepFace objects that represent the overlapping faces that are part of resultBodyTwo. Faces at the same index within the + /// collection returned here and that returned by the bodyOneOverlappingFaces are overlapping. + /// bodyOneOverlappingEdges : Output array of BRepEdge objects that represent the overlapping edges that are part of resultBodyOne. Edges at the same index within the + /// collection returned here and that returned by the bodyTwoOverlappingEdges are overlapping. + /// bodyTwoOverlappingEdges : Output array of BRepEdge objects that represent the overlapping edges that are part of resultBodyTwo. Edges at the same index within the + /// collection returned here and that returned by the bodyOneOverlappingEdges are overlapping. + /// tolerance : Optional Input double that specifies the tolerance, in centimeters, to use when comparing the bodies. If not specified, or a value of zero + /// is specified, the internal modeling tolerance will be used. + /// Returns true if the imprint calculation was successful. + bool imprintOverlapBodies(const core::Ptr& bodyOne, const core::Ptr& bodyTwo, bool imprintCoincidentEdges, core::Ptr& resultBodyOne, core::Ptr& resultBodyTwo, std::vector>& bodyOneOverlappingFaces, std::vector>& bodyTwoOverlappingFaces, std::vector>& bodyOneOverlappingEdges, std::vector>& bodyTwoOverlappingEdges, double tolerance = 0); + + /// Give an array of curve geometry objects, this method creates a new wire body. + /// curves : An array containing the input Curve3D objects. These can be Arc3D, Circle3D, Ellipse3D, EllipticalArc3D or Line3D objects. + /// edgeMap : An array of edges in the returned body. The order that the edges are in this collection is the + /// same order as the original corresponding Curve3D object is in the input curves array. This allows you to + /// map between the original input curve and created edge. + /// allowSelfIntersections : Specifies if you want to allow self-intersection in the input curves or not. + /// Returns the B-Rep body containing the created wire or null in the case of failure. + core::Ptr createWireFromCurves(const std::vector>& curves, std::vector>& edgeMap, bool allowSelfIntersections = false); + + /// Creates a B-Rep body that contains a wire with a single edge that represents a helical curve. + /// axisPoint : A Point3D object that defines a point along the axis of the helix. + /// axisVector : A Vector3D object that defines the direction of the axis of the helix. + /// startPoint : A Point3D that defines the start point of the helix. This is a point on the helix and defines the starting + /// point of the helix. The distance of this point to the axis defines the starting radius of the helix. + /// pitch : The pitch of the helix, or the distance between each of the turns, in centimeters. + /// turns : The number of turns of the helix. + /// taperAngle : The taper angle of the helix in radians. + /// + core::Ptr createHelixWire(const core::Ptr& axisPoint, const core::Ptr& axisVector, const core::Ptr& startPoint, double pitch, double turns, double taperAngle); + + ADSK_FUSION_TEMPORARYBREPMANAGER_API static const char* classType(); + ADSK_FUSION_TEMPORARYBREPMANAGER_API const char* objectType() const override; + ADSK_FUSION_TEMPORARYBREPMANAGER_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TEMPORARYBREPMANAGER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_TEMPORARYBREPMANAGER_API static TemporaryBRepManager* get_raw(); + virtual BRepBody* copy_raw(core::Base* bRepEntity) = 0; + virtual BRepBody* planeIntersection_raw(BRepBody* body, core::Plane* plane) = 0; + virtual BRepBody* createRuledSurface_raw(BRepWire* sectionOne, BRepWire* sectionTwo) = 0; + virtual BRepBody* createSilhouetteCurves_raw(BRepFace* face, core::Vector3D* viewDirection, bool returnCoincidentSilhouettes) = 0; + virtual bool deleteFaces_raw(BRepFace** faces, size_t faces_size, bool deleteSpecifiedFaces) = 0; + virtual bool booleanOperation_raw(BRepBody* targetBody, BRepBody* toolBody, BooleanTypes booleanType) = 0; + virtual bool transform_raw(BRepBody* body, core::Matrix3D* transform) = 0; + virtual BRepBodies* createFromFile_raw(const char * filename) = 0; + virtual bool exportToFile_raw(BRepBody** bodies, size_t bodies_size, const char * filename) = 0; + virtual BRepBody* createBox_raw(core::OrientedBoundingBox3D* box) = 0; + virtual BRepBody* createCylinderOrCone_raw(core::Point3D* pointOne, double pointOneRadius, core::Point3D* pointTwo, double pointTwoRadius) = 0; + virtual BRepBody* createEllipticalCylinderOrCone_raw(core::Point3D* pointOne, double pointOneMajorRadius, double pointOneMinorRadius, core::Point3D* pointTwo, double pointTwoMajorRadius, core::Vector3D* majorAxisDirection) = 0; + virtual BRepBody* createSphere_raw(core::Point3D* center, double radius) = 0; + virtual BRepBody* createTorus_raw(core::Point3D* center, core::Vector3D* axis, double majorRadius, double minorRadius) = 0; + virtual BRepBody* createFaceFromPlanarWires_raw(BRepBody** wireBodies, size_t wireBodies_size) = 0; + virtual bool imprintOverlapBodies_raw(BRepBody* bodyOne, BRepBody* bodyTwo, bool imprintCoincidentEdges, BRepBody*& resultBodyOne, BRepBody*& resultBodyTwo, BRepFace**& bodyOneOverlappingFaces, size_t& bodyOneOverlappingFaces_size, BRepFace**& bodyTwoOverlappingFaces, size_t& bodyTwoOverlappingFaces_size, BRepEdge**& bodyOneOverlappingEdges, size_t& bodyOneOverlappingEdges_size, BRepEdge**& bodyTwoOverlappingEdges, size_t& bodyTwoOverlappingEdges_size, double tolerance) = 0; + virtual BRepBody* createWireFromCurves_raw(core::Curve3D** curves, size_t curves_size, BRepEdge**& edgeMap, size_t& edgeMap_size, bool allowSelfIntersections) = 0; + virtual BRepBody* createHelixWire_raw(core::Point3D* axisPoint, core::Vector3D* axisVector, core::Point3D* startPoint, double pitch, double turns, double taperAngle) = 0; +}; + +// Inline wrappers + +inline core::Ptr TemporaryBRepManager::get() +{ + core::Ptr res = get_raw(); + return res; +} + +inline core::Ptr TemporaryBRepManager::copy(const core::Ptr& bRepEntity) +{ + core::Ptr res = copy_raw(bRepEntity.get()); + return res; +} + +inline core::Ptr TemporaryBRepManager::planeIntersection(const core::Ptr& body, const core::Ptr& plane) +{ + core::Ptr res = planeIntersection_raw(body.get(), plane.get()); + return res; +} + +inline core::Ptr TemporaryBRepManager::createRuledSurface(const core::Ptr& sectionOne, const core::Ptr& sectionTwo) +{ + core::Ptr res = createRuledSurface_raw(sectionOne.get(), sectionTwo.get()); + return res; +} + +inline core::Ptr TemporaryBRepManager::createSilhouetteCurves(const core::Ptr& face, const core::Ptr& viewDirection, bool returnCoincidentSilhouettes) +{ + core::Ptr res = createSilhouetteCurves_raw(face.get(), viewDirection.get(), returnCoincidentSilhouettes); + return res; +} + +inline bool TemporaryBRepManager::deleteFaces(const std::vector>& faces, bool deleteSpecifiedFaces) +{ + BRepFace** faces_ = new BRepFace*[faces.size()]; + for(size_t i=0; i& targetBody, const core::Ptr& toolBody, BooleanTypes booleanType) +{ + bool res = booleanOperation_raw(targetBody.get(), toolBody.get(), booleanType); + return res; +} + +inline bool TemporaryBRepManager::transform(const core::Ptr& body, const core::Ptr& transform) +{ + bool res = transform_raw(body.get(), transform.get()); + return res; +} + +inline core::Ptr TemporaryBRepManager::createFromFile(const std::string& filename) +{ + core::Ptr res = createFromFile_raw(filename.c_str()); + return res; +} + +inline bool TemporaryBRepManager::exportToFile(const std::vector>& bodies, const std::string& filename) +{ + BRepBody** bodies_ = new BRepBody*[bodies.size()]; + for(size_t i=0; i TemporaryBRepManager::createBox(const core::Ptr& box) +{ + core::Ptr res = createBox_raw(box.get()); + return res; +} + +inline core::Ptr TemporaryBRepManager::createCylinderOrCone(const core::Ptr& pointOne, double pointOneRadius, const core::Ptr& pointTwo, double pointTwoRadius) +{ + core::Ptr res = createCylinderOrCone_raw(pointOne.get(), pointOneRadius, pointTwo.get(), pointTwoRadius); + return res; +} + +inline core::Ptr TemporaryBRepManager::createEllipticalCylinderOrCone(const core::Ptr& pointOne, double pointOneMajorRadius, double pointOneMinorRadius, const core::Ptr& pointTwo, double pointTwoMajorRadius, const core::Ptr& majorAxisDirection) +{ + core::Ptr res = createEllipticalCylinderOrCone_raw(pointOne.get(), pointOneMajorRadius, pointOneMinorRadius, pointTwo.get(), pointTwoMajorRadius, majorAxisDirection.get()); + return res; +} + +inline core::Ptr TemporaryBRepManager::createSphere(const core::Ptr& center, double radius) +{ + core::Ptr res = createSphere_raw(center.get(), radius); + return res; +} + +inline core::Ptr TemporaryBRepManager::createTorus(const core::Ptr& center, const core::Ptr& axis, double majorRadius, double minorRadius) +{ + core::Ptr res = createTorus_raw(center.get(), axis.get(), majorRadius, minorRadius); + return res; +} + +inline core::Ptr TemporaryBRepManager::createFaceFromPlanarWires(const std::vector>& wireBodies) +{ + BRepBody** wireBodies_ = new BRepBody*[wireBodies.size()]; + for(size_t i=0; i res = createFaceFromPlanarWires_raw(wireBodies_, wireBodies.size()); + delete[] wireBodies_; + return res; +} + +inline bool TemporaryBRepManager::imprintOverlapBodies(const core::Ptr& bodyOne, const core::Ptr& bodyTwo, bool imprintCoincidentEdges, core::Ptr& resultBodyOne, core::Ptr& resultBodyTwo, std::vector>& bodyOneOverlappingFaces, std::vector>& bodyTwoOverlappingFaces, std::vector>& bodyOneOverlappingEdges, std::vector>& bodyTwoOverlappingEdges, double tolerance) +{ + BRepBody* resultBodyOne_ = nullptr; + BRepBody* resultBodyTwo_ = nullptr; + BRepFace** bodyOneOverlappingFaces_ = nullptr; + size_t bodyOneOverlappingFaces_size; + BRepFace** bodyTwoOverlappingFaces_ = nullptr; + size_t bodyTwoOverlappingFaces_size; + BRepEdge** bodyOneOverlappingEdges_ = nullptr; + size_t bodyOneOverlappingEdges_size; + BRepEdge** bodyTwoOverlappingEdges_ = nullptr; + size_t bodyTwoOverlappingEdges_size; + + bool res = imprintOverlapBodies_raw(bodyOne.get(), bodyTwo.get(), imprintCoincidentEdges, resultBodyOne_, resultBodyTwo_, bodyOneOverlappingFaces_, bodyOneOverlappingFaces_size, bodyTwoOverlappingFaces_, bodyTwoOverlappingFaces_size, bodyOneOverlappingEdges_, bodyOneOverlappingEdges_size, bodyTwoOverlappingEdges_, bodyTwoOverlappingEdges_size, tolerance); + resultBodyOne = resultBodyOne_; + resultBodyTwo = resultBodyTwo_; + if(bodyOneOverlappingFaces_) + { + bodyOneOverlappingFaces.assign(bodyOneOverlappingFaces_, bodyOneOverlappingFaces_ + bodyOneOverlappingFaces_size); + core::DeallocateArray(bodyOneOverlappingFaces_); + } + if(bodyTwoOverlappingFaces_) + { + bodyTwoOverlappingFaces.assign(bodyTwoOverlappingFaces_, bodyTwoOverlappingFaces_ + bodyTwoOverlappingFaces_size); + core::DeallocateArray(bodyTwoOverlappingFaces_); + } + if(bodyOneOverlappingEdges_) + { + bodyOneOverlappingEdges.assign(bodyOneOverlappingEdges_, bodyOneOverlappingEdges_ + bodyOneOverlappingEdges_size); + core::DeallocateArray(bodyOneOverlappingEdges_); + } + if(bodyTwoOverlappingEdges_) + { + bodyTwoOverlappingEdges.assign(bodyTwoOverlappingEdges_, bodyTwoOverlappingEdges_ + bodyTwoOverlappingEdges_size); + core::DeallocateArray(bodyTwoOverlappingEdges_); + } + return res; +} + +inline core::Ptr TemporaryBRepManager::createWireFromCurves(const std::vector>& curves, std::vector>& edgeMap, bool allowSelfIntersections) +{ + core::Curve3D** curves_ = new core::Curve3D*[curves.size()]; + for(size_t i=0; i res = createWireFromCurves_raw(curves_, curves.size(), edgeMap_, edgeMap_size, allowSelfIntersections); + delete[] curves_; + if(edgeMap_) + { + edgeMap.assign(edgeMap_, edgeMap_ + edgeMap_size); + core::DeallocateArray(edgeMap_); + } + return res; +} + +inline core::Ptr TemporaryBRepManager::createHelixWire(const core::Ptr& axisPoint, const core::Ptr& axisVector, const core::Ptr& startPoint, double pitch, double turns, double taperAngle) +{ + core::Ptr res = createHelixWire_raw(axisPoint.get(), axisVector.get(), startPoint.get(), pitch, turns, taperAngle); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TEMPORARYBREPMANAGER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJoint.h b/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJoint.h new file mode 100644 index 0000000..b076b71 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJoint.h @@ -0,0 +1,432 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_ASBUILTJOINT_CPP__ +# define ADSK_FUSION_ASBUILTJOINT_API XI_EXPORT +# else +# define ADSK_FUSION_ASBUILTJOINT_API +# endif +#else +# define ADSK_FUSION_ASBUILTJOINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class JointGeometry; + class JointMotion; + class Occurrence; + class TimelineObject; +}} +namespace adsk { namespace core { + class Attributes; +}} + +namespace adsk { namespace fusion { + +/// Represent an as-built joint. +class AsBuiltJoint : public core::Base { +public: + + /// Returns the parent component that owns this AsBuiltJoint. + core::Ptr parentComponent() const; + + /// The name of the as-built joint as it is displayed in the timeline and the browser. The + /// name can be changed. + std::string name() const; + bool name(const std::string& value); + + /// Specifies the first of two occurrences the joint is between. + core::Ptr occurrenceOne() const; + + /// Specifies the second of two occurrences the joint is between. + core::Ptr occurrenceTwo() const; + + /// Specifies the position of the joint. Getting this property will return null and + /// setting it will be ignored in the case where the joint motion is rigid. + /// To set this property, you need to position the timeline marker to immediately before this as-built joint. + /// This can be accomplished using the following code: thisAsBuiltJoint.timelineObject.rollTo(True) + core::Ptr geometry() const; + bool geometry(const core::Ptr& value); + + /// Deletes this as-built joint. + /// Returns true if the delete was successful. + bool deleteMe(); + + /// Returns the timeline object associated with this as-built joint. + core::Ptr timelineObject() const; + + /// Returns a JointMotion object that defines the motion relationship between the two geometries. + core::Ptr jointMotion() const; + + /// Redefines the relationship between the two joint geometries as a rigid joint. + /// To use this method, you need to position the timeline marker to immediately before this as-built joint. + /// This can be accomplished using the following code: thisAsBuiltJoint.timelineObject.rollTo(True) + /// Returns true if successful. + bool setAsRigidJointMotion(); + + /// Redefines the relationship between the two joint geometries as a revolute joint. + /// To use this method, you need to position the timeline marker to immediately before this as-built joint. + /// This can be accomplished using the following code: thisAsBuiltJoint.timelineObject.rollTo(True) + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// geometry : Redefines the joint geometry. If not provided, the existing geometry is used. This argument is + /// required if the current joint motion is rigid. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// from. + /// Returns true if the operation was successful. + bool setAsRevoluteJointMotion(JointDirections rotationAxis, const core::Ptr& geometry = NULL, const core::Ptr& customRotationAxisEntity = NULL); + + /// Redefines the relationship between the two joint geometries as a slider joint. + /// To use this method, you need to position the timeline marker to immediately before this as-built joint. + /// This can be accomplished using the following code: thisAsBuiltJoint.timelineObject.rollTo(True) + /// sliderDirection : Specifies which axis the slide direction is along. If this is set to CustomJointDirection then the + /// customSliderDirectionEntity argument must also be provided. + /// geometry : Redefines the joint geometry. If not provided, the existing geometry is used. This argument is + /// required if the current joint motion is rigid. + /// customSliderDirectionEntity : If the sliderDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the custom slider direction. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsSliderJointMotion(JointDirections sliderDirection, const core::Ptr& geometry = NULL, const core::Ptr& customSliderDirectionEntity = NULL); + + /// Redefines the relationship between the two joint geometries as a cylindrical joint. + /// To use this method, you need to position the timeline marker to immediately before this as-built joint. + /// This can be accomplished using the following code: thisAsBuiltJoint.timelineObject.rollTo(True) + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// geometry : Redefines the joint geometry. If not provided, the existing geometry is used. This argument is + /// required if the current joint motion is rigid. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// from. + /// Returns true if the operation was successful. + bool setAsCylindricalJointMotion(JointDirections rotationAxis, const core::Ptr& geometry = NULL, const core::Ptr& customRotationAxisEntity = NULL); + + /// Redefines the relationship between the two joint geometries as a pin-slot joint. + /// To use this method, you need to position the timeline marker to immediately before this as-built joint. + /// This can be accomplished using the following code: thisAsBuiltJoint.timelineObject.rollTo(True) + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// slideDirection : Specifies which axis the slide direction is along. If this is set to CustomJointDirection then the + /// customSlideDirectionEntity argument must also be provided. + /// geometry : Redefines the joint geometry. If not provided, the existing geometry is used. This argument is + /// required if the current joint motion is rigid. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// customSlideDirectionEntity : If the slideDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the custom slide direction. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsPinSlotJointMotion(JointDirections rotationAxis, JointDirections slideDirection, const core::Ptr& geometry = NULL, const core::Ptr& customRotationAxisEntity = NULL, const core::Ptr& customSlideDirectionEntity = NULL); + + /// Redefines the relationship between the two joint geometries as a planar joint. + /// To use this method, you need to position the timeline marker to immediately before this as-built joint. + /// This can be accomplished using the following code: thisAsBuiltJoint.timelineObject.rollTo(True) + /// normalDirection : Defines the direction of the normal of the single degree of rotation. + /// This can be set to XAxisJointDirection, YAxisJointDirection, ZAxisJointDirection, + /// or CustomJointDirection. If set to CustomJointDirection then the customNormalDirectionEntity + /// argument must also be provided. + /// geometry : Redefines the joint geometry. If not provided, the existing geometry is used. This argument is + /// required if the current joint motion is rigid. + /// customNormalDirectionEntity : If the normalDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the direction of the normal. This can be several types of entities that can define a direction. + /// customPrimarySlideDirection : This arguments defines the direction of the primary slide direction. A default primary slide direction + /// is automatically chosen and will be used if this argument is not provided or is null. The secondary slide + /// direction is automatically inferred from the normal and primary slide directions. + /// Returns true if the operation was successful. + bool setAsPlanarJointMotion(JointDirections normalDirection, const core::Ptr& geometry = NULL, const core::Ptr& customNormalDirectionEntity = NULL, const core::Ptr& customPrimarySlideDirection = NULL); + + /// Redefines the relationship between the two joint geometries as a ball joint. + /// To use this method, you need to position the timeline marker to immediately before this as-built joint. + /// This can be accomplished using the following code: thisAsBuiltJoint.timelineObject.rollTo(True) + /// pitchDirection : Defines the direction the pitch angle is measured from. This can be ZAxisJointDirection or CustomJointDirection. If + /// CustomJointDirection is specified then you must also provide a value for the customPitchDirection argument. + /// yawDirection : Defines the direction the yaw is measured from. This can be XAxisJointDirection or CustomJointDirection. If + /// CustomJointDirection is specified then you must also provide a value for the customYawDirection argument. + /// geometry : Redefines the joint geometry. If not provided, the existing geometry is used. This argument is + /// required if the current joint motion is rigid. + /// customPitchDirection : If the pitchDirection argument is customPitchDirection this argument is used to define the direction the pitch + /// angel is measured from. This can be several types of entities that can define a direction. + /// customYawDirection : If the yawDirection argument is customPitchDirection this argument is used to define the direction the yaw + /// angel is measured from. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsBallJointMotion(JointDirections pitchDirection, JointDirections yawDirection, const core::Ptr& geometry = NULL, const core::Ptr& customPitchDirection = NULL, const core::Ptr& customYawDirection = NULL); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// Gets and sets if this as-built joint is suppressed. + bool isSuppressed() const; + bool isSuppressed(bool value); + + /// Gets and sets if the light bulb of this as-built joint as displayed in the browser is on or off. + /// A joint will only be visible if the light bulb is switched on. However, + /// the light bulb can be on and the joint still invisible if a higher level occurrence + /// in the assembly context is not visible because its light bulb is off or the joints folder + /// is light bulb is off. + bool isLightBulbOn() const; + bool isLightBulbOn(bool value); + + /// Gets whether the as-built joint is visible. To change the visibility see the isLightBulbOn property. + /// This property is affected by the assembly context. + bool isVisible() const; + + /// Returns the collection of attributes associated with this as-built joint. + core::Ptr attributes() const; + + /// Returns a token for the AsBuiltJoint object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same as-built joint. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_ASBUILTJOINT_API static const char* classType(); + ADSK_FUSION_ASBUILTJOINT_API const char* objectType() const override; + ADSK_FUSION_ASBUILTJOINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_ASBUILTJOINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Component* parentComponent_raw() const = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual Occurrence* occurrenceOne_raw() const = 0; + virtual Occurrence* occurrenceTwo_raw() const = 0; + virtual JointGeometry* geometry_raw() const = 0; + virtual bool geometry_raw(JointGeometry* value) = 0; + virtual bool deleteMe_raw() = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual JointMotion* jointMotion_raw() const = 0; + virtual bool setAsRigidJointMotion_raw() = 0; + virtual bool setAsRevoluteJointMotion_raw(JointDirections rotationAxis, JointGeometry* geometry, core::Base* customRotationAxisEntity) = 0; + virtual bool setAsSliderJointMotion_raw(JointDirections sliderDirection, JointGeometry* geometry, core::Base* customSliderDirectionEntity) = 0; + virtual bool setAsCylindricalJointMotion_raw(JointDirections rotationAxis, JointGeometry* geometry, core::Base* customRotationAxisEntity) = 0; + virtual bool setAsPinSlotJointMotion_raw(JointDirections rotationAxis, JointDirections slideDirection, JointGeometry* geometry, core::Base* customRotationAxisEntity, core::Base* customSlideDirectionEntity) = 0; + virtual bool setAsPlanarJointMotion_raw(JointDirections normalDirection, JointGeometry* geometry, core::Base* customNormalDirectionEntity, core::Base* customPrimarySlideDirection) = 0; + virtual bool setAsBallJointMotion_raw(JointDirections pitchDirection, JointDirections yawDirection, JointGeometry* geometry, core::Base* customPitchDirection, core::Base* customYawDirection) = 0; + virtual AsBuiltJoint* nativeObject_raw() const = 0; + virtual AsBuiltJoint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual bool isSuppressed_raw() const = 0; + virtual bool isSuppressed_raw(bool value) = 0; + virtual bool isLightBulbOn_raw() const = 0; + virtual bool isLightBulbOn_raw(bool value) = 0; + virtual bool isVisible_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr AsBuiltJoint::parentComponent() const +{ + core::Ptr res = parentComponent_raw(); + return res; +} + +inline std::string AsBuiltJoint::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool AsBuiltJoint::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline core::Ptr AsBuiltJoint::occurrenceOne() const +{ + core::Ptr res = occurrenceOne_raw(); + return res; +} + +inline core::Ptr AsBuiltJoint::occurrenceTwo() const +{ + core::Ptr res = occurrenceTwo_raw(); + return res; +} + +inline core::Ptr AsBuiltJoint::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline bool AsBuiltJoint::geometry(const core::Ptr& value) +{ + return geometry_raw(value.get()); +} + +inline bool AsBuiltJoint::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline core::Ptr AsBuiltJoint::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline core::Ptr AsBuiltJoint::jointMotion() const +{ + core::Ptr res = jointMotion_raw(); + return res; +} + +inline bool AsBuiltJoint::setAsRigidJointMotion() +{ + bool res = setAsRigidJointMotion_raw(); + return res; +} + +inline bool AsBuiltJoint::setAsRevoluteJointMotion(JointDirections rotationAxis, const core::Ptr& geometry, const core::Ptr& customRotationAxisEntity) +{ + bool res = setAsRevoluteJointMotion_raw(rotationAxis, geometry.get(), customRotationAxisEntity.get()); + return res; +} + +inline bool AsBuiltJoint::setAsSliderJointMotion(JointDirections sliderDirection, const core::Ptr& geometry, const core::Ptr& customSliderDirectionEntity) +{ + bool res = setAsSliderJointMotion_raw(sliderDirection, geometry.get(), customSliderDirectionEntity.get()); + return res; +} + +inline bool AsBuiltJoint::setAsCylindricalJointMotion(JointDirections rotationAxis, const core::Ptr& geometry, const core::Ptr& customRotationAxisEntity) +{ + bool res = setAsCylindricalJointMotion_raw(rotationAxis, geometry.get(), customRotationAxisEntity.get()); + return res; +} + +inline bool AsBuiltJoint::setAsPinSlotJointMotion(JointDirections rotationAxis, JointDirections slideDirection, const core::Ptr& geometry, const core::Ptr& customRotationAxisEntity, const core::Ptr& customSlideDirectionEntity) +{ + bool res = setAsPinSlotJointMotion_raw(rotationAxis, slideDirection, geometry.get(), customRotationAxisEntity.get(), customSlideDirectionEntity.get()); + return res; +} + +inline bool AsBuiltJoint::setAsPlanarJointMotion(JointDirections normalDirection, const core::Ptr& geometry, const core::Ptr& customNormalDirectionEntity, const core::Ptr& customPrimarySlideDirection) +{ + bool res = setAsPlanarJointMotion_raw(normalDirection, geometry.get(), customNormalDirectionEntity.get(), customPrimarySlideDirection.get()); + return res; +} + +inline bool AsBuiltJoint::setAsBallJointMotion(JointDirections pitchDirection, JointDirections yawDirection, const core::Ptr& geometry, const core::Ptr& customPitchDirection, const core::Ptr& customYawDirection) +{ + bool res = setAsBallJointMotion_raw(pitchDirection, yawDirection, geometry.get(), customPitchDirection.get(), customYawDirection.get()); + return res; +} + +inline core::Ptr AsBuiltJoint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr AsBuiltJoint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr AsBuiltJoint::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline bool AsBuiltJoint::isSuppressed() const +{ + bool res = isSuppressed_raw(); + return res; +} + +inline bool AsBuiltJoint::isSuppressed(bool value) +{ + return isSuppressed_raw(value); +} + +inline bool AsBuiltJoint::isLightBulbOn() const +{ + bool res = isLightBulbOn_raw(); + return res; +} + +inline bool AsBuiltJoint::isLightBulbOn(bool value) +{ + return isLightBulbOn_raw(value); +} + +inline bool AsBuiltJoint::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline core::Ptr AsBuiltJoint::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline std::string AsBuiltJoint::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_ASBUILTJOINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJointInput.h b/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJointInput.h new file mode 100644 index 0000000..cd60991 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJointInput.h @@ -0,0 +1,233 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_ASBUILTJOINTINPUT_CPP__ +# define ADSK_FUSION_ASBUILTJOINTINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_ASBUILTJOINTINPUT_API +# endif +#else +# define ADSK_FUSION_ASBUILTJOINTINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointGeometry; + class JointMotion; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Defines all of the information needed to create an as-built joint. +class AsBuiltJointInput : public core::Base { +public: + + /// Specifies the first of two occurrences the joint is between. + core::Ptr occurrenceOne() const; + bool occurrenceOne(const core::Ptr& value); + + /// Specifies the second of two occurrences the joint is between. + core::Ptr occurrenceTwo() const; + bool occurrenceTwo(const core::Ptr& value); + + /// Specifies the position of the joint. + core::Ptr geometry() const; + bool geometry(const core::Ptr& value); + + /// Defines the relationship between the two joint geometries as a rigid joint. + /// Returns true if successful. + bool setAsRigidJointMotion(); + + /// Defines the relationship between the two joint geometries as a revolute joint. + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// from. + /// Returns true if the operation was successful. + bool setAsRevoluteJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity = NULL); + + /// Defines the relationship between the two joint geometries as a slider joint. + /// sliderDirection : Specifies which axis the slide direction is along. If this is set to CustomJointDirection then the + /// customSliderDirectionEntity argument must also be provided. + /// customSliderDirectionEntity : If the sliderDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the custom slider direction. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsSliderJointMotion(JointDirections sliderDirection, const core::Ptr& customSliderDirectionEntity = NULL); + + /// Defines the relationship between the two joint geometries as a cylindrical joint. + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// from. + /// Returns true if the operation was successful. + bool setAsCylindricalJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity = NULL); + + /// Defines the relationship between the two joint geometries as a pin-slot joint. + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// slideDirection : Specifies which axis the slide direction is along. If this is set to CustomJointDirection then the + /// customSlideDirectionEntity argument must also be provided. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// customSlideDirectionEntity : If the slideDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the custom slide direction. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsPinSlotJointMotion(JointDirections rotationAxis, JointDirections slideDirection, const core::Ptr& customRotationAxisEntity = NULL, const core::Ptr& customSlideDirectionEntity = NULL); + + /// Defines the relationship between the two joint geometries as a planar joint. + /// normalDirection : Defines the direction of the normal of the single degree of rotation. + /// This can be set to XAxisJointDirection, YAxisJointDirection, ZAxisJointDirection, + /// or CustomJointDirection. If set to CustomJointDirection then the customNormalDirectionEntity + /// argument must also be provided. + /// customNormalDirectionEntity : If the normalDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the direction of the normal. This can be several types of entities that can define a direction. + /// customPrimarySlideDirection : This arguments defines the direction of the primary slide direction. A default primary slide direction + /// is automatically chosen and will be used if this argument is not provided or is null. The secondary slide + /// direction is automatically inferred from the normal and primary slide directions. + /// Returns true if the operation was successful. + bool setAsPlanarJointMotion(JointDirections normalDirection, const core::Ptr& customNormalDirectionEntity = NULL, const core::Ptr& customPrimarySlideDirection = NULL); + + /// Defines the relationship between the two joint geometries as a ball joint. + /// pitchDirection : Defines the direction the pitch angle is measured from. This can be ZAxisJointDirection or CustomJointDirection. If + /// CustomJointDirection is specified then you must also provide a value for the customPitchDirection argument. + /// yawDirection : Defines the direction the yaw is measured from. This can be XAxisJointDirection or CustomJointDirection. If + /// CustomJointDirection is specified then you must also provide a value for the customYawDirection argument. + /// customPitchDirection : If the pitchDirection argument is customPitchDirection this argument is used to define the direction the pitch + /// angel is measured from. This can be several types of entities that can define a direction. + /// customYawDirection : If the yawDirection argument is customPitchDirection this argument is used to define the direction the yaw + /// angel is measured from. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsBallJointMotion(JointDirections pitchDirection, JointDirections yawDirection, const core::Ptr& customPitchDirection = NULL, const core::Ptr& customYawDirection = NULL); + + /// Returns one of the objects derived from JointMotion that defines how the motion between + /// the two joint geometries is defined. Can be null if the motion hasn't yet been defined. + core::Ptr jointMotion() const; + + ADSK_FUSION_ASBUILTJOINTINPUT_API static const char* classType(); + ADSK_FUSION_ASBUILTJOINTINPUT_API const char* objectType() const override; + ADSK_FUSION_ASBUILTJOINTINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_ASBUILTJOINTINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Occurrence* occurrenceOne_raw() const = 0; + virtual bool occurrenceOne_raw(Occurrence* value) = 0; + virtual Occurrence* occurrenceTwo_raw() const = 0; + virtual bool occurrenceTwo_raw(Occurrence* value) = 0; + virtual JointGeometry* geometry_raw() const = 0; + virtual bool geometry_raw(JointGeometry* value) = 0; + virtual bool setAsRigidJointMotion_raw() = 0; + virtual bool setAsRevoluteJointMotion_raw(JointDirections rotationAxis, core::Base* customRotationAxisEntity) = 0; + virtual bool setAsSliderJointMotion_raw(JointDirections sliderDirection, core::Base* customSliderDirectionEntity) = 0; + virtual bool setAsCylindricalJointMotion_raw(JointDirections rotationAxis, core::Base* customRotationAxisEntity) = 0; + virtual bool setAsPinSlotJointMotion_raw(JointDirections rotationAxis, JointDirections slideDirection, core::Base* customRotationAxisEntity, core::Base* customSlideDirectionEntity) = 0; + virtual bool setAsPlanarJointMotion_raw(JointDirections normalDirection, core::Base* customNormalDirectionEntity, core::Base* customPrimarySlideDirection) = 0; + virtual bool setAsBallJointMotion_raw(JointDirections pitchDirection, JointDirections yawDirection, core::Base* customPitchDirection, core::Base* customYawDirection) = 0; + virtual JointMotion* jointMotion_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr AsBuiltJointInput::occurrenceOne() const +{ + core::Ptr res = occurrenceOne_raw(); + return res; +} + +inline bool AsBuiltJointInput::occurrenceOne(const core::Ptr& value) +{ + return occurrenceOne_raw(value.get()); +} + +inline core::Ptr AsBuiltJointInput::occurrenceTwo() const +{ + core::Ptr res = occurrenceTwo_raw(); + return res; +} + +inline bool AsBuiltJointInput::occurrenceTwo(const core::Ptr& value) +{ + return occurrenceTwo_raw(value.get()); +} + +inline core::Ptr AsBuiltJointInput::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline bool AsBuiltJointInput::geometry(const core::Ptr& value) +{ + return geometry_raw(value.get()); +} + +inline bool AsBuiltJointInput::setAsRigidJointMotion() +{ + bool res = setAsRigidJointMotion_raw(); + return res; +} + +inline bool AsBuiltJointInput::setAsRevoluteJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity) +{ + bool res = setAsRevoluteJointMotion_raw(rotationAxis, customRotationAxisEntity.get()); + return res; +} + +inline bool AsBuiltJointInput::setAsSliderJointMotion(JointDirections sliderDirection, const core::Ptr& customSliderDirectionEntity) +{ + bool res = setAsSliderJointMotion_raw(sliderDirection, customSliderDirectionEntity.get()); + return res; +} + +inline bool AsBuiltJointInput::setAsCylindricalJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity) +{ + bool res = setAsCylindricalJointMotion_raw(rotationAxis, customRotationAxisEntity.get()); + return res; +} + +inline bool AsBuiltJointInput::setAsPinSlotJointMotion(JointDirections rotationAxis, JointDirections slideDirection, const core::Ptr& customRotationAxisEntity, const core::Ptr& customSlideDirectionEntity) +{ + bool res = setAsPinSlotJointMotion_raw(rotationAxis, slideDirection, customRotationAxisEntity.get(), customSlideDirectionEntity.get()); + return res; +} + +inline bool AsBuiltJointInput::setAsPlanarJointMotion(JointDirections normalDirection, const core::Ptr& customNormalDirectionEntity, const core::Ptr& customPrimarySlideDirection) +{ + bool res = setAsPlanarJointMotion_raw(normalDirection, customNormalDirectionEntity.get(), customPrimarySlideDirection.get()); + return res; +} + +inline bool AsBuiltJointInput::setAsBallJointMotion(JointDirections pitchDirection, JointDirections yawDirection, const core::Ptr& customPitchDirection, const core::Ptr& customYawDirection) +{ + bool res = setAsBallJointMotion_raw(pitchDirection, yawDirection, customPitchDirection.get(), customYawDirection.get()); + return res; +} + +inline core::Ptr AsBuiltJointInput::jointMotion() const +{ + core::Ptr res = jointMotion_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_ASBUILTJOINTINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJointList.h b/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJointList.h new file mode 100644 index 0000000..f1d9179 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJointList.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_ASBUILTJOINTLIST_CPP__ +# define ADSK_FUSION_ASBUILTJOINTLIST_API XI_EXPORT +# else +# define ADSK_FUSION_ASBUILTJOINTLIST_API +# endif +#else +# define ADSK_FUSION_ASBUILTJOINTLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class AsBuiltJoint; +}} + +namespace adsk { namespace fusion { + +/// A list of as-built joints. +class AsBuiltJointList : public core::Base { +public: + + /// Function that returns the specified as-built joint using an index into the list. + /// index : The index of the item within the list to return. The first item in the list has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified as-built joint using a name. + /// name : The name of the item within the list to return. + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns number of as-built joints in the list. + size_t count() const; + + typedef AsBuiltJoint iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_ASBUILTJOINTLIST_API static const char* classType(); + ADSK_FUSION_ASBUILTJOINTLIST_API const char* objectType() const override; + ADSK_FUSION_ASBUILTJOINTLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_ASBUILTJOINTLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual AsBuiltJoint* item_raw(size_t index) const = 0; + virtual AsBuiltJoint* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr AsBuiltJointList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr AsBuiltJointList::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t AsBuiltJointList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void AsBuiltJointList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_ASBUILTJOINTLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJoints.h b/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJoints.h new file mode 100644 index 0000000..6c4e375 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/AsBuiltJoints.h @@ -0,0 +1,136 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_ASBUILTJOINTS_CPP__ +# define ADSK_FUSION_ASBUILTJOINTS_API XI_EXPORT +# else +# define ADSK_FUSION_ASBUILTJOINTS_API +# endif +#else +# define ADSK_FUSION_ASBUILTJOINTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class AsBuiltJoint; + class AsBuiltJointInput; + class JointGeometry; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// The collection of as-built joints in this component. This provides access to all existing +/// as-built joints and supports the ability to create new as-built joints. +class AsBuiltJoints : public core::Base { +public: + + /// Function that returns the specified as-built joint using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified as-built joint using a name. + /// name : The name of the item within the collection to return. + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns number of joint origins in the collection. + size_t count() const; + + /// Creates an AsBuiltJointInput object which is used to collect all of the information needed + /// to create an as-built joint. This object is equivalent to the as-built joint dialog in the + /// user-interface in that it doesn't represent an actual joint but just the information needed + /// to create an as-built joint. Once this is fully defined the add method can be called, passing + /// this object in to create the actual joint. + /// occurrenceOne : Specifies the first of two occurrences the joint is between. + /// occurrenceTwo : Specifies the second of two occurrences the joint is between. + /// geometry : Specifies the geometry of where the joint will be positioned. If the as-built joint is + /// a rigid joint, this argument should be null because no geometry is needed. + /// Returns the new AsBuiltJointInput object or null in the case of failure. + core::Ptr createInput(const core::Ptr& occurrenceOne, const core::Ptr& occurrenceTwo, const core::Ptr& geometry); + + /// Creates a new as-built joint. + /// input : An AsBuiltJointInput object that was created using the AsBuiltJoints.createInput method and then fully defined + /// using the properties and methods on the AsBuiltJointInput object. + /// Returns the new AsBuiltJoint object or null in the case of failure. + core::Ptr add(const core::Ptr& input); + + typedef AsBuiltJoint iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_ASBUILTJOINTS_API static const char* classType(); + ADSK_FUSION_ASBUILTJOINTS_API const char* objectType() const override; + ADSK_FUSION_ASBUILTJOINTS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_ASBUILTJOINTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual AsBuiltJoint* item_raw(size_t index) const = 0; + virtual AsBuiltJoint* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual AsBuiltJointInput* createInput_raw(Occurrence* occurrenceOne, Occurrence* occurrenceTwo, JointGeometry* geometry) = 0; + virtual AsBuiltJoint* add_raw(AsBuiltJointInput* input) = 0; +}; + +// Inline wrappers + +inline core::Ptr AsBuiltJoints::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr AsBuiltJoints::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t AsBuiltJoints::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr AsBuiltJoints::createInput(const core::Ptr& occurrenceOne, const core::Ptr& occurrenceTwo, const core::Ptr& geometry) +{ + core::Ptr res = createInput_raw(occurrenceOne.get(), occurrenceTwo.get(), geometry.get()); + return res; +} + +inline core::Ptr AsBuiltJoints::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +template inline void AsBuiltJoints::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_ASBUILTJOINTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/BallJointMotion.h b/usr/autodesk/CPP/include/Fusion/Components/BallJointMotion.h new file mode 100644 index 0000000..ac5cea4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/BallJointMotion.h @@ -0,0 +1,269 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "JointMotion.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BALLJOINTMOTION_CPP__ +# define ADSK_FUSION_BALLJOINTMOTION_API XI_EXPORT +# else +# define ADSK_FUSION_BALLJOINTMOTION_API +# endif +#else +# define ADSK_FUSION_BALLJOINTMOTION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointLimits; +}} +namespace adsk { namespace core { + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Represents the set of information specific to a ball joint. +class BallJointMotion : public JointMotion { +public: + + /// Gets and sets the direction that the pitch is measured from. + /// This can only be set to ZAxisJointDirection and can return ZAxisJointDirection + /// or CustomJointDirection. If this returns CustomJointDirection then the + /// customNormalDirectionEntity will return an entity that defines the direction. + /// If there is a custom direction defined and this property is set to ZAxisJointDirection, + /// the custom direction will be removed and customNormalDirectionEntity will return null. + JointDirections pitchDirection() const; + bool pitchDirection(JointDirections value); + + /// This property defines a custom pitch direction and can be set using various types + /// of entities that can infer a direction. For example, a linear edge, sketch line, + /// planar face, and cylindrical face.This property is only valid in the case where the + /// pitchDirection property returns CustomJointDirection. Setting this property will + /// automatically set the pitchDirection property to CustomJointDirection. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + core::Ptr customPitchDirectionEntity() const; + bool customPitchDirectionEntity(const core::Ptr& value); + + /// Returns the direction that the pitch angle is measured from. This property will return null in the case + /// where the BallJointMotion object was obtained from a JointInput object. + core::Ptr pitchDirectionVector() const; + + /// Gets and sets the direction that the pitch is measured from. + /// This can only be set to XAxisJointDirection and can return XAxisJointDirection + /// or CustomJointDirection. If this returns CustomJointDirection then the + /// customYawDirectionEntity will return an entity that defines the direction. + /// If there is a custom direction defined and this property is set to XAxisJointDirection, + /// the custom direction will be removed and customYawDirectionEntity will return null. + JointDirections yawDirection() const; + bool yawDirection(JointDirections value); + + /// This property defines a custom yaw direction and can be set using various types + /// of entities that can infer a direction. For example, a linear edge, sketch line, + /// planar face, and cylindrical face.This property is only valid in the case where the + /// yawDirection property returns CustomJointDirection. Setting this property will + /// automatically set the yawDirection property to CustomJointDirection. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + core::Ptr customYawDirectionEntity() const; + bool customYawDirectionEntity(const core::Ptr& value); + + /// Returns the direction that the yaw angle is measured from. This property will return null in the case + /// where the BallJointMotion object was obtained from a JointInput object. + core::Ptr yawDirectionVector() const; + + /// Returns the direction that the roll angle is measured from. This property will return null in the case + /// where the BallJointMotion object was obtained from a JointInput object. + core::Ptr rollDirectionVector() const; + + /// Gets and sets the pitch value. This is in radians. Setting this value is + /// the equivalent of using the Drive Joints command. + double pitchValue() const; + bool pitchValue(double value); + + /// Returns a JointLimits object that defines the limits of rotation for the pitch. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr pitchLimits() const; + + /// Gets and sets the yaw value. This is in radians. Setting this value is + /// the equivalent of using the Drive Joints command. + double yawValue() const; + bool yawValue(double value); + + /// Returns a JointLimits object that defines the limits of rotation for the yaw. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr yawLimits() const; + + /// Gets and sets the roll value. This is in radians. Setting this value is + /// the equivalent of using the Drive Joints command. + double rollValue() const; + bool rollValue(double value); + + /// Returns a JointLimits object that defines the limits of rotation for the roll. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr rollLimits() const; + + ADSK_FUSION_BALLJOINTMOTION_API static const char* classType(); + ADSK_FUSION_BALLJOINTMOTION_API const char* objectType() const override; + ADSK_FUSION_BALLJOINTMOTION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BALLJOINTMOTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual JointDirections pitchDirection_raw() const = 0; + virtual bool pitchDirection_raw(JointDirections value) = 0; + virtual core::Base* customPitchDirectionEntity_raw() const = 0; + virtual bool customPitchDirectionEntity_raw(core::Base* value) = 0; + virtual core::Vector3D* pitchDirectionVector_raw() const = 0; + virtual JointDirections yawDirection_raw() const = 0; + virtual bool yawDirection_raw(JointDirections value) = 0; + virtual core::Base* customYawDirectionEntity_raw() const = 0; + virtual bool customYawDirectionEntity_raw(core::Base* value) = 0; + virtual core::Vector3D* yawDirectionVector_raw() const = 0; + virtual core::Vector3D* rollDirectionVector_raw() const = 0; + virtual double pitchValue_raw() const = 0; + virtual bool pitchValue_raw(double value) = 0; + virtual JointLimits* pitchLimits_raw() const = 0; + virtual double yawValue_raw() const = 0; + virtual bool yawValue_raw(double value) = 0; + virtual JointLimits* yawLimits_raw() const = 0; + virtual double rollValue_raw() const = 0; + virtual bool rollValue_raw(double value) = 0; + virtual JointLimits* rollLimits_raw() const = 0; +}; + +// Inline wrappers + +inline JointDirections BallJointMotion::pitchDirection() const +{ + JointDirections res = pitchDirection_raw(); + return res; +} + +inline bool BallJointMotion::pitchDirection(JointDirections value) +{ + return pitchDirection_raw(value); +} + +inline core::Ptr BallJointMotion::customPitchDirectionEntity() const +{ + core::Ptr res = customPitchDirectionEntity_raw(); + return res; +} + +inline bool BallJointMotion::customPitchDirectionEntity(const core::Ptr& value) +{ + return customPitchDirectionEntity_raw(value.get()); +} + +inline core::Ptr BallJointMotion::pitchDirectionVector() const +{ + core::Ptr res = pitchDirectionVector_raw(); + return res; +} + +inline JointDirections BallJointMotion::yawDirection() const +{ + JointDirections res = yawDirection_raw(); + return res; +} + +inline bool BallJointMotion::yawDirection(JointDirections value) +{ + return yawDirection_raw(value); +} + +inline core::Ptr BallJointMotion::customYawDirectionEntity() const +{ + core::Ptr res = customYawDirectionEntity_raw(); + return res; +} + +inline bool BallJointMotion::customYawDirectionEntity(const core::Ptr& value) +{ + return customYawDirectionEntity_raw(value.get()); +} + +inline core::Ptr BallJointMotion::yawDirectionVector() const +{ + core::Ptr res = yawDirectionVector_raw(); + return res; +} + +inline core::Ptr BallJointMotion::rollDirectionVector() const +{ + core::Ptr res = rollDirectionVector_raw(); + return res; +} + +inline double BallJointMotion::pitchValue() const +{ + double res = pitchValue_raw(); + return res; +} + +inline bool BallJointMotion::pitchValue(double value) +{ + return pitchValue_raw(value); +} + +inline core::Ptr BallJointMotion::pitchLimits() const +{ + core::Ptr res = pitchLimits_raw(); + return res; +} + +inline double BallJointMotion::yawValue() const +{ + double res = yawValue_raw(); + return res; +} + +inline bool BallJointMotion::yawValue(double value) +{ + return yawValue_raw(value); +} + +inline core::Ptr BallJointMotion::yawLimits() const +{ + core::Ptr res = yawLimits_raw(); + return res; +} + +inline double BallJointMotion::rollValue() const +{ + double res = rollValue_raw(); + return res; +} + +inline bool BallJointMotion::rollValue(double value) +{ + return rollValue_raw(value); +} + +inline core::Ptr BallJointMotion::rollLimits() const +{ + core::Ptr res = rollLimits_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BALLJOINTMOTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/BaseComponent.h b/usr/autodesk/CPP/include/Fusion/Components/BaseComponent.h new file mode 100644 index 0000000..2949c9a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/BaseComponent.h @@ -0,0 +1,291 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BASECOMPONENT_CPP__ +# define ADSK_FUSION_BASECOMPONENT_API XI_EXPORT +# else +# define ADSK_FUSION_BASECOMPONENT_API +# endif +#else +# define ADSK_FUSION_BASECOMPONENT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBodies; + class Component; + class ConstructionAxes; + class ConstructionPlanes; + class ConstructionPoints; + class Design; + class OccurrenceList; + class Occurrences; +}} +namespace adsk { namespace core { + class ObjectCollection; + class Point3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// The BaseComponent object that defines all of the common design data +/// and is the base class for the product specific components. +class BaseComponent : public core::Base { +public: + + /// Property that gets and sets the name of this component. This is the name + /// shown in the browser for each occurrence referencing this component. + std::string name() const; + bool name(const std::string& value); + + /// Property that returns the Occurrences collection associated with this component. + /// This provides access to the occurrences at the top-level of this component and provides + /// the functionality to add new occurrences. + core::Ptr occurrences() const; + + /// Returns all occurrences at the top-level of this component that reference the specified component. + /// The returned list is read-only. + /// component : The component that is being referenced by the occurrences that will be returned. + /// The occurrences referenced by the specified component. + core::Ptr occurrencesByComponent(const core::Ptr& component) const; + + /// Returns all of the occurrences in the assembly regardless of their level within the assembly structure. + /// The returned list is read-only. + core::Ptr allOccurrences() const; + + /// Returns all occurrences, at any level of the assembly, that reference the specified component. + /// The returned list is read-only. + /// component : The component that is being referenced by the occurrences that will be returned. + /// The occurrences referenced by the specified component. + core::Ptr allOccurrencesByComponent(const core::Ptr& component) const; + + /// Returns the construction planes collection associated with this component. + /// This provides access to the existing construction planes and supports + /// the creation of new construction planes. + core::Ptr constructionPlanes() const; + + /// Returns the construction axes collection associated with this component. + /// This provides access to the existing construction axes and supports + /// the creation of new construction axes. + core::Ptr constructionAxes() const; + + /// Returns the construction points collection associated with this component. + /// This provides access to the existing construction points and supports + /// the creation of new construction points. + core::Ptr constructionPoints() const; + + /// Returns the B-Rep bodies collection associated with this component. + core::Ptr bRepBodies() const; + + /// Returns the parent product this component is owned by. + core::Ptr parentDesign() const; + + /// Finds all the B-Rep entities that are intersected by the specified ray. This can return BRepFace, BrepEdge, + /// and BRepVertex objects. + /// originPoint : Input point that defines the origin of the ray. The search for entities begins at this point. + /// rayDirection : Input vector that defines the direction of the ray. The ray is infinite so the length of the vector is ignored. + /// entityType : The type of B-Rep entity wanted. You can also take advantage of B-Rep topology to infer other intersections. For example, + /// If you get a BRepEdge it implies that the faces the edge connects were also intersected. If a BRepVertex is returned it + /// implies the edges that the vertex connects were intersected and the faces that the edges connect were intersected. + /// proximityTolerance : Optional argument that specifies the tolerance for the search. All entities within this distance from the ray and of the specified type will be returned. If not specified a default small tolerance is used. + /// visibleEntitiesOnly : Optional argument that indicates whether or not invisible entities should be included in the search. Defaults to True indicating that invisible entities will be ignored. + /// hitPoints : An ObjectCollection of Point3D objects that represent the coordinates where the ray hit the found entity. There will be the same number of hit points as returned entities + /// and they will be in the collections in the same order. In other words, hit point 1 corresponds with found entity 1, hit point 2 corresponds with found entity 2, and so on. + /// Because of the proximity tolerance the hitPoint may not actually lie on the entity but will be within the proximity tolerance to it. + /// It's an optional out argument, returns the hit points if an existing ObjectCollection is input. You can create a new ObjectCollection by using + /// the static create method on the ObjectCollection class. + /// Returns an ObjectCollection containing the entities found. The returned collection can be empty indicating nothing was found. The points are returned + /// in an order where they are arranged based on their distance from the origin point where the closest point is first. If an entity is hit more than + /// once, the entity is returned once for the first intersection. + core::Ptr findBRepUsingRay(const core::Ptr& originPoint, const core::Ptr& rayDirection, BRepEntityTypes entityType, double proximityTolerance = -1, bool visibleEntitiesOnly = true, const core::Ptr& hitPoints = NULL); + + /// Finds all the entities of the specified type at the specified location. + /// point : Input coordinate that specifies the component space point at which to find the entities. + /// entityType : The type of B-Rep entity wanted. You can also take advantage of B-Rep topology to infer other that other entities were found. For example, + /// If you get a BRepEdge it implies that the faces the edge connects were also found. If a BRepVertex is returned it + /// implies the edges that the vertex connects were found and the faces that the edges connect were found. + /// proximityTolerance : Specifies the tolerance for the search. All entities within this distance from the search point that match the filter will be returned. If not specified a default tolerance is used. + /// visibleEntitiesOnly : indicates whether or not invisible objects should be included in the search. Defaults to True indicating that invisible objects will be ignored. + /// Returns an ObjectCollection containing the entities found. The returned collection can be empty indicating nothing was found. + core::Ptr findBRepUsingPoint(const core::Ptr& point, BRepEntityTypes entityType, double proximityTolerance = -1, bool visibleEntitiesOnly = true); + + ADSK_FUSION_BASECOMPONENT_API static const char* classType(); + ADSK_FUSION_BASECOMPONENT_API const char* objectType() const override; + ADSK_FUSION_BASECOMPONENT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BASECOMPONENT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual Occurrences* occurrences_raw() const = 0; + virtual OccurrenceList* occurrencesByComponent_raw(Component* component) const = 0; + virtual OccurrenceList* allOccurrences_raw() const = 0; + virtual OccurrenceList* allOccurrencesByComponent_raw(Component* component) const = 0; + virtual ConstructionPlanes* constructionPlanes_raw() const = 0; + virtual ConstructionAxes* constructionAxes_raw() const = 0; + virtual ConstructionPoints* constructionPoints_raw() const = 0; + virtual BRepBodies* bRepBodies_raw() const = 0; + virtual Design* parentDesign_raw() const = 0; + virtual core::ObjectCollection* findBRepUsingRay_raw(core::Point3D* originPoint, core::Vector3D* rayDirection, BRepEntityTypes entityType, double proximityTolerance, bool visibleEntitiesOnly, core::ObjectCollection* hitPoints) = 0; + virtual core::ObjectCollection* findBRepUsingPoint_raw(core::Point3D* point, BRepEntityTypes entityType, double proximityTolerance, bool visibleEntitiesOnly) = 0; + virtual void placeholderBaseComponent0() {} + virtual void placeholderBaseComponent1() {} + virtual void placeholderBaseComponent2() {} + virtual void placeholderBaseComponent3() {} + virtual void placeholderBaseComponent4() {} + virtual void placeholderBaseComponent5() {} + virtual void placeholderBaseComponent6() {} + virtual void placeholderBaseComponent7() {} + virtual void placeholderBaseComponent8() {} + virtual void placeholderBaseComponent9() {} + virtual void placeholderBaseComponent10() {} + virtual void placeholderBaseComponent11() {} + virtual void placeholderBaseComponent12() {} + virtual void placeholderBaseComponent13() {} + virtual void placeholderBaseComponent14() {} + virtual void placeholderBaseComponent15() {} + virtual void placeholderBaseComponent16() {} + virtual void placeholderBaseComponent17() {} + virtual void placeholderBaseComponent18() {} + virtual void placeholderBaseComponent19() {} + virtual void placeholderBaseComponent20() {} + virtual void placeholderBaseComponent21() {} + virtual void placeholderBaseComponent22() {} + virtual void placeholderBaseComponent23() {} + virtual void placeholderBaseComponent24() {} + virtual void placeholderBaseComponent25() {} + virtual void placeholderBaseComponent26() {} + virtual void placeholderBaseComponent27() {} + virtual void placeholderBaseComponent28() {} + virtual void placeholderBaseComponent29() {} + virtual void placeholderBaseComponent30() {} + virtual void placeholderBaseComponent31() {} + virtual void placeholderBaseComponent32() {} + virtual void placeholderBaseComponent33() {} + virtual void placeholderBaseComponent34() {} + virtual void placeholderBaseComponent35() {} + virtual void placeholderBaseComponent36() {} + virtual void placeholderBaseComponent37() {} + virtual void placeholderBaseComponent38() {} + virtual void placeholderBaseComponent39() {} + virtual void placeholderBaseComponent40() {} + virtual void placeholderBaseComponent41() {} + virtual void placeholderBaseComponent42() {} + virtual void placeholderBaseComponent43() {} + virtual void placeholderBaseComponent44() {} + virtual void placeholderBaseComponent45() {} + virtual void placeholderBaseComponent46() {} + virtual void placeholderBaseComponent47() {} + virtual void placeholderBaseComponent48() {} + virtual void placeholderBaseComponent49() {} + virtual void placeholderBaseComponent50() {} +}; + +// Inline wrappers + +inline std::string BaseComponent::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool BaseComponent::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline core::Ptr BaseComponent::occurrences() const +{ + core::Ptr res = occurrences_raw(); + return res; +} + +inline core::Ptr BaseComponent::occurrencesByComponent(const core::Ptr& component) const +{ + core::Ptr res = occurrencesByComponent_raw(component.get()); + return res; +} + +inline core::Ptr BaseComponent::allOccurrences() const +{ + core::Ptr res = allOccurrences_raw(); + return res; +} + +inline core::Ptr BaseComponent::allOccurrencesByComponent(const core::Ptr& component) const +{ + core::Ptr res = allOccurrencesByComponent_raw(component.get()); + return res; +} + +inline core::Ptr BaseComponent::constructionPlanes() const +{ + core::Ptr res = constructionPlanes_raw(); + return res; +} + +inline core::Ptr BaseComponent::constructionAxes() const +{ + core::Ptr res = constructionAxes_raw(); + return res; +} + +inline core::Ptr BaseComponent::constructionPoints() const +{ + core::Ptr res = constructionPoints_raw(); + return res; +} + +inline core::Ptr BaseComponent::bRepBodies() const +{ + core::Ptr res = bRepBodies_raw(); + return res; +} + +inline core::Ptr BaseComponent::parentDesign() const +{ + core::Ptr res = parentDesign_raw(); + return res; +} + +inline core::Ptr BaseComponent::findBRepUsingRay(const core::Ptr& originPoint, const core::Ptr& rayDirection, BRepEntityTypes entityType, double proximityTolerance, bool visibleEntitiesOnly, const core::Ptr& hitPoints) +{ + core::Ptr res = findBRepUsingRay_raw(originPoint.get(), rayDirection.get(), entityType, proximityTolerance, visibleEntitiesOnly, hitPoints.get()); + return res; +} + +inline core::Ptr BaseComponent::findBRepUsingPoint(const core::Ptr& point, BRepEntityTypes entityType, double proximityTolerance, bool visibleEntitiesOnly) +{ + core::Ptr res = findBRepUsingPoint_raw(point.get(), entityType, proximityTolerance, visibleEntitiesOnly); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BASECOMPONENT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/Component.h b/usr/autodesk/CPP/include/Fusion/Components/Component.h new file mode 100644 index 0000000..4af41f2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/Component.h @@ -0,0 +1,725 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "BaseComponent.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COMPONENT_CPP__ +# define ADSK_FUSION_COMPONENT_API XI_EXPORT +# else +# define ADSK_FUSION_COMPONENT_API +# endif +#else +# define ADSK_FUSION_COMPONENT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class AsBuiltJoint; + class AsBuiltJoints; + class ConstructionAxis; + class ConstructionPlane; + class ConstructionPoint; + class CustomGraphicsGroups; + class Features; + class Joint; + class JointOrigin; + class JointOrigins; + class Joints; + class MeshBodies; + class ModelParameters; + class Occurrence; + class PhysicalProperties; + class Profile; + class RigidGroup; + class RigidGroups; + class Sketches; +}} +namespace adsk { namespace core { + class Attributes; + class BoundingBox3D; + class DataFileFuture; + class DataFolder; + class Material; + class Matrix3D; +}} + +namespace adsk { namespace fusion { + +/// Represents a component in the data model. +/// A component represents a set of geometry, features, and parameters that make up an item in the design. +/// A component can be referenced multiple times into a design with a Occurrence object. +class Component : public BaseComponent { +public: + + /// Returns the sketches collection associated with this component. + /// This provides access to the existing sketches and supports + /// the creation of new sketches. + core::Ptr sketches() const; + + /// Returns the collection that provides access to all of the features + /// associated with this component. + core::Ptr features() const; + + /// Returns the mesh bodies collection associated with this component. + core::Ptr meshBodies() const; + + /// Returns the collection of model parameters in the Component. + core::Ptr modelParameters() const; + + /// Gets and sets if the light bulb of the origin folder as seen in the browser is on or off. + /// This controls the visibility of the origin construction geometry. + bool isOriginFolderLightBulbOn() const; + bool isOriginFolderLightBulbOn(bool value); + + /// Gets and sets if the light bulb of the construction folder as seen in the browser is on or off. + /// This controls the visibility of the (non-origin) construction geometry + /// (i.e. planes, points, axes). + bool isConstructionFolderLightBulbOn() const; + bool isConstructionFolderLightBulbOn(bool value); + + /// Gets and sets if the light bulb of the sketch folder as seen in the browser is on or off. + /// This controls the visibility of the sketches in this component. + bool isSketchFolderLightBulbOn() const; + bool isSketchFolderLightBulbOn(bool value); + + /// Returns the XY origin construction plane. + core::Ptr xYConstructionPlane() const; + + /// Returns the XZ origin construction plane. + core::Ptr xZConstructionPlane() const; + + /// Returns the YZ origin construction plane. + core::Ptr yZConstructionPlane() const; + + /// Returns the X origin construction axis. + core::Ptr xConstructionAxis() const; + + /// Returns the Y origin construction axis. + core::Ptr yConstructionAxis() const; + + /// Returns the Z origin construction axis. + core::Ptr zConstructionAxis() const; + + /// Returns the origin construction point. + core::Ptr originConstructionPoint() const; + + /// Gets and sets the part number associated with this component. Setting this + /// to an empty string will reset it to be the same as the component name. + std::string partNumber() const; + bool partNumber(const std::string& value); + + /// Gets and sets the description associated with this component. + std::string description() const; + bool description(const std::string& value); + + /// Creates an open profile based on the input curve(s). + /// curves : A SketchCurve or an ObjectCollection containing multiple sketch entities. If a single sketch curve + /// is input the chainCurves argument is checked to determine if connected curves (they do not need to be tangent) + /// should be automatically found. If multiple curves are provided the chainCurves argument is always + /// treated as false so you must provide all of the curves in the object collection that you want included in the profile. + /// The provided curves must all connect together in a single path. + /// The input curves do not need to be in the same sketch, but they do need to geometrically connect for + /// a valid profile to be created. + /// chainCurves : If true, this finds any curves within the same sketch that connect to the single input curve and automatically includes them in the profile. If + /// false, only the curves provided will be used to define the profile. This argument is ignored and treated as false if multiple curves are input. + /// Returns the new Profile object or null in the case of a failure. + core::Ptr createOpenProfile(const core::Ptr& curves, bool chainCurves = true); + + /// Creates a profile based on the outside open edges of a BRepFace. + /// edges : A single BRepEdge object or an ObjectCollection containing multiple BRepEdge objects, or a BRepLoop object. If a single edge + /// is input, the chainEdges argument is checked to determine if connected edges (they do not need to be tangent) + /// should be automatically found. If multiple edges are provided the chainEdges argument is always + /// treated as false so you must provide all of the edges in the object collection that you want included in the profile. + /// and the edges must all connect together in a single path. if a BRepLoop object is provided, all of the edges in the loop + /// are included in the profile and the chainEdges argument is ignored. + /// chainEdges : If true, this finds any edges that connect to the single input edge and automatically includes them in the profile. If + /// false, only the edges provided will be used to define the profile. This argument is ignored and treated as false if multiple edges + /// or a BRepLoop is input. + /// Returns the new Profile object or null in the case of a failure. + core::Ptr createBRepEdgeProfile(const core::Ptr& edges, bool chainEdges = true); + + /// Returns the collection of joints associated with this component. + core::Ptr joints() const; + + /// This property was incorrectly spelled and has been replaced with the JointOrigins property. + /// However, this needs to remain in the implementation to continue to support programs that + /// already used it, but it will be hidden in the documentation. + core::Ptr jointOrgins() const; + + /// Returns the collection of as-built joints associated with this component. + core::Ptr asBuiltJoints() const; + + /// Returns the collection of rigid groups associated with this component. + core::Ptr rigidGroups() const; + + /// Gets and sets the physical material assigned to this component. + core::Ptr material() const; + bool material(const core::Ptr& value); + + /// Returns the PhysicalProperties object that has properties for getting the area, density, mass, volume, moments, etc + /// of this component. Property values will be calculated using the 'LowCalculationAccuracy' setting when using this property + /// to get the PhysicalProperties object. To specify a higher calculation tolerance, use the getPhysicalProperties method instead. + core::Ptr physicalProperties() const; + + /// Performs a Save Copy As on this component. This saves the specified component as a new document + /// in the specified location. + /// name : The name to use for the new document. If this is an empty string, Fusion 360 will use the + /// name of the component being saved. + /// dataFolder : The data folder to save the new document to. + /// description : The description string of the document. This can be an empty string. + /// tag : The tag string of the document. This can be an empty string. + /// Returns a DataFileFuture object that can be used to track the progress of the upload and get the + /// resulting DataFile once it's available on A360. + core::Ptr saveCopyAs(const std::string& name, const core::Ptr& dataFolder, const std::string& description, const std::string& tag) const; + + /// Returns the bounding box of this component. This is always in world space of the component. + core::Ptr boundingBox() const; + + /// Gets and sets if the light bulb of the joints folder as seen in the browser is on or off. + /// This controls the visibility of the joints in this occurrence. The light bulb for the + /// folder is component specific and will turn off the joints for all occurrences referencing + /// the component. + bool isJointsFolderLightBulbOn() const; + bool isJointsFolderLightBulbOn(bool value); + + /// Returns the collection of attributes associated with this face. + core::Ptr attributes() const; + + /// Gets and sets if the light bulb of the bodies folder as seen in the browser is on or off. + /// This controls the visibility of the solid/surface bodies and the mesh bodies in this component. + bool isBodiesFolderLightBulbOn() const; + bool isBodiesFolderLightBulbOn(bool value); + + /// Returns the PhysicalProperties object that has properties for getting the area, density, mass, volume, moments, etc + /// of this component. + /// accuracy : Specifies the desired level of computational accuracy of the property calculations. + /// The default value of 'LowCalculationAccuracy' returns results within a +/- 1% error margin. + core::Ptr getPhysicalProperties(CalculationAccuracy accuracy = adsk::fusion::LowCalculationAccuracy) const; + + /// Transforms a set of occurrences in one step. This provides better performance than transforming them one at a time. + /// This method is only valid when called on the root component because Fusion 360 flattens the entire assembly structure + /// when manipulating the assembly so all transforms are relative to the root component. + /// occurrences : An array of Occurrence objects that you want to transform. These must all be in the context of the root component which + /// means proxies must be used for occurrences that are in sub-components. + /// transforms : An array of Matrix3D objects that defines the transform to apply to each occurrence. This array must be the same size + /// as the array provided for the occurrences argument and the transform will be applied to the occurrence at the same index + /// in the occurrences array. + /// ignoreJoints : Specifies if the joints are to be ignored and the occurrences are to be positioned based on then specified transform or if + /// the joints should be used and the occurrence is transformed the best it can while still honoring the joints. + /// Returns true if the transform was successful. + bool transformOccurrences(const std::vector>& occurrences, const std::vector>& transforms, bool ignoreJoints); + + /// Returns all joints in this component and any sub components. The joints returned are all in the context + /// of this component so any joints in sub components will be proxies. This is primarily useful when used + /// from the root component because Fusion 360 flattens the assembly structure, including joints, when manipulating + /// an assembly. + std::vector> allJoints() const; + + /// Returns all joint origins in this component and any sub components. The joint origins returned are all in the context + /// of this component so any joint origins in sub components will be proxies. This is primarily useful when used + /// from the root component because Fusion 360 flattens the assembly structure, including joint origins, when manipulating + /// an assembly. + std::vector> allAsBuiltJoints() const; + + /// Returns all as-built joints in this component and any sub components. The as-built joints returned are all in the context + /// of this component so any as-built joints in sub components will be proxies. This is primarily useful when used + /// from the root component because Fusion 360 flattens the assembly structure, including as-built joints, when manipulating + /// an assembly. + std::vector> allJointOrigins() const; + + /// Returns all rigid groups in this component and any sub components. The rigid groups returned are all in the context + /// of this component so any rigid groups in sub components will be proxies. This is primarily useful when used + /// from the root component because Fusion 360 flattens the assembly structure, including rigid groups, when manipulating + /// an assembly. + std::vector> allRigidGroups() const; + + /// Gets and sets the opacity override assigned to this component. A value of 1.0 specifies + /// that is it completely opaque and a value of 0.0 specifies that is it completely transparent. + /// This is only applicable for a non-root local component. + /// This value is not necessarily related to what the user sees because the opacity is inherited. + /// For example, if you have TopComponent and it has a component in it called SubComponent and you + /// set the opacity of TopComponent to be 0.5, SubComponent will also be shown as slightly transparent + /// even though the opacity property for it will return 1.0. Because a component can be referenced as + /// an occurrence in other components and they can have different opacity settings, it's possible that + /// different instances of the same component can display using different opacity levels. To get the + /// opacity that it is being displayed with use the Occurrence.visibleOpacity property. + double opacity() const; + bool opacity(double value); + + /// Returns the collection of joint origins associated with this component. + core::Ptr jointOrigins() const; + + /// Returns the customGraphicsGroups object in this component. + core::Ptr customGraphicsGroups() const; + + /// Returns the current revision ID of the component. This ID changes any time the component is modified in any way. By getting + /// and saving the ID when you create any data that is dependent on the component, you can then compare the saved + /// ID with the current ID to determine if the component has changed to know if you should update your data. + std::string revisionId() const; + + /// Returns a token for the Component object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same component. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + /// Returns the persistent ID of the component. This ID is created with the component and does not change. + /// Because this ID does not change, different revisions of the same design or copies of the design asset/file + /// will retain this ID. If components from different designs have the same ID, it indicates they are either + /// different revisions or a copy of the design was made. Therefore, this ID will always be unique within a + /// single design, but may not be unique in an assembly where externally referenced designs include different + /// revisions or copies of a design. + /// The ID is also the same ID used by PIM (Product Information Model). + std::string id() const; + + ADSK_FUSION_COMPONENT_API static const char* classType(); + ADSK_FUSION_COMPONENT_API const char* objectType() const override; + ADSK_FUSION_COMPONENT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COMPONENT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Sketches* sketches_raw() const = 0; + virtual Features* features_raw() const = 0; + virtual MeshBodies* meshBodies_raw() const = 0; + virtual ModelParameters* modelParameters_raw() const = 0; + virtual bool isOriginFolderLightBulbOn_raw() const = 0; + virtual bool isOriginFolderLightBulbOn_raw(bool value) = 0; + virtual bool isConstructionFolderLightBulbOn_raw() const = 0; + virtual bool isConstructionFolderLightBulbOn_raw(bool value) = 0; + virtual bool isSketchFolderLightBulbOn_raw() const = 0; + virtual bool isSketchFolderLightBulbOn_raw(bool value) = 0; + virtual ConstructionPlane* xYConstructionPlane_raw() const = 0; + virtual ConstructionPlane* xZConstructionPlane_raw() const = 0; + virtual ConstructionPlane* yZConstructionPlane_raw() const = 0; + virtual ConstructionAxis* xConstructionAxis_raw() const = 0; + virtual ConstructionAxis* yConstructionAxis_raw() const = 0; + virtual ConstructionAxis* zConstructionAxis_raw() const = 0; + virtual ConstructionPoint* originConstructionPoint_raw() const = 0; + virtual char* partNumber_raw() const = 0; + virtual bool partNumber_raw(const char * value) = 0; + virtual char* description_raw() const = 0; + virtual bool description_raw(const char * value) = 0; + virtual Profile* createOpenProfile_raw(core::Base* curves, bool chainCurves) = 0; + virtual Profile* createBRepEdgeProfile_raw(core::Base* edges, bool chainEdges) = 0; + virtual Joints* joints_raw() const = 0; + virtual JointOrigins* jointOrgins_raw() const = 0; + virtual AsBuiltJoints* asBuiltJoints_raw() const = 0; + virtual RigidGroups* rigidGroups_raw() const = 0; + virtual core::Material* material_raw() const = 0; + virtual bool material_raw(core::Material* value) = 0; + virtual PhysicalProperties* physicalProperties_raw() const = 0; + virtual core::DataFileFuture* saveCopyAs_raw(const char * name, core::DataFolder* dataFolder, const char * description, const char * tag) const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual bool isJointsFolderLightBulbOn_raw() const = 0; + virtual bool isJointsFolderLightBulbOn_raw(bool value) = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual bool isBodiesFolderLightBulbOn_raw() const = 0; + virtual bool isBodiesFolderLightBulbOn_raw(bool value) = 0; + virtual PhysicalProperties* getPhysicalProperties_raw(CalculationAccuracy accuracy) const = 0; + virtual bool transformOccurrences_raw(Occurrence** occurrences, size_t occurrences_size, core::Matrix3D** transforms, size_t transforms_size, bool ignoreJoints) = 0; + virtual Joint** allJoints_raw(size_t& return_size) const = 0; + virtual AsBuiltJoint** allAsBuiltJoints_raw(size_t& return_size) const = 0; + virtual JointOrigin** allJointOrigins_raw(size_t& return_size) const = 0; + virtual RigidGroup** allRigidGroups_raw(size_t& return_size) const = 0; + virtual double opacity_raw() const = 0; + virtual bool opacity_raw(double value) = 0; + virtual JointOrigins* jointOrigins_raw() const = 0; + virtual CustomGraphicsGroups* customGraphicsGroups_raw() const = 0; + virtual char* revisionId_raw() const = 0; + virtual char* entityToken_raw() const = 0; + virtual char* id_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr Component::sketches() const +{ + core::Ptr res = sketches_raw(); + return res; +} + +inline core::Ptr Component::features() const +{ + core::Ptr res = features_raw(); + return res; +} + +inline core::Ptr Component::meshBodies() const +{ + core::Ptr res = meshBodies_raw(); + return res; +} + +inline core::Ptr Component::modelParameters() const +{ + core::Ptr res = modelParameters_raw(); + return res; +} + +inline bool Component::isOriginFolderLightBulbOn() const +{ + bool res = isOriginFolderLightBulbOn_raw(); + return res; +} + +inline bool Component::isOriginFolderLightBulbOn(bool value) +{ + return isOriginFolderLightBulbOn_raw(value); +} + +inline bool Component::isConstructionFolderLightBulbOn() const +{ + bool res = isConstructionFolderLightBulbOn_raw(); + return res; +} + +inline bool Component::isConstructionFolderLightBulbOn(bool value) +{ + return isConstructionFolderLightBulbOn_raw(value); +} + +inline bool Component::isSketchFolderLightBulbOn() const +{ + bool res = isSketchFolderLightBulbOn_raw(); + return res; +} + +inline bool Component::isSketchFolderLightBulbOn(bool value) +{ + return isSketchFolderLightBulbOn_raw(value); +} + +inline core::Ptr Component::xYConstructionPlane() const +{ + core::Ptr res = xYConstructionPlane_raw(); + return res; +} + +inline core::Ptr Component::xZConstructionPlane() const +{ + core::Ptr res = xZConstructionPlane_raw(); + return res; +} + +inline core::Ptr Component::yZConstructionPlane() const +{ + core::Ptr res = yZConstructionPlane_raw(); + return res; +} + +inline core::Ptr Component::xConstructionAxis() const +{ + core::Ptr res = xConstructionAxis_raw(); + return res; +} + +inline core::Ptr Component::yConstructionAxis() const +{ + core::Ptr res = yConstructionAxis_raw(); + return res; +} + +inline core::Ptr Component::zConstructionAxis() const +{ + core::Ptr res = zConstructionAxis_raw(); + return res; +} + +inline core::Ptr Component::originConstructionPoint() const +{ + core::Ptr res = originConstructionPoint_raw(); + return res; +} + +inline std::string Component::partNumber() const +{ + std::string res; + + char* p= partNumber_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Component::partNumber(const std::string& value) +{ + return partNumber_raw(value.c_str()); +} + +inline std::string Component::description() const +{ + std::string res; + + char* p= description_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Component::description(const std::string& value) +{ + return description_raw(value.c_str()); +} + +inline core::Ptr Component::createOpenProfile(const core::Ptr& curves, bool chainCurves) +{ + core::Ptr res = createOpenProfile_raw(curves.get(), chainCurves); + return res; +} + +inline core::Ptr Component::createBRepEdgeProfile(const core::Ptr& edges, bool chainEdges) +{ + core::Ptr res = createBRepEdgeProfile_raw(edges.get(), chainEdges); + return res; +} + +inline core::Ptr Component::joints() const +{ + core::Ptr res = joints_raw(); + return res; +} + +inline core::Ptr Component::jointOrgins() const +{ + core::Ptr res = jointOrgins_raw(); + return res; +} + +inline core::Ptr Component::asBuiltJoints() const +{ + core::Ptr res = asBuiltJoints_raw(); + return res; +} + +inline core::Ptr Component::rigidGroups() const +{ + core::Ptr res = rigidGroups_raw(); + return res; +} + +inline core::Ptr Component::material() const +{ + core::Ptr res = material_raw(); + return res; +} + +inline bool Component::material(const core::Ptr& value) +{ + return material_raw(value.get()); +} + +inline core::Ptr Component::physicalProperties() const +{ + core::Ptr res = physicalProperties_raw(); + return res; +} + +inline core::Ptr Component::saveCopyAs(const std::string& name, const core::Ptr& dataFolder, const std::string& description, const std::string& tag) const +{ + core::Ptr res = saveCopyAs_raw(name.c_str(), dataFolder.get(), description.c_str(), tag.c_str()); + return res; +} + +inline core::Ptr Component::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline bool Component::isJointsFolderLightBulbOn() const +{ + bool res = isJointsFolderLightBulbOn_raw(); + return res; +} + +inline bool Component::isJointsFolderLightBulbOn(bool value) +{ + return isJointsFolderLightBulbOn_raw(value); +} + +inline core::Ptr Component::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline bool Component::isBodiesFolderLightBulbOn() const +{ + bool res = isBodiesFolderLightBulbOn_raw(); + return res; +} + +inline bool Component::isBodiesFolderLightBulbOn(bool value) +{ + return isBodiesFolderLightBulbOn_raw(value); +} + +inline core::Ptr Component::getPhysicalProperties(CalculationAccuracy accuracy) const +{ + core::Ptr res = getPhysicalProperties_raw(accuracy); + return res; +} + +inline bool Component::transformOccurrences(const std::vector>& occurrences, const std::vector>& transforms, bool ignoreJoints) +{ + Occurrence** occurrences_ = new Occurrence*[occurrences.size()]; + for(size_t i=0; i> Component::allJoints() const +{ + std::vector> res; + size_t s; + + Joint** p= allJoints_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> Component::allAsBuiltJoints() const +{ + std::vector> res; + size_t s; + + AsBuiltJoint** p= allAsBuiltJoints_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> Component::allJointOrigins() const +{ + std::vector> res; + size_t s; + + JointOrigin** p= allJointOrigins_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> Component::allRigidGroups() const +{ + std::vector> res; + size_t s; + + RigidGroup** p= allRigidGroups_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline double Component::opacity() const +{ + double res = opacity_raw(); + return res; +} + +inline bool Component::opacity(double value) +{ + return opacity_raw(value); +} + +inline core::Ptr Component::jointOrigins() const +{ + core::Ptr res = jointOrigins_raw(); + return res; +} + +inline core::Ptr Component::customGraphicsGroups() const +{ + core::Ptr res = customGraphicsGroups_raw(); + return res; +} + +inline std::string Component::revisionId() const +{ + std::string res; + + char* p= revisionId_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string Component::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string Component::id() const +{ + std::string res; + + char* p= id_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COMPONENT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/ComponentList.h b/usr/autodesk/CPP/include/Fusion/Components/ComponentList.h new file mode 100644 index 0000000..094a5ff --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/ComponentList.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COMPONENTLIST_CPP__ +# define ADSK_FUSION_COMPONENTLIST_API XI_EXPORT +# else +# define ADSK_FUSION_COMPONENTLIST_API +# endif +#else +# define ADSK_FUSION_COMPONENTLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; +}} + +namespace adsk { namespace fusion { + +/// Provides a list of components. +class ComponentList : public core::Base { +public: + + /// Function that returns the specified component using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of components in the collection. + size_t count() const; + + typedef Component iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_COMPONENTLIST_API static const char* classType(); + ADSK_FUSION_COMPONENTLIST_API const char* objectType() const override; + ADSK_FUSION_COMPONENTLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COMPONENTLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Component* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ComponentList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ComponentList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void ComponentList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COMPONENTLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/Components.h b/usr/autodesk/CPP/include/Fusion/Components/Components.h new file mode 100644 index 0000000..0d034f7 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/Components.h @@ -0,0 +1,112 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COMPONENTS_CPP__ +# define ADSK_FUSION_COMPONENTS_API XI_EXPORT +# else +# define ADSK_FUSION_COMPONENTS_API +# endif +#else +# define ADSK_FUSION_COMPONENTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; +}} + +namespace adsk { namespace fusion { + +/// The Components collection object provides access to existing components in a design. +class Components : public core::Base { +public: + + /// Function that returns the specified component using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of components in the collection. + size_t count() const; + + /// Function that returns the specified component by name. + /// name : The name of the component within the collection to return. + /// Returns the specified component or null if the name is not found. + core::Ptr itemByName(const std::string& name) const; + + /// Returns the Component that has the specified ID. + /// id : The ID of the Component to get. This is the same id used by PIM (Product Information Model). + /// Returns the specified Component or null in the case where there isn't a Component with the specified ID in this Design. + core::Ptr itemById(const std::string& id) const; + + typedef Component iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_COMPONENTS_API static const char* classType(); + ADSK_FUSION_COMPONENTS_API const char* objectType() const override; + ADSK_FUSION_COMPONENTS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COMPONENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Component* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual Component* itemByName_raw(const char * name) const = 0; + virtual Component* itemById_raw(const char * id) const = 0; +}; + +// Inline wrappers + +inline core::Ptr Components::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t Components::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr Components::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline core::Ptr Components::itemById(const std::string& id) const +{ + core::Ptr res = itemById_raw(id.c_str()); + return res; +} + +template inline void Components::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COMPONENTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/ContactSet.h b/usr/autodesk/CPP/include/Fusion/Components/ContactSet.h new file mode 100644 index 0000000..637e8f4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/ContactSet.h @@ -0,0 +1,134 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONTACTSET_CPP__ +# define ADSK_FUSION_CONTACTSET_API XI_EXPORT +# else +# define ADSK_FUSION_CONTACTSET_API +# endif +#else +# define ADSK_FUSION_CONTACTSET_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Represents a contact set in a design. +class ContactSet : public core::Base { +public: + + /// Gets and sets the name of the contact set. + std::string name() const; + bool name(const std::string& value); + + /// Gets and sets the group of Occurrence and/or BRepBody objects that are part of this contact set. + std::vector> occurencesAndBodies() const; + bool occurencesAndBodies(const std::vector>& value); + + /// Deletes this contact set from the design. + /// Returns true if the delete was successful. + bool deleteMe(); + + /// Gets and sets if this contact set is currently suppressed. + bool isSuppressed() const; + bool isSuppressed(bool value); + + ADSK_FUSION_CONTACTSET_API static const char* classType(); + ADSK_FUSION_CONTACTSET_API const char* objectType() const override; + ADSK_FUSION_CONTACTSET_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONTACTSET_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual core::Base** occurencesAndBodies_raw(size_t& return_size) const = 0; + virtual bool occurencesAndBodies_raw(core::Base** value, size_t value_size) = 0; + virtual bool deleteMe_raw() = 0; + virtual bool isSuppressed_raw() const = 0; + virtual bool isSuppressed_raw(bool value) = 0; +}; + +// Inline wrappers + +inline std::string ContactSet::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool ContactSet::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline std::vector> ContactSet::occurencesAndBodies() const +{ + std::vector> res; + size_t s; + + core::Base** p= occurencesAndBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool ContactSet::occurencesAndBodies(const std::vector>& value) +{ + core::Base** value_ = new core::Base*[value.size()]; + for(size_t i=0; i +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONTACTSETS_CPP__ +# define ADSK_FUSION_CONTACTSETS_API XI_EXPORT +# else +# define ADSK_FUSION_CONTACTSETS_API +# endif +#else +# define ADSK_FUSION_CONTACTSETS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ContactSet; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the existing contact sets in a design and supports creating new contact sets. +class ContactSets : public core::Base { +public: + + /// Returns the specified contact set using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// + /// name : + /// + core::Ptr itemByName(const std::string& name) const; + + /// Returns the number of contacts sets in the design. + size_t count() const; + + /// Creates a new contact set for the provided occurrences and/or bodies. + /// occurrencesAndBodies : An array of Occurrence or BRepBody objects that will be included in the contact set. + /// All occurrences and bodies must be in the context of the root component. + /// Returns the newly created ContactSet or null in the case of failure. + core::Ptr add(const std::vector>& occurrencesAndBodies); + + ADSK_FUSION_CONTACTSETS_API static const char* classType(); + ADSK_FUSION_CONTACTSETS_API const char* objectType() const override; + ADSK_FUSION_CONTACTSETS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONTACTSETS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ContactSet* item_raw(size_t index) const = 0; + virtual ContactSet* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual ContactSet* add_raw(core::Base** occurrencesAndBodies, size_t occurrencesAndBodies_size) = 0; +}; + +// Inline wrappers + +inline core::Ptr ContactSets::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr ContactSets::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t ContactSets::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ContactSets::add(const std::vector>& occurrencesAndBodies) +{ + core::Base** occurrencesAndBodies_ = new core::Base*[occurrencesAndBodies.size()]; + for(size_t i=0; i res = add_raw(occurrencesAndBodies_, occurrencesAndBodies.size()); + delete[] occurrencesAndBodies_; + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONTACTSETS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/CylindricalJointMotion.h b/usr/autodesk/CPP/include/Fusion/Components/CylindricalJointMotion.h new file mode 100644 index 0000000..7469dfe --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/CylindricalJointMotion.h @@ -0,0 +1,173 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "JointMotion.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CYLINDRICALJOINTMOTION_CPP__ +# define ADSK_FUSION_CYLINDRICALJOINTMOTION_API XI_EXPORT +# else +# define ADSK_FUSION_CYLINDRICALJOINTMOTION_API +# endif +#else +# define ADSK_FUSION_CYLINDRICALJOINTMOTION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointLimits; +}} +namespace adsk { namespace core { + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Represents the set of information specific to a cylindrical joint. +class CylindricalJointMotion : public JointMotion { +public: + + /// Gets and sets the direction of the axis of rotation. This can be set to + /// XAxisJointDirection, YAxisJointDirection, or ZAxisJointDirection. It can + /// return those three directions and CustomJointDirection. If this returns + /// CustomJointDirection then the customRotationAxisEntity will return an entity + /// that defines the axis. If there is a custom rotation axis defined and this + /// property is set to one of the three standard axes, the custom rotation will + /// be removed and customRotationAxisEntity will return null. + JointDirections rotationAxis() const; + bool rotationAxis(JointDirections value); + + /// Returns the direction of the rotation axis. This property will return null in the case + /// where the CylindricalJointMotion object was obtained from a JointInput object. + core::Ptr rotationAxisVector() const; + + /// This property can be set using various types of entities that can infer an + /// axis. For example, a linear edge, sketch line, planar face, and cylindrical face. + /// This property is only valid in the case where the rotationAxis property returns + /// CustomJointDirection. Setting this property will automatically set + /// the rotationAxis property to CustomJointDirection. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + core::Ptr customRotationAxisEntity() const; + bool customRotationAxisEntity(const core::Ptr& value); + + /// Gets and sets the rotation value. This is in radians. Setting this value is + /// the equivalent of using the Drive Joints command. + double rotationValue() const; + bool rotationValue(double value); + + /// Returns a JointLimits object that defines the rotation limits for this joint. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr rotationLimits() const; + + /// Gets and sets the slide value. This is in centimeters. Setting this value is + /// the equivalent of using the Drive Joints command. + double slideValue() const; + bool slideValue(double value); + + /// Returns a JointLimits object that defines the slide limits for this joint. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr slideLimits() const; + + ADSK_FUSION_CYLINDRICALJOINTMOTION_API static const char* classType(); + ADSK_FUSION_CYLINDRICALJOINTMOTION_API const char* objectType() const override; + ADSK_FUSION_CYLINDRICALJOINTMOTION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CYLINDRICALJOINTMOTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual JointDirections rotationAxis_raw() const = 0; + virtual bool rotationAxis_raw(JointDirections value) = 0; + virtual core::Vector3D* rotationAxisVector_raw() const = 0; + virtual core::Base* customRotationAxisEntity_raw() const = 0; + virtual bool customRotationAxisEntity_raw(core::Base* value) = 0; + virtual double rotationValue_raw() const = 0; + virtual bool rotationValue_raw(double value) = 0; + virtual JointLimits* rotationLimits_raw() const = 0; + virtual double slideValue_raw() const = 0; + virtual bool slideValue_raw(double value) = 0; + virtual JointLimits* slideLimits_raw() const = 0; +}; + +// Inline wrappers + +inline JointDirections CylindricalJointMotion::rotationAxis() const +{ + JointDirections res = rotationAxis_raw(); + return res; +} + +inline bool CylindricalJointMotion::rotationAxis(JointDirections value) +{ + return rotationAxis_raw(value); +} + +inline core::Ptr CylindricalJointMotion::rotationAxisVector() const +{ + core::Ptr res = rotationAxisVector_raw(); + return res; +} + +inline core::Ptr CylindricalJointMotion::customRotationAxisEntity() const +{ + core::Ptr res = customRotationAxisEntity_raw(); + return res; +} + +inline bool CylindricalJointMotion::customRotationAxisEntity(const core::Ptr& value) +{ + return customRotationAxisEntity_raw(value.get()); +} + +inline double CylindricalJointMotion::rotationValue() const +{ + double res = rotationValue_raw(); + return res; +} + +inline bool CylindricalJointMotion::rotationValue(double value) +{ + return rotationValue_raw(value); +} + +inline core::Ptr CylindricalJointMotion::rotationLimits() const +{ + core::Ptr res = rotationLimits_raw(); + return res; +} + +inline double CylindricalJointMotion::slideValue() const +{ + double res = slideValue_raw(); + return res; +} + +inline bool CylindricalJointMotion::slideValue(double value) +{ + return slideValue_raw(value); +} + +inline core::Ptr CylindricalJointMotion::slideLimits() const +{ + core::Ptr res = slideLimits_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CYLINDRICALJOINTMOTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/Joint.h b/usr/autodesk/CPP/include/Fusion/Components/Joint.h new file mode 100644 index 0000000..20fcf79 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/Joint.h @@ -0,0 +1,528 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINT_CPP__ +# define ADSK_FUSION_JOINT_API XI_EXPORT +# else +# define ADSK_FUSION_JOINT_API +# endif +#else +# define ADSK_FUSION_JOINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class JointMotion; + class ModelParameter; + class Occurrence; + class TimelineObject; +}} +namespace adsk { namespace core { + class Attributes; +}} + +namespace adsk { namespace fusion { + +/// A joint in a design. +class Joint : public core::Base { +public: + + /// Returns the parent component that owns this joint. + core::Ptr parentComponent() const; + + /// Gets and sets the name of the joint. + std::string name() const; + bool name(const std::string& value); + + /// Gets and sets the first JointGeometry or JointOrigin for this joint. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + core::Ptr geometryOrOriginOne() const; + bool geometryOrOriginOne(const core::Ptr& value); + + /// Gets and sets the second JointGeometry or JointOrigin for this joint. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + core::Ptr geometryOrOriginTwo() const; + bool geometryOrOriginTwo(const core::Ptr& value); + + /// Returns the parameter controlling the angle between the two input geometries. This is effectively the + /// angle between the two primary axes of the two joint geometries. + core::Ptr angle() const; + + /// Returns the parameter controlling the offset between the two input geometries. This is effectively the + /// offset distance between the two planes defined by the primary and secondary axes + /// of the input geometries or the offset along the tertiary axis (z axis) of the joint. + core::Ptr offset() const; + + /// Gets and sets if the joint direction is flipped or not. This is effectively + /// specifying if the third axis of the two input geometries is facing (false) or + /// opposed (true). + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + bool isFlipped() const; + bool isFlipped(bool value); + + /// Returns a JointMotion object that defines the motion relationship between the two geometries. + core::Ptr jointMotion() const; + + /// Deletes this joint. + /// Returns true if the delete is successful. + bool deleteMe(); + + /// Returns the timeline object associated with this joint. + core::Ptr timelineObject() const; + + /// Redefines the relationship between the two joint geometries as a rigid joint. + /// To use this method, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + /// Returns true if successful. + bool setAsRigidJointMotion(); + + /// Redefines the relationship between the two joint geometries as a revolute joint. + /// To use this method, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// from. + /// Returns true if the operation was successful. + bool setAsRevoluteJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity = NULL); + + /// Redefines the relationship between the two joint geometries as a slider joint. + /// To use this method, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + /// sliderDirection : Specifies which axis the slide direction is along. If this is set to CustomJointDirection then the + /// customSliderDirectionEntity argument must also be provided. + /// customSliderDirectionEntity : If the sliderDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the custom slider direction. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsSliderJointMotion(JointDirections sliderDirection, const core::Ptr& customSliderDirectionEntity = NULL); + + /// Redefines the relationship between the two joint geometries as a cylindrical joint. + /// To use this method, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// from. + /// Returns true if the operation was successful. + bool setAsCylindricalJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity = NULL); + + /// Redefines the relationship between the two joint geometries as a pin-slot joint. + /// To use this method, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// slideDirection : Specifies which axis the slide direction is along. If this is set to CustomJointDirection then the + /// customSlideDirectionEntity argument must also be provided. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// customSlideDirectionEntity : If the slideDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the custom slide direction. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsPinSlotJointMotion(JointDirections rotationAxis, JointDirections slideDirection, const core::Ptr& customRotationAxisEntity = NULL, const core::Ptr& customSlideDirectionEntity = NULL); + + /// Redefines the relationship between the two joint geometries as a planar joint. + /// To use this method, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + /// normalDirection : Defines the direction of the normal of the single degree of rotation. + /// This can be set to XAxisJointDirection, YAxisJointDirection, ZAxisJointDirection, + /// or CustomJointDirection. If set to CustomJointDirection then the customNormalDirectionEntity + /// argument must also be provided. + /// customNormalDirectionEntity : If the normalDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the direction of the normal. This can be several types of entities that can define a direction. + /// customPrimarySlideDirection : This arguments defines the direction of the primary slide direction. A default primary slide direction + /// is automatically chosen and will be used if this argument is not provided or is null. The secondary slide + /// direction is automatically inferred from the normal and primary slide directions. + /// Returns true if the operation was successful. + bool setAsPlanarJointMotion(JointDirections normalDirection, const core::Ptr& customNormalDirectionEntity = NULL, const core::Ptr& customPrimarySlideDirection = NULL); + + /// Redefines the relationship between the two joint geometries as a ball joint. + /// To use this method, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + /// pitchDirection : Defines the direction the pitch angle is measured from. This can be ZAxisJointDirection or CustomJointDirection. If + /// CustomJointDirection is specified then you must also provide a value for the customPitchDirection argument. + /// yawDirection : Defines the direction the yaw is measured from. This can be XAxisJointDirection or CustomJointDirection. If + /// CustomJointDirection is specified then you must also provide a value for the customYawDirection argument. + /// customPitchDirection : If the pitchDirection argument is customPitchDirection this argument is used to define the direction the pitch + /// angel is measured from. This can be several types of entities that can define a direction. + /// customYawDirection : If the yawDirection argument is customPitchDirection this argument is used to define the direction the yaw + /// angel is measured from. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsBallJointMotion(JointDirections pitchDirection, JointDirections yawDirection, const core::Ptr& customPitchDirection = NULL, const core::Ptr& customYawDirection = NULL); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// Gets and sets if this joint is suppressed. + bool isSuppressed() const; + bool isSuppressed(bool value); + + /// Gets and sets if the light bulb of this joint as displayed in the browser is on or off. + /// A joint will only be visible if the light bulb is switched on. However, + /// the light bulb can be on and the joint still invisible if a higher level occurrence + /// in the assembly context is not visible because its light bulb is off or the joints folder + /// is light bulb is off. + bool isLightBulbOn() const; + bool isLightBulbOn(bool value); + + /// Gets whether the joint is visible. To change the visibility see the isLightBulbOn property. + /// This property is affected by the assembly context. + bool isVisible() const; + + /// Returns the collection of attributes associated with this joint. + core::Ptr attributes() const; + + /// Returns the current health state of the joint. + FeatureHealthStates healthState() const; + + /// Returns the error or warning message in the case where the healthState property returns either + /// WarningFeatureHealthState or ErrorFeatureHealthState. Otherwise this property returns an empty string. + std::string errorOrWarningMessage() const; + + /// Returns the first of two occurrences that this joint defines a relationship between. This is the occurrence + /// that can also be found through the geometryOrOriginOne property. + core::Ptr occurrenceOne() const; + + /// Returns the first of two occurrences that this joint defines a relationship between. This is the occurrence + /// that can also be found through the geometryOrOriginTwo property. + core::Ptr occurrenceTwo() const; + + /// Gets and sets if the joint is locked. + bool isLocked() const; + bool isLocked(bool value); + + /// Returns a token for the Joint object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same joint. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_JOINT_API static const char* classType(); + ADSK_FUSION_JOINT_API const char* objectType() const override; + ADSK_FUSION_JOINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Component* parentComponent_raw() const = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual core::Base* geometryOrOriginOne_raw() const = 0; + virtual bool geometryOrOriginOne_raw(core::Base* value) = 0; + virtual core::Base* geometryOrOriginTwo_raw() const = 0; + virtual bool geometryOrOriginTwo_raw(core::Base* value) = 0; + virtual ModelParameter* angle_raw() const = 0; + virtual ModelParameter* offset_raw() const = 0; + virtual bool isFlipped_raw() const = 0; + virtual bool isFlipped_raw(bool value) = 0; + virtual JointMotion* jointMotion_raw() const = 0; + virtual bool deleteMe_raw() = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual bool setAsRigidJointMotion_raw() = 0; + virtual bool setAsRevoluteJointMotion_raw(JointDirections rotationAxis, core::Base* customRotationAxisEntity) = 0; + virtual bool setAsSliderJointMotion_raw(JointDirections sliderDirection, core::Base* customSliderDirectionEntity) = 0; + virtual bool setAsCylindricalJointMotion_raw(JointDirections rotationAxis, core::Base* customRotationAxisEntity) = 0; + virtual bool setAsPinSlotJointMotion_raw(JointDirections rotationAxis, JointDirections slideDirection, core::Base* customRotationAxisEntity, core::Base* customSlideDirectionEntity) = 0; + virtual bool setAsPlanarJointMotion_raw(JointDirections normalDirection, core::Base* customNormalDirectionEntity, core::Base* customPrimarySlideDirection) = 0; + virtual bool setAsBallJointMotion_raw(JointDirections pitchDirection, JointDirections yawDirection, core::Base* customPitchDirection, core::Base* customYawDirection) = 0; + virtual Joint* nativeObject_raw() const = 0; + virtual Joint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual bool isSuppressed_raw() const = 0; + virtual bool isSuppressed_raw(bool value) = 0; + virtual bool isLightBulbOn_raw() const = 0; + virtual bool isLightBulbOn_raw(bool value) = 0; + virtual bool isVisible_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual FeatureHealthStates healthState_raw() const = 0; + virtual char* errorOrWarningMessage_raw() const = 0; + virtual Occurrence* occurrenceOne_raw() const = 0; + virtual Occurrence* occurrenceTwo_raw() const = 0; + virtual bool isLocked_raw() const = 0; + virtual bool isLocked_raw(bool value) = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr Joint::parentComponent() const +{ + core::Ptr res = parentComponent_raw(); + return res; +} + +inline std::string Joint::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Joint::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline core::Ptr Joint::geometryOrOriginOne() const +{ + core::Ptr res = geometryOrOriginOne_raw(); + return res; +} + +inline bool Joint::geometryOrOriginOne(const core::Ptr& value) +{ + return geometryOrOriginOne_raw(value.get()); +} + +inline core::Ptr Joint::geometryOrOriginTwo() const +{ + core::Ptr res = geometryOrOriginTwo_raw(); + return res; +} + +inline bool Joint::geometryOrOriginTwo(const core::Ptr& value) +{ + return geometryOrOriginTwo_raw(value.get()); +} + +inline core::Ptr Joint::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline core::Ptr Joint::offset() const +{ + core::Ptr res = offset_raw(); + return res; +} + +inline bool Joint::isFlipped() const +{ + bool res = isFlipped_raw(); + return res; +} + +inline bool Joint::isFlipped(bool value) +{ + return isFlipped_raw(value); +} + +inline core::Ptr Joint::jointMotion() const +{ + core::Ptr res = jointMotion_raw(); + return res; +} + +inline bool Joint::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline core::Ptr Joint::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline bool Joint::setAsRigidJointMotion() +{ + bool res = setAsRigidJointMotion_raw(); + return res; +} + +inline bool Joint::setAsRevoluteJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity) +{ + bool res = setAsRevoluteJointMotion_raw(rotationAxis, customRotationAxisEntity.get()); + return res; +} + +inline bool Joint::setAsSliderJointMotion(JointDirections sliderDirection, const core::Ptr& customSliderDirectionEntity) +{ + bool res = setAsSliderJointMotion_raw(sliderDirection, customSliderDirectionEntity.get()); + return res; +} + +inline bool Joint::setAsCylindricalJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity) +{ + bool res = setAsCylindricalJointMotion_raw(rotationAxis, customRotationAxisEntity.get()); + return res; +} + +inline bool Joint::setAsPinSlotJointMotion(JointDirections rotationAxis, JointDirections slideDirection, const core::Ptr& customRotationAxisEntity, const core::Ptr& customSlideDirectionEntity) +{ + bool res = setAsPinSlotJointMotion_raw(rotationAxis, slideDirection, customRotationAxisEntity.get(), customSlideDirectionEntity.get()); + return res; +} + +inline bool Joint::setAsPlanarJointMotion(JointDirections normalDirection, const core::Ptr& customNormalDirectionEntity, const core::Ptr& customPrimarySlideDirection) +{ + bool res = setAsPlanarJointMotion_raw(normalDirection, customNormalDirectionEntity.get(), customPrimarySlideDirection.get()); + return res; +} + +inline bool Joint::setAsBallJointMotion(JointDirections pitchDirection, JointDirections yawDirection, const core::Ptr& customPitchDirection, const core::Ptr& customYawDirection) +{ + bool res = setAsBallJointMotion_raw(pitchDirection, yawDirection, customPitchDirection.get(), customYawDirection.get()); + return res; +} + +inline core::Ptr Joint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr Joint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr Joint::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline bool Joint::isSuppressed() const +{ + bool res = isSuppressed_raw(); + return res; +} + +inline bool Joint::isSuppressed(bool value) +{ + return isSuppressed_raw(value); +} + +inline bool Joint::isLightBulbOn() const +{ + bool res = isLightBulbOn_raw(); + return res; +} + +inline bool Joint::isLightBulbOn(bool value) +{ + return isLightBulbOn_raw(value); +} + +inline bool Joint::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline core::Ptr Joint::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline FeatureHealthStates Joint::healthState() const +{ + FeatureHealthStates res = healthState_raw(); + return res; +} + +inline std::string Joint::errorOrWarningMessage() const +{ + std::string res; + + char* p= errorOrWarningMessage_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr Joint::occurrenceOne() const +{ + core::Ptr res = occurrenceOne_raw(); + return res; +} + +inline core::Ptr Joint::occurrenceTwo() const +{ + core::Ptr res = occurrenceTwo_raw(); + return res; +} + +inline bool Joint::isLocked() const +{ + bool res = isLocked_raw(); + return res; +} + +inline bool Joint::isLocked(bool value) +{ + return isLocked_raw(value); +} + +inline std::string Joint::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/JointGeometry.h b/usr/autodesk/CPP/include/Fusion/Components/JointGeometry.h new file mode 100644 index 0000000..7a82b07 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/JointGeometry.h @@ -0,0 +1,291 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINTGEOMETRY_CPP__ +# define ADSK_FUSION_JOINTGEOMETRY_API XI_EXPORT +# else +# define ADSK_FUSION_JOINTGEOMETRY_API +# endif +#else +# define ADSK_FUSION_JOINTGEOMETRY_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepEdge; + class BRepFace; + class Profile; + class SketchCurve; +}} +namespace adsk { namespace core { + class Point3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// A transient object used to define and query the geometric input of a joint and the resulting coordinate +/// system it defines. New JointGeometry objects are created using its various static create methods and +/// are then used as input to the Joints.createInput method. +class JointGeometry : public core::Base { +public: + + /// Creates a new transient JointGeometry object based on a planar BRepFace object. A JointGeometry + /// object can be used to create a joint or joint origin. + /// face : The planar BRepFace object + /// edge : A BRepEdge edge object that is one of the edges of the specified face. This argument can be + /// null in the case where the keyPointType is CenterKeypoint indicating the center of the face + /// is to be used. When an edge is used, the keyPointType specifies the position along the edge + /// for the keypoint. + /// keyPointType : Specifies the position along the edge where the joint keypoint will be located. For open edges + /// this can be StartKeyPoint, MiddleKeyPoint, or EndKeyPoint. For closed edges (i.e. circles), it + /// must be CenterKeyPoint. When no edge is specified, it must be CenterKeyPoint indicating the center + /// of area of the face is to be used. + /// Returns the transient JointGeometry object that can be used to create a joint or joint origin or null in case of a failure. + static core::Ptr createByPlanarFace(const core::Ptr& face, const core::Ptr& edge, JointKeyPointTypes keyPointType); + + /// Creates a new transient JointGeometry object based on a non-planar analytical BRepFace object. This is limited + /// to cylinders, cones, spheres, and tori. A JointGeometry object can be used to create a joint or joint origin. + /// face : The cylindrical, conical, spherical, or toroidal BRepFace object. + /// keyPointType : Specifies the position relative to the input face where joint keypoint will be located. For cylinders + /// and cones this can be StartKeyPoint, MiddleKeyPoint, or EndKeyPoint. For spheres and tori this must be + /// CenterKeyPoint. + /// Returns the transient JointGeometry object that can be used to create a joint or joint origin or null in case of a failure. + static core::Ptr createByNonPlanarFace(const core::Ptr& face, JointKeyPointTypes keyPointType); + + /// Creates a new transient JointGeometry object based on a planar BRepFace object. A JointGeometry + /// object can be used to create a joint or joint origin. + /// profile : The Profile object. + /// sketchCurve : A sketch curve that is part of the input profile. This argument can be + /// null in the case where the keyPointType is CenterKeypoint indicating the center of the profile + /// is to be used. When a curve is used, the keyPointType specifies the position along the curve + /// for the keypoint. + /// keyPointType : Specifies the position along the curve where the joint keypoint will be located. For open curves (lines, arcs, elliptical arcs, and open splines) + /// this can be StartKeyPoint, MiddleKeyPoint, or EndKeyPoint. For closed analytic (circles and ellipses), it + /// must be CenterKeyPoint. When no curve is specified, it must be CenterKeyPoint indicating the center + /// of area of the profile is to be used. + /// Returns the transient JointGeometry object that can be used to create a joint or joint origin or null in case of a failure. + static core::Ptr createByProfile(const core::Ptr& profile, const core::Ptr& sketchCurve, JointKeyPointTypes keyPointType); + + /// Creates a new transient JointGeometry object using a BRepEdge or SketchCurve as input. A JointGeometry + /// object can be used to create a joint or joint origin. + /// curve : Input BRepEdge or SketchCurve. + /// keyPointType : The position on the curve where to position the joint coordinate system. For any open curves + /// the valid types are StartKeyPoint, MiddleKeyPoint, CenterKeyPoint and EndKeyPoint. For circular and elliptical + /// shaped curves the option is CenterKeyPoint. For closed spline curves either StartKeyPoint or + /// EndKeyPoint can be used and the result is the same. + /// Returns the transient JointGeometry object that can be used to create a joint or joint origin or null in case of a failure. + static core::Ptr createByCurve(const core::Ptr& curve, JointKeyPointTypes keyPointType); + + /// Creates a new transient JointGeometry object using a ConstructionPoint, SketchPoint or BRepVertex as input. + /// A JointGeometry object can be used to create a joint or joint origin. + /// point : The ConstructionPoint, SketchPoint or BRepVertex object. + /// Returns the transient JointGeometry object that can be used to create a joint or joint origin or null in case of a failure. + static core::Ptr createByPoint(const core::Ptr& point); + + /// Returns the type of geometry this JointGeometry object represents. + JointGeometryTypes geometryType() const; + + /// Returns the keypoint type this JointGeometry is using. + JointKeyPointTypes keyPointType() const; + + /// The first entity that's defining this joint geometry. This can be various types of geometry depending + /// on how this joint geometry is defined. The geometryType property indicates how this joint geometry is + /// defined a provides a clue about the type of geometry to expect back from this property. + core::Ptr entityOne() const; + + /// This is the second entity that defines this joint geometry. This isn't used for all joint geometry types + /// and will return null in the cases where it's not used. A second geometry is used in the case where the geometryType + /// property returns JointProfileGeometry, JointPlanarBRepFaceGeometry, JointBetweenTwoFacesGeometry or JointByTwoEdgeIntersectionGeometry. + core::Ptr entityTwo() const; + + /// Returns the origin point that's been calculated for this joint geometry. + core::Ptr origin() const; + + /// Returns the direction of the primary axis that's been calculated for this joint geometry. + /// Conceptually, this is the X-axis of the computed coordinate system. + core::Ptr primaryAxisVector() const; + + /// Returns the direction of the secondary axis that's been calculated for this joint geometry. + /// Conceptually, this is the Y-axis of the computed coordinate system. + core::Ptr secondaryAxisVector() const; + + /// Returns the direction of the third axis that's been calculated for this joint geometry. + /// Conceptually, this is the Z-axis of the computed coordinate system. + core::Ptr thirdAxisVector() const; + + /// Creates a new transient JointGeometry object based on a plane bisecting the two input planes. + /// planeOne : The first planar entity that the joint origin will be created between. This can be a planar BRepFace + /// or a ConstructionPlane object. + /// planeTwo : The second planar entity that the joint origin will be created between. This can be a planar BRepFace + /// or a ConstructionPlane object. + /// entityOne : Specifies the entity that is used to define the keypoint. This can be many types of geometry including + /// edges, planar and non-planar faces, profiles, and sketch geometry. + /// entityTwo : If the entityOne argument is a planar BRepFace or a Profile, then this argument specifies either + /// an edge on the face or a sketch curve on the profile. For a planar face this argument is optional in the + /// case where the keyPointType argument is CenterKeyPoint indicating the center of area of the face is to be used. + /// keyPointType : Specifies the position on the keyPointGeometry where the keypoint will be defined. This keypoint is then + /// projected onto the plane to define the position of the joint geometry. + /// The values that are valid for this argument depend on the type of geometry specified for the geometry and edgeOrCurve + /// arguments. + /// If the geometry argument is a planar face and the edgeOrCurve argument is an open BRepEdge object + /// then this can be StartKeyPoint, MiddleKeyPoint, or EndKeyPoint. If the geometry argument is a planar face and the edgeOrCurve argument + /// is a closed BRepEdge object (i.e. circles), it must be CenterKeyPoint. If the geometry argument is a planar face and + /// the edgeOrCurve argument is null, then this must be CenterKeyPoint indicating the center of area of the face. + /// If the geometry argument is a non-planar face (cylinder, cone, sphere, or torus) this can be StartKeyPoint, MiddleKeyPoint, or EndKeyPoint + /// for cylinders and cones but must be CenterKeyPoint for spheres and tori. The edgeOrCurve argument is ignored in this case. + /// If the geometry argument is a profile and the edgeOrCurve argument is null this can be CenterKeyPoint indicating the center of area + /// of the profile. If the geometry argument is a profile and the edgeOrCurve argument is an open sketch curve on the profile + /// then this can be StartKeyPoint, MiddleKeyPoint, or EndKeyPoint. If the geometry argument is a profile and the edgeOrCurve argument + /// is a closed sketch curve (i.e. circles), it must be CenterKeyPoint. + /// Returns the transient JointGeometry object that can be used to create a joint or joint origin or null in case of a failure. + static core::Ptr createByBetweenTwoPlanes(const core::Ptr& planeOne, const core::Ptr& planeTwo, const core::Ptr& entityOne, const core::Ptr& entityTwo, JointKeyPointTypes keyPointType); + + /// Returns the first plane for joint geometry that is defined between two planes. Returns null in all other cases. + core::Ptr planeOne() const; + + /// Returns the second plane for joint geometry that is defined between two planes. Returns null in all other cases. + core::Ptr planeTwo() const; + + ADSK_FUSION_JOINTGEOMETRY_API static const char* classType(); + ADSK_FUSION_JOINTGEOMETRY_API const char* objectType() const override; + ADSK_FUSION_JOINTGEOMETRY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINTGEOMETRY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_JOINTGEOMETRY_API static JointGeometry* createByPlanarFace_raw(BRepFace* face, BRepEdge* edge, JointKeyPointTypes keyPointType); + ADSK_FUSION_JOINTGEOMETRY_API static JointGeometry* createByNonPlanarFace_raw(BRepFace* face, JointKeyPointTypes keyPointType); + ADSK_FUSION_JOINTGEOMETRY_API static JointGeometry* createByProfile_raw(Profile* profile, SketchCurve* sketchCurve, JointKeyPointTypes keyPointType); + ADSK_FUSION_JOINTGEOMETRY_API static JointGeometry* createByCurve_raw(core::Base* curve, JointKeyPointTypes keyPointType); + ADSK_FUSION_JOINTGEOMETRY_API static JointGeometry* createByPoint_raw(core::Base* point); + virtual JointGeometryTypes geometryType_raw() const = 0; + virtual JointKeyPointTypes keyPointType_raw() const = 0; + virtual core::Base* entityOne_raw() const = 0; + virtual core::Base* entityTwo_raw() const = 0; + virtual core::Point3D* origin_raw() const = 0; + virtual core::Vector3D* primaryAxisVector_raw() const = 0; + virtual core::Vector3D* secondaryAxisVector_raw() const = 0; + virtual core::Vector3D* thirdAxisVector_raw() const = 0; + ADSK_FUSION_JOINTGEOMETRY_API static JointGeometry* createByBetweenTwoPlanes_raw(core::Base* planeOne, core::Base* planeTwo, core::Base* entityOne, core::Base* entityTwo, JointKeyPointTypes keyPointType); + virtual core::Base* planeOne_raw() const = 0; + virtual core::Base* planeTwo_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr JointGeometry::createByPlanarFace(const core::Ptr& face, const core::Ptr& edge, JointKeyPointTypes keyPointType) +{ + core::Ptr res = createByPlanarFace_raw(face.get(), edge.get(), keyPointType); + return res; +} + +inline core::Ptr JointGeometry::createByNonPlanarFace(const core::Ptr& face, JointKeyPointTypes keyPointType) +{ + core::Ptr res = createByNonPlanarFace_raw(face.get(), keyPointType); + return res; +} + +inline core::Ptr JointGeometry::createByProfile(const core::Ptr& profile, const core::Ptr& sketchCurve, JointKeyPointTypes keyPointType) +{ + core::Ptr res = createByProfile_raw(profile.get(), sketchCurve.get(), keyPointType); + return res; +} + +inline core::Ptr JointGeometry::createByCurve(const core::Ptr& curve, JointKeyPointTypes keyPointType) +{ + core::Ptr res = createByCurve_raw(curve.get(), keyPointType); + return res; +} + +inline core::Ptr JointGeometry::createByPoint(const core::Ptr& point) +{ + core::Ptr res = createByPoint_raw(point.get()); + return res; +} + +inline JointGeometryTypes JointGeometry::geometryType() const +{ + JointGeometryTypes res = geometryType_raw(); + return res; +} + +inline JointKeyPointTypes JointGeometry::keyPointType() const +{ + JointKeyPointTypes res = keyPointType_raw(); + return res; +} + +inline core::Ptr JointGeometry::entityOne() const +{ + core::Ptr res = entityOne_raw(); + return res; +} + +inline core::Ptr JointGeometry::entityTwo() const +{ + core::Ptr res = entityTwo_raw(); + return res; +} + +inline core::Ptr JointGeometry::origin() const +{ + core::Ptr res = origin_raw(); + return res; +} + +inline core::Ptr JointGeometry::primaryAxisVector() const +{ + core::Ptr res = primaryAxisVector_raw(); + return res; +} + +inline core::Ptr JointGeometry::secondaryAxisVector() const +{ + core::Ptr res = secondaryAxisVector_raw(); + return res; +} + +inline core::Ptr JointGeometry::thirdAxisVector() const +{ + core::Ptr res = thirdAxisVector_raw(); + return res; +} + +inline core::Ptr JointGeometry::createByBetweenTwoPlanes(const core::Ptr& planeOne, const core::Ptr& planeTwo, const core::Ptr& entityOne, const core::Ptr& entityTwo, JointKeyPointTypes keyPointType) +{ + core::Ptr res = createByBetweenTwoPlanes_raw(planeOne.get(), planeTwo.get(), entityOne.get(), entityTwo.get(), keyPointType); + return res; +} + +inline core::Ptr JointGeometry::planeOne() const +{ + core::Ptr res = planeOne_raw(); + return res; +} + +inline core::Ptr JointGeometry::planeTwo() const +{ + core::Ptr res = planeTwo_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINTGEOMETRY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/JointInput.h b/usr/autodesk/CPP/include/Fusion/Components/JointInput.h new file mode 100644 index 0000000..bfc46f5 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/JointInput.h @@ -0,0 +1,281 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINTINPUT_CPP__ +# define ADSK_FUSION_JOINTINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_JOINTINPUT_API +# endif +#else +# define ADSK_FUSION_JOINTINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointMotion; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Defines all of the information required to create a new joint. This object provides +/// equivalent functionality to the Joint command dialog in that it gathers the required +/// information to create a joint. +class JointInput : public core::Base { +public: + + /// Gets and sets the first JointGeometry or JointOrigin for this joint. + core::Ptr geometryOrOriginOne() const; + bool geometryOrOriginOne(const core::Ptr& value); + + /// Gets and sets the second JointGeometry or JointOrigin for this joint. + core::Ptr geometryOrOriginTwo() const; + bool geometryOrOriginTwo(const core::Ptr& value); + + /// Specifies the angle between two input geometries. This is effectively the + /// angle between the two primary axes of the input geometries. When a new + /// JointInput object is created, this value defaults to zero. When the joint + /// is created this will become the value of the parameter that controls the joint angle. + /// When using a real value to define the angle, the value is in radians. When + /// using a string the expression is evaluated using the document default units for angles. + core::Ptr angle() const; + bool angle(const core::Ptr& value); + + /// Specifies the offset between two input geometries. This is effectively the + /// offset distance between the two planes defined by the primary and secondary axes + /// of the input geometries. When a new JointInput object is created, this value defaults to zero. + /// When the joint is created this will become the value of the parameter that controls the joint offset. + /// When using a real value to define the offset, the value is in centimeters. When + /// using a string the expression is evaluated using the document default units for distance. + core::Ptr offset() const; + bool offset(const core::Ptr& value); + + /// Gets and sets if the joint direction is flipped or not. This is effectively + /// specifying if the third axis of the two input geometries is facing (false) or + /// opposed (true). + bool isFlipped() const; + bool isFlipped(bool value); + + /// Defines the relationship between the two joint geometries as a rigid joint. + /// Returns true if successful. + bool setAsRigidJointMotion(); + + /// Defines the relationship between the two joint geometries as a revolute joint. + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// from. + /// Returns true if the operation was successful. + bool setAsRevoluteJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity = NULL); + + /// Defines the relationship between the two joint geometries as a slider joint. + /// sliderDirection : Specifies which axis the slide direction is along. If this is set to CustomJointDirection then the + /// customSliderDirectionEntity argument must also be provided. + /// customSliderDirectionEntity : If the sliderDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the custom slider direction. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsSliderJointMotion(JointDirections sliderDirection, const core::Ptr& customSliderDirectionEntity = NULL); + + /// Defines the relationship between the two joint geometries as a cylindrical joint. + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// from. + /// Returns true if the operation was successful. + bool setAsCylindricalJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity = NULL); + + /// Defines the relationship between the two joint geometries as a pin-slot joint. + /// rotationAxis : Specifies which axis the rotation is around. If this is set to CustomJointDirection then the + /// customRotationAxisEntity argument must also be provided. + /// slideDirection : Specifies which axis the slide direction is along. If this is set to CustomJointDirection then the + /// customSlideDirectionEntity argument must also be provided. + /// customRotationAxisEntity : If the rotationAxis is customAxisEntity this argument is used to specify the entity that defines + /// the custom axis of rotation. This can be several types of entities that an axis can be derived + /// customSlideDirectionEntity : If the slideDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the custom slide direction. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsPinSlotJointMotion(JointDirections rotationAxis, JointDirections slideDirection, const core::Ptr& customRotationAxisEntity = NULL, const core::Ptr& customSlideDirectionEntity = NULL); + + /// Defines the relationship between the two joint geometries as a planar joint. + /// normalDirection : Defines the direction of the normal of the single degree of rotation. + /// This can be set to XAxisJointDirection, YAxisJointDirection, ZAxisJointDirection, + /// or CustomJointDirection. If set to CustomJointDirection then the customNormalDirectionEntity + /// argument must also be provided. + /// customNormalDirectionEntity : If the normalDirection is CustomJointDirection this argument is used to specify the entity that defines + /// the direction of the normal. This can be several types of entities that can define a direction. + /// customPrimarySlideDirection : This arguments defines the direction of the primary slide direction. A default primary slide direction + /// is automatically chosen and will be used if this argument is not provided or is null. The secondary slide + /// direction is automatically inferred from the normal and primary slide directions. + /// Returns true if the operation was successful. + bool setAsPlanarJointMotion(JointDirections normalDirection, const core::Ptr& customNormalDirectionEntity = NULL, const core::Ptr& customPrimarySlideDirection = NULL); + + /// Defines the relationship between the two joint geometries as a ball joint. + /// pitchDirection : Defines the direction the pitch angle is measured from. This can be ZAxisJointDirection or CustomJointDirection. If + /// CustomJointDirection is specified then you must also provide a value for the customPitchDirection argument. + /// yawDirection : Defines the direction the yaw is measured from. This can be XAxisJointDirection or CustomJointDirection. If + /// CustomJointDirection is specified then you must also provide a value for the customYawDirection argument. + /// customPitchDirection : If the pitchDirection argument is customPitchDirection this argument is used to define the direction the pitch + /// angel is measured from. This can be several types of entities that can define a direction. + /// customYawDirection : If the yawDirection argument is customPitchDirection this argument is used to define the direction the yaw + /// angel is measured from. This can be several types of entities that can define a direction. + /// Returns true if the operation was successful. + bool setAsBallJointMotion(JointDirections pitchDirection, JointDirections yawDirection, const core::Ptr& customPitchDirection = NULL, const core::Ptr& customYawDirection = NULL); + + /// Returns an object derived from JointMotion that defines how the motion between the two joint geometries is defined. + core::Ptr jointMotion() const; + + ADSK_FUSION_JOINTINPUT_API static const char* classType(); + ADSK_FUSION_JOINTINPUT_API const char* objectType() const override; + ADSK_FUSION_JOINTINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINTINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* geometryOrOriginOne_raw() const = 0; + virtual bool geometryOrOriginOne_raw(core::Base* value) = 0; + virtual core::Base* geometryOrOriginTwo_raw() const = 0; + virtual bool geometryOrOriginTwo_raw(core::Base* value) = 0; + virtual core::ValueInput* angle_raw() const = 0; + virtual bool angle_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* offset_raw() const = 0; + virtual bool offset_raw(core::ValueInput* value) = 0; + virtual bool isFlipped_raw() const = 0; + virtual bool isFlipped_raw(bool value) = 0; + virtual bool setAsRigidJointMotion_raw() = 0; + virtual bool setAsRevoluteJointMotion_raw(JointDirections rotationAxis, core::Base* customRotationAxisEntity) = 0; + virtual bool setAsSliderJointMotion_raw(JointDirections sliderDirection, core::Base* customSliderDirectionEntity) = 0; + virtual bool setAsCylindricalJointMotion_raw(JointDirections rotationAxis, core::Base* customRotationAxisEntity) = 0; + virtual bool setAsPinSlotJointMotion_raw(JointDirections rotationAxis, JointDirections slideDirection, core::Base* customRotationAxisEntity, core::Base* customSlideDirectionEntity) = 0; + virtual bool setAsPlanarJointMotion_raw(JointDirections normalDirection, core::Base* customNormalDirectionEntity, core::Base* customPrimarySlideDirection) = 0; + virtual bool setAsBallJointMotion_raw(JointDirections pitchDirection, JointDirections yawDirection, core::Base* customPitchDirection, core::Base* customYawDirection) = 0; + virtual JointMotion* jointMotion_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr JointInput::geometryOrOriginOne() const +{ + core::Ptr res = geometryOrOriginOne_raw(); + return res; +} + +inline bool JointInput::geometryOrOriginOne(const core::Ptr& value) +{ + return geometryOrOriginOne_raw(value.get()); +} + +inline core::Ptr JointInput::geometryOrOriginTwo() const +{ + core::Ptr res = geometryOrOriginTwo_raw(); + return res; +} + +inline bool JointInput::geometryOrOriginTwo(const core::Ptr& value) +{ + return geometryOrOriginTwo_raw(value.get()); +} + +inline core::Ptr JointInput::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline bool JointInput::angle(const core::Ptr& value) +{ + return angle_raw(value.get()); +} + +inline core::Ptr JointInput::offset() const +{ + core::Ptr res = offset_raw(); + return res; +} + +inline bool JointInput::offset(const core::Ptr& value) +{ + return offset_raw(value.get()); +} + +inline bool JointInput::isFlipped() const +{ + bool res = isFlipped_raw(); + return res; +} + +inline bool JointInput::isFlipped(bool value) +{ + return isFlipped_raw(value); +} + +inline bool JointInput::setAsRigidJointMotion() +{ + bool res = setAsRigidJointMotion_raw(); + return res; +} + +inline bool JointInput::setAsRevoluteJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity) +{ + bool res = setAsRevoluteJointMotion_raw(rotationAxis, customRotationAxisEntity.get()); + return res; +} + +inline bool JointInput::setAsSliderJointMotion(JointDirections sliderDirection, const core::Ptr& customSliderDirectionEntity) +{ + bool res = setAsSliderJointMotion_raw(sliderDirection, customSliderDirectionEntity.get()); + return res; +} + +inline bool JointInput::setAsCylindricalJointMotion(JointDirections rotationAxis, const core::Ptr& customRotationAxisEntity) +{ + bool res = setAsCylindricalJointMotion_raw(rotationAxis, customRotationAxisEntity.get()); + return res; +} + +inline bool JointInput::setAsPinSlotJointMotion(JointDirections rotationAxis, JointDirections slideDirection, const core::Ptr& customRotationAxisEntity, const core::Ptr& customSlideDirectionEntity) +{ + bool res = setAsPinSlotJointMotion_raw(rotationAxis, slideDirection, customRotationAxisEntity.get(), customSlideDirectionEntity.get()); + return res; +} + +inline bool JointInput::setAsPlanarJointMotion(JointDirections normalDirection, const core::Ptr& customNormalDirectionEntity, const core::Ptr& customPrimarySlideDirection) +{ + bool res = setAsPlanarJointMotion_raw(normalDirection, customNormalDirectionEntity.get(), customPrimarySlideDirection.get()); + return res; +} + +inline bool JointInput::setAsBallJointMotion(JointDirections pitchDirection, JointDirections yawDirection, const core::Ptr& customPitchDirection, const core::Ptr& customYawDirection) +{ + bool res = setAsBallJointMotion_raw(pitchDirection, yawDirection, customPitchDirection.get(), customYawDirection.get()); + return res; +} + +inline core::Ptr JointInput::jointMotion() const +{ + core::Ptr res = jointMotion_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINTINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/JointLimits.h b/usr/autodesk/CPP/include/Fusion/Components/JointLimits.h new file mode 100644 index 0000000..82254d5 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/JointLimits.h @@ -0,0 +1,157 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINTLIMITS_CPP__ +# define ADSK_FUSION_JOINTLIMITS_API XI_EXPORT +# else +# define ADSK_FUSION_JOINTLIMITS_API +# endif +#else +# define ADSK_FUSION_JOINTLIMITS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Used to define limits for the range of motion of a joint. +class JointLimits : public core::Base { +public: + + /// The minimum value of the value. This is in either centimeters + /// or radians depending on if the joint value this is associated with + /// defines a distance or an angle. + double minimumValue() const; + bool minimumValue(double value); + + /// The maximum value of the value. This is in either centimeters + /// or radians depending on if the joint value this is associated with + /// defines a distance or an angle. + double maximumValue() const; + bool maximumValue(double value); + + /// The resting state value. This is in either centimeters + /// or radians depending on if the joint value this is associated with + /// defines a distance or an angle. + double restValue() const; + bool restValue(double value); + + /// Gets and sets whether the minimum joint limit is enabled or not. + bool isMinimumValueEnabled() const; + bool isMinimumValueEnabled(bool value); + + /// Gets and sets whether the maximum joint limit is enabled or not. + bool isMaximumValueEnabled() const; + bool isMaximumValueEnabled(bool value); + + /// Gets and sets whether the resting joint value is enabled or not. + bool isRestValueEnabled() const; + bool isRestValueEnabled(bool value); + + ADSK_FUSION_JOINTLIMITS_API static const char* classType(); + ADSK_FUSION_JOINTLIMITS_API const char* objectType() const override; + ADSK_FUSION_JOINTLIMITS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINTLIMITS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual double minimumValue_raw() const = 0; + virtual bool minimumValue_raw(double value) = 0; + virtual double maximumValue_raw() const = 0; + virtual bool maximumValue_raw(double value) = 0; + virtual double restValue_raw() const = 0; + virtual bool restValue_raw(double value) = 0; + virtual bool isMinimumValueEnabled_raw() const = 0; + virtual bool isMinimumValueEnabled_raw(bool value) = 0; + virtual bool isMaximumValueEnabled_raw() const = 0; + virtual bool isMaximumValueEnabled_raw(bool value) = 0; + virtual bool isRestValueEnabled_raw() const = 0; + virtual bool isRestValueEnabled_raw(bool value) = 0; +}; + +// Inline wrappers + +inline double JointLimits::minimumValue() const +{ + double res = minimumValue_raw(); + return res; +} + +inline bool JointLimits::minimumValue(double value) +{ + return minimumValue_raw(value); +} + +inline double JointLimits::maximumValue() const +{ + double res = maximumValue_raw(); + return res; +} + +inline bool JointLimits::maximumValue(double value) +{ + return maximumValue_raw(value); +} + +inline double JointLimits::restValue() const +{ + double res = restValue_raw(); + return res; +} + +inline bool JointLimits::restValue(double value) +{ + return restValue_raw(value); +} + +inline bool JointLimits::isMinimumValueEnabled() const +{ + bool res = isMinimumValueEnabled_raw(); + return res; +} + +inline bool JointLimits::isMinimumValueEnabled(bool value) +{ + return isMinimumValueEnabled_raw(value); +} + +inline bool JointLimits::isMaximumValueEnabled() const +{ + bool res = isMaximumValueEnabled_raw(); + return res; +} + +inline bool JointLimits::isMaximumValueEnabled(bool value) +{ + return isMaximumValueEnabled_raw(value); +} + +inline bool JointLimits::isRestValueEnabled() const +{ + bool res = isRestValueEnabled_raw(); + return res; +} + +inline bool JointLimits::isRestValueEnabled(bool value) +{ + return isRestValueEnabled_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINTLIMITS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/JointList.h b/usr/autodesk/CPP/include/Fusion/Components/JointList.h new file mode 100644 index 0000000..77f3c4e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/JointList.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINTLIST_CPP__ +# define ADSK_FUSION_JOINTLIST_API XI_EXPORT +# else +# define ADSK_FUSION_JOINTLIST_API +# endif +#else +# define ADSK_FUSION_JOINTLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Joint; +}} + +namespace adsk { namespace fusion { + +/// A list of joints. +class JointList : public core::Base { +public: + + /// Function that returns the specified joint using an index into the list. + /// index : The index of the item within the list to return. The first item in the list has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified joint using a name. + /// name : The name of the item within the list to return. + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns number of joints in the list. + size_t count() const; + + typedef Joint iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_JOINTLIST_API static const char* classType(); + ADSK_FUSION_JOINTLIST_API const char* objectType() const override; + ADSK_FUSION_JOINTLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINTLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Joint* item_raw(size_t index) const = 0; + virtual Joint* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr JointList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr JointList::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t JointList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void JointList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINTLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/JointMotion.h b/usr/autodesk/CPP/include/Fusion/Components/JointMotion.h new file mode 100644 index 0000000..f2e1bc3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/JointMotion.h @@ -0,0 +1,75 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINTMOTION_CPP__ +# define ADSK_FUSION_JOINTMOTION_API XI_EXPORT +# else +# define ADSK_FUSION_JOINTMOTION_API +# endif +#else +# define ADSK_FUSION_JOINTMOTION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The base class for the classes that represent all of the +/// various joint types. +class JointMotion : public core::Base { +public: + + /// Returns an enum value indicating the type of joint this joint represents. + JointTypes jointType() const; + + ADSK_FUSION_JOINTMOTION_API static const char* classType(); + ADSK_FUSION_JOINTMOTION_API const char* objectType() const override; + ADSK_FUSION_JOINTMOTION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINTMOTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual JointTypes jointType_raw() const = 0; + virtual void placeholderJointMotion0() {} + virtual void placeholderJointMotion1() {} + virtual void placeholderJointMotion2() {} + virtual void placeholderJointMotion3() {} + virtual void placeholderJointMotion4() {} + virtual void placeholderJointMotion5() {} + virtual void placeholderJointMotion6() {} + virtual void placeholderJointMotion7() {} + virtual void placeholderJointMotion8() {} + virtual void placeholderJointMotion9() {} + virtual void placeholderJointMotion10() {} + virtual void placeholderJointMotion11() {} + virtual void placeholderJointMotion12() {} + virtual void placeholderJointMotion13() {} + virtual void placeholderJointMotion14() {} +}; + +// Inline wrappers + +inline JointTypes JointMotion::jointType() const +{ + JointTypes res = jointType_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINTMOTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/JointOrigin.h b/usr/autodesk/CPP/include/Fusion/Components/JointOrigin.h new file mode 100644 index 0000000..1734a93 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/JointOrigin.h @@ -0,0 +1,344 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINTORIGIN_CPP__ +# define ADSK_FUSION_JOINTORIGIN_API XI_EXPORT +# else +# define ADSK_FUSION_JOINTORIGIN_API +# endif +#else +# define ADSK_FUSION_JOINTORIGIN_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class JointGeometry; + class ModelParameter; + class Occurrence; + class TimelineObject; +}} +namespace adsk { namespace core { + class Attributes; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Represents an existing joint origin in a design. +class JointOrigin : public core::Base { +public: + + /// Returns the parent component that owns this joint origin. + core::Ptr parentComponent() const; + + /// Gets and sets the name of this joint origin. This is the name seen by the user in the timeline. + std::string name() const; + bool name(const std::string& value); + + /// Gets and sets the joint geometry for this joint origin input. This + /// defines the location of the joint origin. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: joint.timelineObject.rollTo(True) + core::Ptr geometry() const; + bool geometry(const core::Ptr& value); + + /// Gets the parameter that controls the angle. The value can be changed + /// using the functionality of the returned ModelParameter object. + core::Ptr angle() const; + + /// Gets the parameter that controls the X offset direction. The value can be changed + /// using the functionality of the returned ModelParameter object. + core::Ptr offsetX() const; + + /// Gets the parameter that controls the Y offset direction. The value can be changed + /// using the functionality of the returned ModelParameter object. + core::Ptr offsetY() const; + + /// Gets the parameter that controls the Z offset direction. The value can be changed + /// using the functionality of the returned ModelParameter object. + core::Ptr offsetZ() const; + + /// Gets and sets if the joint origin direction is flipped or not. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: joint.timelineObject.rollTo(True) + bool isFlipped() const; + bool isFlipped(bool value); + + /// Gets and sets the entity that defines the X axis direction. This defaults + /// to null meaning the X axis is inferred from the input geometry. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: joint.timelineObject.rollTo(True) + core::Ptr xAxisEntity() const; + bool xAxisEntity(const core::Ptr& value); + + /// Gets and sets the entity that defines the Z axis direction. This defaults + /// to null meaning the Z axis is inferred from the input geometry. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: joint.timelineObject.rollTo(True) + core::Ptr zAxisEntity() const; + bool zAxisEntity(const core::Ptr& value); + + /// Returns the direction of the primary axis that's been calculated for this joint origin. + core::Ptr primaryAxisVector() const; + + /// Returns the direction of the secondary axis that's been calculated for this joint origin. + core::Ptr secondaryAxisVector() const; + + /// Returns the direction of the third axis that's been calculated for this joint origin. + core::Ptr thirdAxisVector() const; + + /// Deletes this joint origin. + /// Returns true if successful. + bool deleteMe(); + + /// Returns the timeline object associated with this joint origin. + core::Ptr timelineObject() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// Returns the collection of attributes associated with this joint origin. + core::Ptr attributes() const; + + /// Returns a token for the JointOrigin object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same joint origin. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_JOINTORIGIN_API static const char* classType(); + ADSK_FUSION_JOINTORIGIN_API const char* objectType() const override; + ADSK_FUSION_JOINTORIGIN_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINTORIGIN_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Component* parentComponent_raw() const = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual JointGeometry* geometry_raw() const = 0; + virtual bool geometry_raw(JointGeometry* value) = 0; + virtual ModelParameter* angle_raw() const = 0; + virtual ModelParameter* offsetX_raw() const = 0; + virtual ModelParameter* offsetY_raw() const = 0; + virtual ModelParameter* offsetZ_raw() const = 0; + virtual bool isFlipped_raw() const = 0; + virtual bool isFlipped_raw(bool value) = 0; + virtual core::Base* xAxisEntity_raw() const = 0; + virtual bool xAxisEntity_raw(core::Base* value) = 0; + virtual core::Base* zAxisEntity_raw() const = 0; + virtual bool zAxisEntity_raw(core::Base* value) = 0; + virtual core::Vector3D* primaryAxisVector_raw() const = 0; + virtual core::Vector3D* secondaryAxisVector_raw() const = 0; + virtual core::Vector3D* thirdAxisVector_raw() const = 0; + virtual bool deleteMe_raw() = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual JointOrigin* nativeObject_raw() const = 0; + virtual JointOrigin* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr JointOrigin::parentComponent() const +{ + core::Ptr res = parentComponent_raw(); + return res; +} + +inline std::string JointOrigin::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool JointOrigin::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline core::Ptr JointOrigin::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline bool JointOrigin::geometry(const core::Ptr& value) +{ + return geometry_raw(value.get()); +} + +inline core::Ptr JointOrigin::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline core::Ptr JointOrigin::offsetX() const +{ + core::Ptr res = offsetX_raw(); + return res; +} + +inline core::Ptr JointOrigin::offsetY() const +{ + core::Ptr res = offsetY_raw(); + return res; +} + +inline core::Ptr JointOrigin::offsetZ() const +{ + core::Ptr res = offsetZ_raw(); + return res; +} + +inline bool JointOrigin::isFlipped() const +{ + bool res = isFlipped_raw(); + return res; +} + +inline bool JointOrigin::isFlipped(bool value) +{ + return isFlipped_raw(value); +} + +inline core::Ptr JointOrigin::xAxisEntity() const +{ + core::Ptr res = xAxisEntity_raw(); + return res; +} + +inline bool JointOrigin::xAxisEntity(const core::Ptr& value) +{ + return xAxisEntity_raw(value.get()); +} + +inline core::Ptr JointOrigin::zAxisEntity() const +{ + core::Ptr res = zAxisEntity_raw(); + return res; +} + +inline bool JointOrigin::zAxisEntity(const core::Ptr& value) +{ + return zAxisEntity_raw(value.get()); +} + +inline core::Ptr JointOrigin::primaryAxisVector() const +{ + core::Ptr res = primaryAxisVector_raw(); + return res; +} + +inline core::Ptr JointOrigin::secondaryAxisVector() const +{ + core::Ptr res = secondaryAxisVector_raw(); + return res; +} + +inline core::Ptr JointOrigin::thirdAxisVector() const +{ + core::Ptr res = thirdAxisVector_raw(); + return res; +} + +inline bool JointOrigin::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline core::Ptr JointOrigin::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline core::Ptr JointOrigin::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr JointOrigin::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr JointOrigin::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr JointOrigin::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline std::string JointOrigin::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINTORIGIN_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/JointOriginInput.h b/usr/autodesk/CPP/include/Fusion/Components/JointOriginInput.h new file mode 100644 index 0000000..1f625f6 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/JointOriginInput.h @@ -0,0 +1,236 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINTORIGININPUT_CPP__ +# define ADSK_FUSION_JOINTORIGININPUT_API XI_EXPORT +# else +# define ADSK_FUSION_JOINTORIGININPUT_API +# endif +#else +# define ADSK_FUSION_JOINTORIGININPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointGeometry; +}} +namespace adsk { namespace core { + class ValueInput; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Defines all of the information required to create a new joint origin. This object provides +/// equivalent functionality to the Joint Origin command dialog in that it gathers the required +/// information to create a joint origin. +class JointOriginInput : public core::Base { +public: + + /// Gets and sets the joint geometry for this joint origin input. This + /// defines the location of the joint origin. + core::Ptr geometry() const; + bool geometry(const core::Ptr& value); + + /// Gets and sets the value that defines the angle for the joint origin. This defaults to zero + /// if it's not specified. The value defines an angle and if the ValueInput is defined using + /// the createByReal method the value is assumed to be radians. + core::Ptr angle() const; + bool angle(const core::Ptr& value); + + /// Gets and sets the value that defines the X offset direction. This defaults to zero + /// if it's not specified. The value defines a distance and if the ValueInput is defined using + /// the createByReal method the value is assumed to be centimeters. + core::Ptr offsetX() const; + bool offsetX(const core::Ptr& value); + + /// Gets and sets the value that defines the Y offset direction. This defaults to zero + /// if it's not specified. The value defines a distance and if the ValueInput is defined using + /// the createByReal method the value is assumed to be centimeters. + core::Ptr offsetY() const; + bool offsetY(const core::Ptr& value); + + /// Gets and sets the value that defines the Z offset direction. This defaults to zero + /// if it's not specified. The value defines a distance and if the ValueInput is defined using + /// the createByReal method the value is assumed to be centimeters. + core::Ptr offsetZ() const; + bool offsetZ(const core::Ptr& value); + + /// Gets and sets if the joint origin direction is flipped or not. + bool isFlipped() const; + bool isFlipped(bool value); + + /// Gets and sets the entity that defines the X axis direction. This defaults + /// to null meaning the X axis is inferred from the input geometry. + core::Ptr xAxisEntity() const; + bool xAxisEntity(const core::Ptr& value); + + /// Gets and sets the entity that defines the Z axis direction. This defaults + /// to null meaning the Z axis is inferred from the input geometry. + core::Ptr zAxisEntity() const; + bool zAxisEntity(const core::Ptr& value); + + /// Returns the direction of the primary axis that's been calculated for this joint origin. + core::Ptr primaryAxisVector() const; + + /// Returns the direction of the secondary axis that's been calculated for this joint origin. + core::Ptr secondaryAxisVector() const; + + /// Returns the direction of the third axis that's been calculated for this joint origin. + core::Ptr thirdAxisVector() const; + + ADSK_FUSION_JOINTORIGININPUT_API static const char* classType(); + ADSK_FUSION_JOINTORIGININPUT_API const char* objectType() const override; + ADSK_FUSION_JOINTORIGININPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINTORIGININPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual JointGeometry* geometry_raw() const = 0; + virtual bool geometry_raw(JointGeometry* value) = 0; + virtual core::ValueInput* angle_raw() const = 0; + virtual bool angle_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* offsetX_raw() const = 0; + virtual bool offsetX_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* offsetY_raw() const = 0; + virtual bool offsetY_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* offsetZ_raw() const = 0; + virtual bool offsetZ_raw(core::ValueInput* value) = 0; + virtual bool isFlipped_raw() const = 0; + virtual bool isFlipped_raw(bool value) = 0; + virtual core::Base* xAxisEntity_raw() const = 0; + virtual bool xAxisEntity_raw(core::Base* value) = 0; + virtual core::Base* zAxisEntity_raw() const = 0; + virtual bool zAxisEntity_raw(core::Base* value) = 0; + virtual core::Vector3D* primaryAxisVector_raw() const = 0; + virtual core::Vector3D* secondaryAxisVector_raw() const = 0; + virtual core::Vector3D* thirdAxisVector_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr JointOriginInput::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline bool JointOriginInput::geometry(const core::Ptr& value) +{ + return geometry_raw(value.get()); +} + +inline core::Ptr JointOriginInput::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline bool JointOriginInput::angle(const core::Ptr& value) +{ + return angle_raw(value.get()); +} + +inline core::Ptr JointOriginInput::offsetX() const +{ + core::Ptr res = offsetX_raw(); + return res; +} + +inline bool JointOriginInput::offsetX(const core::Ptr& value) +{ + return offsetX_raw(value.get()); +} + +inline core::Ptr JointOriginInput::offsetY() const +{ + core::Ptr res = offsetY_raw(); + return res; +} + +inline bool JointOriginInput::offsetY(const core::Ptr& value) +{ + return offsetY_raw(value.get()); +} + +inline core::Ptr JointOriginInput::offsetZ() const +{ + core::Ptr res = offsetZ_raw(); + return res; +} + +inline bool JointOriginInput::offsetZ(const core::Ptr& value) +{ + return offsetZ_raw(value.get()); +} + +inline bool JointOriginInput::isFlipped() const +{ + bool res = isFlipped_raw(); + return res; +} + +inline bool JointOriginInput::isFlipped(bool value) +{ + return isFlipped_raw(value); +} + +inline core::Ptr JointOriginInput::xAxisEntity() const +{ + core::Ptr res = xAxisEntity_raw(); + return res; +} + +inline bool JointOriginInput::xAxisEntity(const core::Ptr& value) +{ + return xAxisEntity_raw(value.get()); +} + +inline core::Ptr JointOriginInput::zAxisEntity() const +{ + core::Ptr res = zAxisEntity_raw(); + return res; +} + +inline bool JointOriginInput::zAxisEntity(const core::Ptr& value) +{ + return zAxisEntity_raw(value.get()); +} + +inline core::Ptr JointOriginInput::primaryAxisVector() const +{ + core::Ptr res = primaryAxisVector_raw(); + return res; +} + +inline core::Ptr JointOriginInput::secondaryAxisVector() const +{ + core::Ptr res = secondaryAxisVector_raw(); + return res; +} + +inline core::Ptr JointOriginInput::thirdAxisVector() const +{ + core::Ptr res = thirdAxisVector_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINTORIGININPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/JointOriginList.h b/usr/autodesk/CPP/include/Fusion/Components/JointOriginList.h new file mode 100644 index 0000000..6f6fb42 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/JointOriginList.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINTORIGINLIST_CPP__ +# define ADSK_FUSION_JOINTORIGINLIST_API XI_EXPORT +# else +# define ADSK_FUSION_JOINTORIGINLIST_API +# endif +#else +# define ADSK_FUSION_JOINTORIGINLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointOrigin; +}} + +namespace adsk { namespace fusion { + +/// A list of joint origins. +class JointOriginList : public core::Base { +public: + + /// Function that returns the specified joint origin using an index into the list. + /// index : The index of the item within the list to return. The first item in the list has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified joint origin using a name. + /// name : The name of the item within the list to return. + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns number of joint origins in the list. + size_t count() const; + + typedef JointOrigin iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_JOINTORIGINLIST_API static const char* classType(); + ADSK_FUSION_JOINTORIGINLIST_API const char* objectType() const override; + ADSK_FUSION_JOINTORIGINLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINTORIGINLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual JointOrigin* item_raw(size_t index) const = 0; + virtual JointOrigin* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr JointOriginList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr JointOriginList::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t JointOriginList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void JointOriginList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINTORIGINLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/JointOrigins.h b/usr/autodesk/CPP/include/Fusion/Components/JointOrigins.h new file mode 100644 index 0000000..e542cc6 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/JointOrigins.h @@ -0,0 +1,132 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINTORIGINS_CPP__ +# define ADSK_FUSION_JOINTORIGINS_API XI_EXPORT +# else +# define ADSK_FUSION_JOINTORIGINS_API +# endif +#else +# define ADSK_FUSION_JOINTORIGINS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointGeometry; + class JointOrigin; + class JointOriginInput; +}} + +namespace adsk { namespace fusion { + +/// The collection of joint origins in this component. This provides access to all existing +/// joint origins and supports the ability to create new joint origins. +class JointOrigins : public core::Base { +public: + + /// Function that returns the specified joint origin using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified joint origin using a name. + /// name : The name of the item within the collection to return. + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns number of joint origins in the collection. + size_t count() const; + + /// Creates a JointOriginInput object which is used to collect all of the information + /// needed to create a simple joint origin. The creation of the input object takes the required + /// input as the geometry argument and you can optionally use methods and properties on the created + /// JointOriginInput to set other optional settings. The JointOrigin is created by calling the add + /// method of the JointOrigins object and passing it the JointOriginInput object. + /// geometry : A JointGeometry object that defines the geometry the joint origin will be created on. + /// Returns a JointOriginInput object if successfully created and null if it fails. + core::Ptr createInput(const core::Ptr& geometry); + + /// Create a new joint origin. + /// input : A JointOriginInput object that full defines all of the information needed to create a joint origin. + /// You create a JointOriginInput by using the createInput method of the JointOrigins object. + /// Returns a JointOrigin object if successfully created and null if it fails. + core::Ptr add(const core::Ptr& input); + + typedef JointOrigin iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_JOINTORIGINS_API static const char* classType(); + ADSK_FUSION_JOINTORIGINS_API const char* objectType() const override; + ADSK_FUSION_JOINTORIGINS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINTORIGINS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual JointOrigin* item_raw(size_t index) const = 0; + virtual JointOrigin* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual JointOriginInput* createInput_raw(JointGeometry* geometry) = 0; + virtual JointOrigin* add_raw(JointOriginInput* input) = 0; +}; + +// Inline wrappers + +inline core::Ptr JointOrigins::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr JointOrigins::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t JointOrigins::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr JointOrigins::createInput(const core::Ptr& geometry) +{ + core::Ptr res = createInput_raw(geometry.get()); + return res; +} + +inline core::Ptr JointOrigins::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +template inline void JointOrigins::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINTORIGINS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/Joints.h b/usr/autodesk/CPP/include/Fusion/Components/Joints.h new file mode 100644 index 0000000..3b28fc3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/Joints.h @@ -0,0 +1,135 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_JOINTS_CPP__ +# define ADSK_FUSION_JOINTS_API XI_EXPORT +# else +# define ADSK_FUSION_JOINTS_API +# endif +#else +# define ADSK_FUSION_JOINTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Joint; + class JointInput; +}} + +namespace adsk { namespace fusion { + +/// The collection of joints in this component. This provides access to all existing joints +/// and supports the ability to create new joints. +class Joints : public core::Base { +public: + + /// Function that returns the specified joint using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Creates a JointInput object, which is the API equivalent to the Joint command dialog. You + /// you use methods and properties on the returned class to set the desired options, similar to + /// providing input and setting options in the Joint command dialog. Once the settings are defined + /// you call the Joints.add method passing in the JointInput object to create the actual joint. + /// geometryOrOriginOne : A JointGeometry or JointOrigin object that defines the first set of geometry of the joint. + /// JointGeometry objects are created by using the various static methods on the JointGeometry class + /// and JointOrigin objects are created through the JointOrigins object. + /// geometryOrOriginTwo : A JointGeometry or JointOrigin object that defines the second set of geometry of the joint. + /// JointGeometry objects are created by using the various static methods on the JointGeometry class + /// and JointOrigin objects are created through the JointOrigins object. + /// Returns the JointInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& geometryOrOriginOne, const core::Ptr& geometryOrOriginTwo); + + /// Creates a new joint. + /// input : The JointInput object that defines the geometry and various inputs that fully define a joint. + /// A JointInput object is created using the Joints.createInput method. + /// Returns the newly created Joint or null in the case of failure. + core::Ptr add(const core::Ptr& input); + + /// Returns number of joints in the collection. + size_t count() const; + + /// Function that returns the specified joint using a name. + /// name : The name of the item within the collection to return. + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + typedef Joint iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_JOINTS_API static const char* classType(); + ADSK_FUSION_JOINTS_API const char* objectType() const override; + ADSK_FUSION_JOINTS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_JOINTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Joint* item_raw(size_t index) const = 0; + virtual JointInput* createInput_raw(core::Base* geometryOrOriginOne, core::Base* geometryOrOriginTwo) = 0; + virtual Joint* add_raw(JointInput* input) = 0; + virtual size_t count_raw() const = 0; + virtual Joint* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr Joints::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr Joints::createInput(const core::Ptr& geometryOrOriginOne, const core::Ptr& geometryOrOriginTwo) +{ + core::Ptr res = createInput_raw(geometryOrOriginOne.get(), geometryOrOriginTwo.get()); + return res; +} + +inline core::Ptr Joints::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline size_t Joints::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr Joints::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void Joints::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_JOINTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/Occurrence.h b/usr/autodesk/CPP/include/Fusion/Components/Occurrence.h new file mode 100644 index 0000000..08200ea --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/Occurrence.h @@ -0,0 +1,519 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_OCCURRENCE_CPP__ +# define ADSK_FUSION_OCCURRENCE_API XI_EXPORT +# else +# define ADSK_FUSION_OCCURRENCE_API +# endif +#else +# define ADSK_FUSION_OCCURRENCE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class AsBuiltJointList; + class BRepBodies; + class Component; + class JointList; + class OccurrenceList; + class PhysicalProperties; + class RigidGroupList; + class TimelineObject; +}} +namespace adsk { namespace core { + class Appearance; + class Attributes; + class BoundingBox3D; + class Matrix3D; +}} + +namespace adsk { namespace fusion { + +/// Represents an occurrence of a component at any level within a subassembly. +class Occurrence : public core::Base { +public: + + /// This is the sourceComponent for the occurrence and is affected + /// by the assembly context. + /// This is the top-level component where the path begins. + core::Ptr sourceComponent() const; + + /// Returns a read only list of child occurrences where only the occurrences + /// in this occurrence's AssemblyContext are returned . + core::Ptr childOccurrences() const; + + /// The component this occurrence references. + core::Ptr component() const; + + /// The name of the occurrence. This is the name as seen in the browser. It is a reflection + /// of the component name with an added counter suffix (i.e. 'OccurrenceName:1'). + std::string name() const; + + /// The name of the occurrence, including the full path of occurrences as seen in the browser. + /// The top-level component will depend on the context but will typically be the root component + /// of the design. A name for an occurrence that is at the third level of an assembly could be + /// "Sub1:1+Sub2:1+PartA:1". + std::string fullPathName() const; + + /// Read-write property that gets and sets the appearance override for this occurrence. + /// This property can return null indicating there is no override appearance and that the + /// contents of the occurrence are displayed using there defined appearance. + /// Setting the property to null will remove any override appearance for this occurrence. + core::Ptr appearance() const; + bool appearance(const core::Ptr& value); + + /// Gets and sets if the light bulb of this occurrence as displayed in the browser is on or off. + /// An occurrence will only be visible if the light bulb is switched on. However, + /// the light bulb can be on and the occurrence still invisible if a higher level occurrence + /// in the assembly context is not visible because its light bulb is off. + bool isLightBulbOn() const; + bool isLightBulbOn(bool value); + + /// Gets whether the occurrence is visible. + /// This property is affected by the assembly context. + bool isVisible() const; + + /// Gets and sets the 3d matrix data that defines this occurrences orientation and + /// position in its assembly context + core::Ptr transform() const; + bool transform(const core::Ptr& value); + + /// Deletes the occurrence from the design. If this is the last occurrence + /// referencing a specific Component, the component is also deleted. + /// Returns true if the delete was successful. + bool deleteMe(); + + /// Returns the timeline object associated with the creation of this occurrence. + core::Ptr timelineObject() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// references the component the object is defined within. + /// Returns null in the case where the object is not in the context of an assembly + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + /// The return type is strongly typed for each object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// Fails if this object is not the NativeObject. + /// occurrence : The occurrence that represents the context you want to create this proxy in. + /// Returns the proxy for the occurrence in the context of the specified occurrence. + /// Returns null if it failed. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Gets and sets whether this occurrence is grounded or not. + bool isGrounded() const; + bool isGrounded(bool value); + + /// Gets and sets whether this occurrence is selectable or not. + bool isSelectable() const; + bool isSelectable(bool value); + + /// Gets and sets whether this occurrence is isolated in the UI. When an occurrence + /// is isolated it is the only one visible in the user-interface. Only one occurrence + /// can be isolated at a time so setting this property to true will un-isolate an occurrence + /// that is currently isolated. Setting this property to false for an occurrence that is + /// current isolated will un-isolate it so that no occurrence will be isolated. + bool isIsolated() const; + bool isIsolated(bool value); + + /// Gets whether this occurrence is the active edit target in the user interface. + /// This is the same as checking the state of the radio button next to the occurrence in the browser. + /// To activate the occurrence use the Activate method. + bool isActive() const; + + /// Makes the occurrence the active edit target in the user interface. This is the same + /// as enabling the radio button next to the occurrence in the browser. + /// Returns true if the activation was successful. + bool activate(); + + /// Moves this occurrence from it's current component into the component owned by the specified occurrence. + /// This occurrence and the target occurrence must be in the same context. + /// targetOccurrence : The target occurrence defines both the component and the transform to apply when moving the occurrence. The + /// occurrence will be copied into the parent component of the target occurrence and the target occurrence also defines + /// the transform of how the occurrence will be copied so that the occurrence maintains it's same position in model space. + /// Returns the moved Occurrence or null in the case the move failed. + core::Ptr moveToComponent(const core::Ptr& targetOccurrence); + + /// Returns the PhysicalProperties object that has properties for getting the area, density, mass, volume, moments, etc + /// of this occurrence. Property values will be calculated using the 'LowCalculationAccuracy' setting when using this property + /// to get the PhysicalProperties object. To specify a higher calculation tolerance, use the getPhysicalProperties method instead. + core::Ptr physicalProperties() const; + + /// Gets if this occurrence is referencing an external component. + bool isReferencedComponent() const; + + /// Returns the bounding box of this occurrence. + core::Ptr boundingBox() const; + + /// Returns the joints that affect the position of this occurrence. For example, if a joint has + /// been created between this occurrence and another occurrence, this property will return that + /// joint. If the occurrence is a proxy, the joints returned will also be proxies in the same + /// context as the occurrence. + core::Ptr joints() const; + + /// Returns the rigid groups that this occurrence is a member of. If the occurrence is a proxy, + /// the joints returned will also be proxies in the same context as the occurrence. + core::Ptr rigidGroups() const; + + /// Returns the as-built joints that affect the position of this occurrence. If the occurrence is a proxy, + /// the as-built joints returned will also be proxies in the same context as the occurrence. + core::Ptr asBuiltJoints() const; + + /// Returns the collection of attributes associated with this face. + core::Ptr attributes() const; + + /// Returns the body proxies for the B-Rep bodies in the component referenced by this occurrence. + /// For example if you get the occurrences from the root component and then use this property to + /// get the bodies from those occurrences, the bodies returned will return information in the context of the root + /// component, not the component they actually exist in. + core::Ptr bRepBodies() const; + + /// Returns the PhysicalProperties object that has properties for getting the area, density, mass, volume, moments, etc + /// of this occurrence. + /// accuracy : Specifies the desired level of computational accuracy of the property calculations. + /// The default value of 'LowCalculationAccuracy' returns results within a +/- 1% error margin. + core::Ptr getPhysicalProperties(CalculationAccuracy accuracy = adsk::fusion::LowCalculationAccuracy) const; + + /// The user can set an override opacity for components and these opacity overrides combine if + /// children and parent components have overrides. This property returns the actual opacity that is + /// being used to render the occurrence. To set the opacity use the opacity property of the Component object. + double visibleOpacity() const; + + /// When the component this occurrence references is an external reference (the isReferencedComponent property returns true), + /// this will break the link and create a local Component that this occurrence will reference. The new local Component can + /// be accessed through the Occurrence using the component property. + /// This method will fail if the occurrence is not referencing an external component. + /// Returns true if the break link was successful. + bool breakLink(); + + /// Returns a token for the Occurrence object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same occurrence. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_OCCURRENCE_API static const char* classType(); + ADSK_FUSION_OCCURRENCE_API const char* objectType() const override; + ADSK_FUSION_OCCURRENCE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_OCCURRENCE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Component* sourceComponent_raw() const = 0; + virtual OccurrenceList* childOccurrences_raw() const = 0; + virtual Component* component_raw() const = 0; + virtual char* name_raw() const = 0; + virtual char* fullPathName_raw() const = 0; + virtual core::Appearance* appearance_raw() const = 0; + virtual bool appearance_raw(core::Appearance* value) = 0; + virtual bool isLightBulbOn_raw() const = 0; + virtual bool isLightBulbOn_raw(bool value) = 0; + virtual bool isVisible_raw() const = 0; + virtual core::Matrix3D* transform_raw() const = 0; + virtual bool transform_raw(core::Matrix3D* value) = 0; + virtual bool deleteMe_raw() = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual Occurrence* nativeObject_raw() const = 0; + virtual Occurrence* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual bool isGrounded_raw() const = 0; + virtual bool isGrounded_raw(bool value) = 0; + virtual bool isSelectable_raw() const = 0; + virtual bool isSelectable_raw(bool value) = 0; + virtual bool isIsolated_raw() const = 0; + virtual bool isIsolated_raw(bool value) = 0; + virtual bool isActive_raw() const = 0; + virtual bool activate_raw() = 0; + virtual Occurrence* moveToComponent_raw(Occurrence* targetOccurrence) = 0; + virtual PhysicalProperties* physicalProperties_raw() const = 0; + virtual bool isReferencedComponent_raw() const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual JointList* joints_raw() const = 0; + virtual RigidGroupList* rigidGroups_raw() const = 0; + virtual AsBuiltJointList* asBuiltJoints_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual BRepBodies* bRepBodies_raw() const = 0; + virtual PhysicalProperties* getPhysicalProperties_raw(CalculationAccuracy accuracy) const = 0; + virtual double visibleOpacity_raw() const = 0; + virtual bool breakLink_raw() = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr Occurrence::sourceComponent() const +{ + core::Ptr res = sourceComponent_raw(); + return res; +} + +inline core::Ptr Occurrence::childOccurrences() const +{ + core::Ptr res = childOccurrences_raw(); + return res; +} + +inline core::Ptr Occurrence::component() const +{ + core::Ptr res = component_raw(); + return res; +} + +inline std::string Occurrence::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string Occurrence::fullPathName() const +{ + std::string res; + + char* p= fullPathName_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr Occurrence::appearance() const +{ + core::Ptr res = appearance_raw(); + return res; +} + +inline bool Occurrence::appearance(const core::Ptr& value) +{ + return appearance_raw(value.get()); +} + +inline bool Occurrence::isLightBulbOn() const +{ + bool res = isLightBulbOn_raw(); + return res; +} + +inline bool Occurrence::isLightBulbOn(bool value) +{ + return isLightBulbOn_raw(value); +} + +inline bool Occurrence::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline core::Ptr Occurrence::transform() const +{ + core::Ptr res = transform_raw(); + return res; +} + +inline bool Occurrence::transform(const core::Ptr& value) +{ + return transform_raw(value.get()); +} + +inline bool Occurrence::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline core::Ptr Occurrence::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline core::Ptr Occurrence::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr Occurrence::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr Occurrence::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline bool Occurrence::isGrounded() const +{ + bool res = isGrounded_raw(); + return res; +} + +inline bool Occurrence::isGrounded(bool value) +{ + return isGrounded_raw(value); +} + +inline bool Occurrence::isSelectable() const +{ + bool res = isSelectable_raw(); + return res; +} + +inline bool Occurrence::isSelectable(bool value) +{ + return isSelectable_raw(value); +} + +inline bool Occurrence::isIsolated() const +{ + bool res = isIsolated_raw(); + return res; +} + +inline bool Occurrence::isIsolated(bool value) +{ + return isIsolated_raw(value); +} + +inline bool Occurrence::isActive() const +{ + bool res = isActive_raw(); + return res; +} + +inline bool Occurrence::activate() +{ + bool res = activate_raw(); + return res; +} + +inline core::Ptr Occurrence::moveToComponent(const core::Ptr& targetOccurrence) +{ + core::Ptr res = moveToComponent_raw(targetOccurrence.get()); + return res; +} + +inline core::Ptr Occurrence::physicalProperties() const +{ + core::Ptr res = physicalProperties_raw(); + return res; +} + +inline bool Occurrence::isReferencedComponent() const +{ + bool res = isReferencedComponent_raw(); + return res; +} + +inline core::Ptr Occurrence::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline core::Ptr Occurrence::joints() const +{ + core::Ptr res = joints_raw(); + return res; +} + +inline core::Ptr Occurrence::rigidGroups() const +{ + core::Ptr res = rigidGroups_raw(); + return res; +} + +inline core::Ptr Occurrence::asBuiltJoints() const +{ + core::Ptr res = asBuiltJoints_raw(); + return res; +} + +inline core::Ptr Occurrence::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline core::Ptr Occurrence::bRepBodies() const +{ + core::Ptr res = bRepBodies_raw(); + return res; +} + +inline core::Ptr Occurrence::getPhysicalProperties(CalculationAccuracy accuracy) const +{ + core::Ptr res = getPhysicalProperties_raw(accuracy); + return res; +} + +inline double Occurrence::visibleOpacity() const +{ + double res = visibleOpacity_raw(); + return res; +} + +inline bool Occurrence::breakLink() +{ + bool res = breakLink_raw(); + return res; +} + +inline std::string Occurrence::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_OCCURRENCE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/OccurrenceList.h b/usr/autodesk/CPP/include/Fusion/Components/OccurrenceList.h new file mode 100644 index 0000000..05743f2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/OccurrenceList.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_OCCURRENCELIST_CPP__ +# define ADSK_FUSION_OCCURRENCELIST_API XI_EXPORT +# else +# define ADSK_FUSION_OCCURRENCELIST_API +# endif +#else +# define ADSK_FUSION_OCCURRENCELIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Provides a list of occurrences. +class OccurrenceList : public core::Base { +public: + + /// Returns the specified occurrence using an index into the collection. + /// index : The index of the occurrence within the collection to return. The first item has an index of 0. + /// Returns the specified occurrence or null in the case of an invalid index. + core::Ptr item(size_t index) const; + + /// Returns the number of occurrences in the collection. + size_t count() const; + + /// Returns the specified occurrence using the name of the occurrence. + /// name : The name of the occurrence to return. + /// Returns the occurrence or null if an invalid name was specified + core::Ptr itemByName(const std::string& name) const; + + typedef Occurrence iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_OCCURRENCELIST_API static const char* classType(); + ADSK_FUSION_OCCURRENCELIST_API const char* objectType() const override; + ADSK_FUSION_OCCURRENCELIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_OCCURRENCELIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Occurrence* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual Occurrence* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr OccurrenceList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t OccurrenceList::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr OccurrenceList::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void OccurrenceList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_OCCURRENCELIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/Occurrences.h b/usr/autodesk/CPP/include/Fusion/Components/Occurrences.h new file mode 100644 index 0000000..a0b60d6 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/Occurrences.h @@ -0,0 +1,150 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_OCCURRENCES_CPP__ +# define ADSK_FUSION_OCCURRENCES_API XI_EXPORT +# else +# define ADSK_FUSION_OCCURRENCES_API +# endif +#else +# define ADSK_FUSION_OCCURRENCES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class Occurrence; + class OccurrenceList; +}} +namespace adsk { namespace core { + class DataFile; + class Matrix3D; +}} + +namespace adsk { namespace fusion { + +/// Provides access to occurrences within a component and provides +/// methods to create new occurrences. +class Occurrences : public core::Base { +public: + + /// Function that returns the specified occurrence using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of occurrences in the collection. + size_t count() const; + + /// Returns the specified occurrence using the name of the occurrence. + /// name : The name of the occurrence to return. + /// Returns the occurrence or null if an invalid name was specified + core::Ptr itemByName(const std::string& name) const; + + /// Method that creates a new occurrence using an existing component. This is the equivalent + /// of copying and pasting an occurrence in the user interface. + /// component : The existing component to create a new occurrence of. + /// transform : A transform that defines the location for the new occurrence + /// Returns the newly created occurrence or null if the creation failed. + core::Ptr addExistingComponent(const core::Ptr& component, const core::Ptr& transform); + + /// Method that creates a new component and an occurrence that references it. + /// transform : A transform that defines the location for the new occurrence. + /// Returns the newly created occurrence or null if the creation failed. + core::Ptr addNewComponent(const core::Ptr& transform); + + /// Returns the contents of this collection as an OccurrencesList object. This + /// is useful when writing a function that traverses an assembly. + core::Ptr asList() const; + + /// Method that inserts an existing file. + /// dataFile : The dataFile to insert. + /// transform : A transform that defines the location for the new occurrence. + /// isReferencedComponent : Indicates if the insert is to be an external reference or embedded within this document. + /// This method will fail if the dataFile being inserted is not from the same project as the document + /// it is being inserted into while isReferencedComponent is True. + /// Returns the newly created occurrence or null if the insert failed. + /// Insert will fail if the dataFile being inserted is not from the same project as the document + /// it is being inserted into while isReferencedComponent is True. + core::Ptr addByInsert(const core::Ptr& dataFile, const core::Ptr& transform, bool isReferencedComponent); + + ADSK_FUSION_OCCURRENCES_API static const char* classType(); + ADSK_FUSION_OCCURRENCES_API const char* objectType() const override; + ADSK_FUSION_OCCURRENCES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_OCCURRENCES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Occurrence* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual Occurrence* itemByName_raw(const char * name) const = 0; + virtual Occurrence* addExistingComponent_raw(Component* component, core::Matrix3D* transform) = 0; + virtual Occurrence* addNewComponent_raw(core::Matrix3D* transform) = 0; + virtual OccurrenceList* asList_raw() const = 0; + virtual Occurrence* addByInsert_raw(core::DataFile* dataFile, core::Matrix3D* transform, bool isReferencedComponent) = 0; +}; + +// Inline wrappers + +inline core::Ptr Occurrences::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t Occurrences::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr Occurrences::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline core::Ptr Occurrences::addExistingComponent(const core::Ptr& component, const core::Ptr& transform) +{ + core::Ptr res = addExistingComponent_raw(component.get(), transform.get()); + return res; +} + +inline core::Ptr Occurrences::addNewComponent(const core::Ptr& transform) +{ + core::Ptr res = addNewComponent_raw(transform.get()); + return res; +} + +inline core::Ptr Occurrences::asList() const +{ + core::Ptr res = asList_raw(); + return res; +} + +inline core::Ptr Occurrences::addByInsert(const core::Ptr& dataFile, const core::Ptr& transform, bool isReferencedComponent) +{ + core::Ptr res = addByInsert_raw(dataFile.get(), transform.get(), isReferencedComponent); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_OCCURRENCES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/PinSlotJointMotion.h b/usr/autodesk/CPP/include/Fusion/Components/PinSlotJointMotion.h new file mode 100644 index 0000000..2e1fa22 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/PinSlotJointMotion.h @@ -0,0 +1,230 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "JointMotion.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PINSLOTJOINTMOTION_CPP__ +# define ADSK_FUSION_PINSLOTJOINTMOTION_API XI_EXPORT +# else +# define ADSK_FUSION_PINSLOTJOINTMOTION_API +# endif +#else +# define ADSK_FUSION_PINSLOTJOINTMOTION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointLimits; +}} +namespace adsk { namespace core { + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Represents the set of information specific to a pin slot joint. +class PinSlotJointMotion : public JointMotion { +public: + + /// Gets and sets the direction of the axis of rotation. This can be set to + /// XAxisJointDirection, YAxisJointDirection, or ZAxisJointDirection. It can + /// return those three directions and CustomJointDirection. If this returns + /// CustomJointDirection then the customRotationAxisEntity will return an entity + /// that defines the axis. If there is a custom rotation axis defined and this + /// property is set to one of the three standard axes, the custom rotation will + /// be removed and customRotationAxisEntity will return null. + JointDirections rotationAxis() const; + bool rotationAxis(JointDirections value); + + /// Returns the direction of the rotation axis. This property will return null in the case + /// where the PinSlotJointMotion object was obtained from a JointInput object. + core::Ptr rotationAxisVector() const; + + /// This property can be set using various types of entities that can infer an + /// axis. For example, a linear edge, sketch line, planar face, and cylindrical face. + /// This property is only valid in the case where the rotationAxis property returns + /// CustomJointDirection. Setting this property will automatically set + /// the rotationAxis property to CustomJointDirection. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + core::Ptr customRotationAxisEntity() const; + bool customRotationAxisEntity(const core::Ptr& value); + + /// Gets and sets the rotation value. This is in radians. Setting this value is + /// the equivalent of using the Drive Joints command. + double rotationValue() const; + bool rotationValue(double value); + + /// Returns a JointLimits object that defines the rotation limits for this joint. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr rotationLimits() const; + + /// Gets and sets the direction of the slide motion in the slot. This can be set to + /// XAxisJointDirection, YAxisJointDirection, or ZAxisJointDirection. It can + /// return those three directions and CustomJointDirection. If this returns + /// CustomJointDirection then the customSlideDirectionEntity will return an entity + /// that defines the direction. If there is a custom direction defined and this + /// property is set to one of the three standard axes, the custom direction will + /// be removed and customSlideDirectionEntity will return null. + JointDirections slideDirection() const; + bool slideDirection(JointDirections value); + + /// Returns the direction of the primary slide direction. This property will return null in the case + /// where the PinSlotJointMotion object was obtained from a JointInput object. + core::Ptr slideDirectionVector() const; + + /// This property can be set using various types of entities that can infer a + /// direction. For example, a linear edge, sketch line, planar face, and cylindrical face. + /// This property is only valid in the case where the slideDirection property returns + /// CustomJointDirection. Setting this property will automatically set + /// the slideDirection property to CustomJointDirection. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + core::Ptr customSlideDirectionEntity() const; + bool customSlideDirectionEntity(const core::Ptr& value); + + /// Gets and sets the slide value. This is in centimeters. Setting this value is + /// the equivalent of using the Drive Joints command. + double slideValue() const; + bool slideValue(double value); + + /// Returns a JointLimits object that defines the slide limits for this joint. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr slideLimits() const; + + ADSK_FUSION_PINSLOTJOINTMOTION_API static const char* classType(); + ADSK_FUSION_PINSLOTJOINTMOTION_API const char* objectType() const override; + ADSK_FUSION_PINSLOTJOINTMOTION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PINSLOTJOINTMOTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual JointDirections rotationAxis_raw() const = 0; + virtual bool rotationAxis_raw(JointDirections value) = 0; + virtual core::Vector3D* rotationAxisVector_raw() const = 0; + virtual core::Base* customRotationAxisEntity_raw() const = 0; + virtual bool customRotationAxisEntity_raw(core::Base* value) = 0; + virtual double rotationValue_raw() const = 0; + virtual bool rotationValue_raw(double value) = 0; + virtual JointLimits* rotationLimits_raw() const = 0; + virtual JointDirections slideDirection_raw() const = 0; + virtual bool slideDirection_raw(JointDirections value) = 0; + virtual core::Vector3D* slideDirectionVector_raw() const = 0; + virtual core::Base* customSlideDirectionEntity_raw() const = 0; + virtual bool customSlideDirectionEntity_raw(core::Base* value) = 0; + virtual double slideValue_raw() const = 0; + virtual bool slideValue_raw(double value) = 0; + virtual JointLimits* slideLimits_raw() const = 0; +}; + +// Inline wrappers + +inline JointDirections PinSlotJointMotion::rotationAxis() const +{ + JointDirections res = rotationAxis_raw(); + return res; +} + +inline bool PinSlotJointMotion::rotationAxis(JointDirections value) +{ + return rotationAxis_raw(value); +} + +inline core::Ptr PinSlotJointMotion::rotationAxisVector() const +{ + core::Ptr res = rotationAxisVector_raw(); + return res; +} + +inline core::Ptr PinSlotJointMotion::customRotationAxisEntity() const +{ + core::Ptr res = customRotationAxisEntity_raw(); + return res; +} + +inline bool PinSlotJointMotion::customRotationAxisEntity(const core::Ptr& value) +{ + return customRotationAxisEntity_raw(value.get()); +} + +inline double PinSlotJointMotion::rotationValue() const +{ + double res = rotationValue_raw(); + return res; +} + +inline bool PinSlotJointMotion::rotationValue(double value) +{ + return rotationValue_raw(value); +} + +inline core::Ptr PinSlotJointMotion::rotationLimits() const +{ + core::Ptr res = rotationLimits_raw(); + return res; +} + +inline JointDirections PinSlotJointMotion::slideDirection() const +{ + JointDirections res = slideDirection_raw(); + return res; +} + +inline bool PinSlotJointMotion::slideDirection(JointDirections value) +{ + return slideDirection_raw(value); +} + +inline core::Ptr PinSlotJointMotion::slideDirectionVector() const +{ + core::Ptr res = slideDirectionVector_raw(); + return res; +} + +inline core::Ptr PinSlotJointMotion::customSlideDirectionEntity() const +{ + core::Ptr res = customSlideDirectionEntity_raw(); + return res; +} + +inline bool PinSlotJointMotion::customSlideDirectionEntity(const core::Ptr& value) +{ + return customSlideDirectionEntity_raw(value.get()); +} + +inline double PinSlotJointMotion::slideValue() const +{ + double res = slideValue_raw(); + return res; +} + +inline bool PinSlotJointMotion::slideValue(double value) +{ + return slideValue_raw(value); +} + +inline core::Ptr PinSlotJointMotion::slideLimits() const +{ + core::Ptr res = slideLimits_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PINSLOTJOINTMOTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/PlanarJointMotion.h b/usr/autodesk/CPP/include/Fusion/Components/PlanarJointMotion.h new file mode 100644 index 0000000..904d252 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/PlanarJointMotion.h @@ -0,0 +1,263 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "JointMotion.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PLANARJOINTMOTION_CPP__ +# define ADSK_FUSION_PLANARJOINTMOTION_API XI_EXPORT +# else +# define ADSK_FUSION_PLANARJOINTMOTION_API +# endif +#else +# define ADSK_FUSION_PLANARJOINTMOTION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointLimits; +}} +namespace adsk { namespace core { + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Represents the set of information specific to a planar joint. +class PlanarJointMotion : public JointMotion { +public: + + /// Gets and sets the direction of the normal of the single degree of rotation. + /// This can be set to XAxisJointDirection, YAxisJointDirection, or ZAxisJointDirection. + /// It can return those three directions and CustomJointDirection. If this returns + /// CustomJointDirection then the customNormalDirectionEntity will return an entity + /// that defines the direction. If there is a custom direction defined and this + /// property is set to one of the three standard axes, the custom direction will + /// be removed and customNormalDirectionEntity will return null. + JointDirections normalDirection() const; + bool normalDirection(JointDirections value); + + /// Returns the direction of the normal direction. This property will return null in the case + /// where the PlanarJointMotion object was obtained from a JointInput object. + core::Ptr normalDirectionVector() const; + + /// This property defines a custom normal direction and can be set using various types + /// of entities that can infer a direction. For example, a linear edge, sketch line, + /// planar face, and cylindrical face.This property is only valid in the case where the + /// normalDirection property returns CustomJointDirection. Setting this property will + /// automatically set the normalDirection property to CustomJointDirection. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + core::Ptr customNormalDirectionEntity() const; + bool customNormalDirectionEntity(const core::Ptr& value); + + /// Gets the direction used as the primary direction for the two translational degrees of + /// freedom. The value of this property is automatically set when setting the normalDirection. + /// When reading this value it can return XAxisJointDirection, YAxisJointDirection, ZAxisJointDirection, + /// or CustomJointDirection. If it's CustomJointDirection then the direction the direction can be + /// determined using the primarySlideDirectionVector and the entity controlling the direction can + /// be get and set using the customPrimarySlideDirectionEntity. + JointDirections primarySlideDirection() const; + + /// Returns the direction of the primary slide direction. This property will return null in the case + /// where the PlanarJointMotion object was obtained from a JointInput object. + core::Ptr primarySlideDirectionVector() const; + + /// This property can be set using various types of entities that can infer a + /// direction. For example, a linear edge, sketch line, planar face, and cylindrical face. + /// When reading this property, it is only valid in the case where the primarySlideDirection property returns + /// CustomJointDirection. Setting this property will automatically set the primarySlideDirection property to + /// CustomJointDirection. The entity defining the custom direction by be perpendicular to the normal direction. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + core::Ptr customPrimarySlideDirectionEntity() const; + bool customPrimarySlideDirectionEntity(const core::Ptr& value); + + /// Returns the direction of the secondary slide direction. This property will return null in the case + /// where the PlanarJointMotion object was obtained from a JointInput object. + core::Ptr secondarySlideDirectionVector() const; + + /// Gets and sets the rotation value. This is in radians. Setting this value is + /// the equivalent of using the Drive Joints command. + double rotationValue() const; + bool rotationValue(double value); + + /// Returns a JointLimits object that defines the limits of rotation for this joint. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr rotationLimits() const; + + /// Gets and sets the offset value in the primary direction. This is in centimeters. + /// Setting this value is the equivalent of using the Drive Joints command. + double primarySlideValue() const; + bool primarySlideValue(double value); + + /// Returns a JointLimits object that defines the limits in the primary direction for this joint. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr primarySlideLimits() const; + + /// Gets and sets the offset value in the secondary direction. This is in centimeters. + /// Setting this value is the equivalent of using the Drive Joints command. + double secondarySlideValue() const; + bool secondarySlideValue(double value); + + /// Returns a JointLimits object that defines the limits in the secondary direction for this joint. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr secondarySlideLimits() const; + + ADSK_FUSION_PLANARJOINTMOTION_API static const char* classType(); + ADSK_FUSION_PLANARJOINTMOTION_API const char* objectType() const override; + ADSK_FUSION_PLANARJOINTMOTION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PLANARJOINTMOTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual JointDirections normalDirection_raw() const = 0; + virtual bool normalDirection_raw(JointDirections value) = 0; + virtual core::Vector3D* normalDirectionVector_raw() const = 0; + virtual core::Base* customNormalDirectionEntity_raw() const = 0; + virtual bool customNormalDirectionEntity_raw(core::Base* value) = 0; + virtual JointDirections primarySlideDirection_raw() const = 0; + virtual core::Vector3D* primarySlideDirectionVector_raw() const = 0; + virtual core::Base* customPrimarySlideDirectionEntity_raw() const = 0; + virtual bool customPrimarySlideDirectionEntity_raw(core::Base* value) = 0; + virtual core::Vector3D* secondarySlideDirectionVector_raw() const = 0; + virtual double rotationValue_raw() const = 0; + virtual bool rotationValue_raw(double value) = 0; + virtual JointLimits* rotationLimits_raw() const = 0; + virtual double primarySlideValue_raw() const = 0; + virtual bool primarySlideValue_raw(double value) = 0; + virtual JointLimits* primarySlideLimits_raw() const = 0; + virtual double secondarySlideValue_raw() const = 0; + virtual bool secondarySlideValue_raw(double value) = 0; + virtual JointLimits* secondarySlideLimits_raw() const = 0; +}; + +// Inline wrappers + +inline JointDirections PlanarJointMotion::normalDirection() const +{ + JointDirections res = normalDirection_raw(); + return res; +} + +inline bool PlanarJointMotion::normalDirection(JointDirections value) +{ + return normalDirection_raw(value); +} + +inline core::Ptr PlanarJointMotion::normalDirectionVector() const +{ + core::Ptr res = normalDirectionVector_raw(); + return res; +} + +inline core::Ptr PlanarJointMotion::customNormalDirectionEntity() const +{ + core::Ptr res = customNormalDirectionEntity_raw(); + return res; +} + +inline bool PlanarJointMotion::customNormalDirectionEntity(const core::Ptr& value) +{ + return customNormalDirectionEntity_raw(value.get()); +} + +inline JointDirections PlanarJointMotion::primarySlideDirection() const +{ + JointDirections res = primarySlideDirection_raw(); + return res; +} + +inline core::Ptr PlanarJointMotion::primarySlideDirectionVector() const +{ + core::Ptr res = primarySlideDirectionVector_raw(); + return res; +} + +inline core::Ptr PlanarJointMotion::customPrimarySlideDirectionEntity() const +{ + core::Ptr res = customPrimarySlideDirectionEntity_raw(); + return res; +} + +inline bool PlanarJointMotion::customPrimarySlideDirectionEntity(const core::Ptr& value) +{ + return customPrimarySlideDirectionEntity_raw(value.get()); +} + +inline core::Ptr PlanarJointMotion::secondarySlideDirectionVector() const +{ + core::Ptr res = secondarySlideDirectionVector_raw(); + return res; +} + +inline double PlanarJointMotion::rotationValue() const +{ + double res = rotationValue_raw(); + return res; +} + +inline bool PlanarJointMotion::rotationValue(double value) +{ + return rotationValue_raw(value); +} + +inline core::Ptr PlanarJointMotion::rotationLimits() const +{ + core::Ptr res = rotationLimits_raw(); + return res; +} + +inline double PlanarJointMotion::primarySlideValue() const +{ + double res = primarySlideValue_raw(); + return res; +} + +inline bool PlanarJointMotion::primarySlideValue(double value) +{ + return primarySlideValue_raw(value); +} + +inline core::Ptr PlanarJointMotion::primarySlideLimits() const +{ + core::Ptr res = primarySlideLimits_raw(); + return res; +} + +inline double PlanarJointMotion::secondarySlideValue() const +{ + double res = secondarySlideValue_raw(); + return res; +} + +inline bool PlanarJointMotion::secondarySlideValue(double value) +{ + return secondarySlideValue_raw(value); +} + +inline core::Ptr PlanarJointMotion::secondarySlideLimits() const +{ + core::Ptr res = secondarySlideLimits_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PLANARJOINTMOTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/RevoluteJointMotion.h b/usr/autodesk/CPP/include/Fusion/Components/RevoluteJointMotion.h new file mode 100644 index 0000000..7ce44ef --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/RevoluteJointMotion.h @@ -0,0 +1,141 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "JointMotion.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REVOLUTEJOINTMOTION_CPP__ +# define ADSK_FUSION_REVOLUTEJOINTMOTION_API XI_EXPORT +# else +# define ADSK_FUSION_REVOLUTEJOINTMOTION_API +# endif +#else +# define ADSK_FUSION_REVOLUTEJOINTMOTION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointLimits; +}} +namespace adsk { namespace core { + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Represents the set of information specific to a revolute joint. +class RevoluteJointMotion : public JointMotion { +public: + + /// Gets and sets the direction of the axis of rotation. This can be set to + /// XAxisJointDirection, YAxisJointDirection, or ZAxisJointDirection. It can + /// return those three directions and CustomJointDirection. If this returns + /// CustomJointDirection then the customRotationAxisEntity will return an entity + /// that defines the axis. If there is a custom rotation axis defined and this + /// property is set to one of the three standard axes, the custom rotation will + /// be removed and customRotationAxisEntity will return null. + JointDirections rotationAxis() const; + bool rotationAxis(JointDirections value); + + /// Returns the direction of the rotation axis. This property will return null in the case + /// where the RevolutionJointMotion object was obtained from a JointInput object. + core::Ptr rotationAxisVector() const; + + /// This property can be set using various types of entities that can infer an + /// axis. For example, a linear edge, sketch line, planar face, and cylindrical face. + /// This property is only valid in the case where the rotationAxis property returns + /// CustomJointDirection. Setting this property will automatically set + /// the rotationAxis property to CustomJointDirection. + core::Ptr customRotationAxisEntity() const; + bool customRotationAxisEntity(const core::Ptr& value); + + /// Gets and sets the rotation value. This is in radians. Setting this value is + /// the equivalent of using the Drive Joints command. + double rotationValue() const; + bool rotationValue(double value); + + /// Returns a JointLimits object that defines the rotation limits for this joint. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr rotationLimits() const; + + ADSK_FUSION_REVOLUTEJOINTMOTION_API static const char* classType(); + ADSK_FUSION_REVOLUTEJOINTMOTION_API const char* objectType() const override; + ADSK_FUSION_REVOLUTEJOINTMOTION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REVOLUTEJOINTMOTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual JointDirections rotationAxis_raw() const = 0; + virtual bool rotationAxis_raw(JointDirections value) = 0; + virtual core::Vector3D* rotationAxisVector_raw() const = 0; + virtual core::Base* customRotationAxisEntity_raw() const = 0; + virtual bool customRotationAxisEntity_raw(core::Base* value) = 0; + virtual double rotationValue_raw() const = 0; + virtual bool rotationValue_raw(double value) = 0; + virtual JointLimits* rotationLimits_raw() const = 0; +}; + +// Inline wrappers + +inline JointDirections RevoluteJointMotion::rotationAxis() const +{ + JointDirections res = rotationAxis_raw(); + return res; +} + +inline bool RevoluteJointMotion::rotationAxis(JointDirections value) +{ + return rotationAxis_raw(value); +} + +inline core::Ptr RevoluteJointMotion::rotationAxisVector() const +{ + core::Ptr res = rotationAxisVector_raw(); + return res; +} + +inline core::Ptr RevoluteJointMotion::customRotationAxisEntity() const +{ + core::Ptr res = customRotationAxisEntity_raw(); + return res; +} + +inline bool RevoluteJointMotion::customRotationAxisEntity(const core::Ptr& value) +{ + return customRotationAxisEntity_raw(value.get()); +} + +inline double RevoluteJointMotion::rotationValue() const +{ + double res = rotationValue_raw(); + return res; +} + +inline bool RevoluteJointMotion::rotationValue(double value) +{ + return rotationValue_raw(value); +} + +inline core::Ptr RevoluteJointMotion::rotationLimits() const +{ + core::Ptr res = rotationLimits_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REVOLUTEJOINTMOTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/RigidGroup.h b/usr/autodesk/CPP/include/Fusion/Components/RigidGroup.h new file mode 100644 index 0000000..a71f8f2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/RigidGroup.h @@ -0,0 +1,232 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RIGIDGROUP_CPP__ +# define ADSK_FUSION_RIGIDGROUP_API XI_EXPORT +# else +# define ADSK_FUSION_RIGIDGROUP_API +# endif +#else +# define ADSK_FUSION_RIGIDGROUP_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class Occurrence; + class OccurrenceList; + class TimelineObject; +}} +namespace adsk { namespace core { + class Attributes; + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Represents a rigid group within an assembly. +class RigidGroup : public core::Base { +public: + + /// Returns the parent component that owns this rigid group. + core::Ptr parentComponent() const; + + /// Gets and sets the name of the rigid group as seen in the timeline. + std::string name() const; + bool name(const std::string& value); + + /// Deletes this rigid group. + /// Returns True if the delete was successful. + bool deleteMe(); + + /// Returns the list of occurrences that are part of the rigid group. + core::Ptr occurrences() const; + + /// Sets which occurrences are to be part of this rigid group. + /// To use this method, you need to position the timeline marker to immediately before this group. + /// This can be accomplished using the following code: group.timelineObject.rollTo(True) + /// occurrences : An ObjectCollection containing the occurrences to use in creating the rigid group. + /// includeChildren : Boolean indicating if the children of the input occurrences should be included in the rigid group. + /// Returns true if successful. + bool setOccurrences(const core::Ptr& occurrences, bool includeChildren); + + /// Returns the timeline object associated with this rigid group. + core::Ptr timelineObject() const; + + /// Gets and sets if this rigid group is suppressed. + bool isSuppressed() const; + bool isSuppressed(bool value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// Returns the collection of attributes associated with this rigid group. + core::Ptr attributes() const; + + /// Returns a token for the RigidGroup object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same rigid group. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_RIGIDGROUP_API static const char* classType(); + ADSK_FUSION_RIGIDGROUP_API const char* objectType() const override; + ADSK_FUSION_RIGIDGROUP_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RIGIDGROUP_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Component* parentComponent_raw() const = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual bool deleteMe_raw() = 0; + virtual OccurrenceList* occurrences_raw() const = 0; + virtual bool setOccurrences_raw(core::ObjectCollection* occurrences, bool includeChildren) = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual bool isSuppressed_raw() const = 0; + virtual bool isSuppressed_raw(bool value) = 0; + virtual RigidGroup* nativeObject_raw() const = 0; + virtual RigidGroup* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr RigidGroup::parentComponent() const +{ + core::Ptr res = parentComponent_raw(); + return res; +} + +inline std::string RigidGroup::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool RigidGroup::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline bool RigidGroup::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline core::Ptr RigidGroup::occurrences() const +{ + core::Ptr res = occurrences_raw(); + return res; +} + +inline bool RigidGroup::setOccurrences(const core::Ptr& occurrences, bool includeChildren) +{ + bool res = setOccurrences_raw(occurrences.get(), includeChildren); + return res; +} + +inline core::Ptr RigidGroup::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline bool RigidGroup::isSuppressed() const +{ + bool res = isSuppressed_raw(); + return res; +} + +inline bool RigidGroup::isSuppressed(bool value) +{ + return isSuppressed_raw(value); +} + +inline core::Ptr RigidGroup::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr RigidGroup::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr RigidGroup::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr RigidGroup::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline std::string RigidGroup::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RIGIDGROUP_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/RigidGroupList.h b/usr/autodesk/CPP/include/Fusion/Components/RigidGroupList.h new file mode 100644 index 0000000..70aa83b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/RigidGroupList.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RIGIDGROUPLIST_CPP__ +# define ADSK_FUSION_RIGIDGROUPLIST_API XI_EXPORT +# else +# define ADSK_FUSION_RIGIDGROUPLIST_API +# endif +#else +# define ADSK_FUSION_RIGIDGROUPLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class RigidGroup; +}} + +namespace adsk { namespace fusion { + +/// A list of rigid groups. +class RigidGroupList : public core::Base { +public: + + /// Function that returns the specified rigid group using an index into the list. + /// index : The index of the item within the list to return. The first item in the list has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified rigid group using a name. + /// name : The name of the item within the list to return. + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns number of rigid groups in the list. + size_t count() const; + + typedef RigidGroup iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_RIGIDGROUPLIST_API static const char* classType(); + ADSK_FUSION_RIGIDGROUPLIST_API const char* objectType() const override; + ADSK_FUSION_RIGIDGROUPLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RIGIDGROUPLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual RigidGroup* item_raw(size_t index) const = 0; + virtual RigidGroup* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr RigidGroupList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr RigidGroupList::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t RigidGroupList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void RigidGroupList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RIGIDGROUPLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/RigidGroups.h b/usr/autodesk/CPP/include/Fusion/Components/RigidGroups.h new file mode 100644 index 0000000..d8b13b0 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/RigidGroups.h @@ -0,0 +1,117 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RIGIDGROUPS_CPP__ +# define ADSK_FUSION_RIGIDGROUPS_API XI_EXPORT +# else +# define ADSK_FUSION_RIGIDGROUPS_API +# endif +#else +# define ADSK_FUSION_RIGIDGROUPS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class RigidGroup; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// The collection of rigid groups in this component. This provides access to all existing +/// rigid groups and supports the ability to create new rigid groups. +class RigidGroups : public core::Base { +public: + + /// Function that returns the specified rigid group using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified rigid group using a name. + /// name : The name of the item within the collection to return. + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns number of joint origins in the collection. + size_t count() const; + + /// Creates a new rigid group. + /// occurrences : An ObjectCollection containing the occurrences to use in creating the rigid group. + /// includeChildren : Boolean indicating if the children of the input occurrences should be included in the rigid group. + /// Returns the new RigidGroup object or null in the case of failure. + core::Ptr add(const core::Ptr& occurrences, bool includeChildren); + + typedef RigidGroup iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_RIGIDGROUPS_API static const char* classType(); + ADSK_FUSION_RIGIDGROUPS_API const char* objectType() const override; + ADSK_FUSION_RIGIDGROUPS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RIGIDGROUPS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual RigidGroup* item_raw(size_t index) const = 0; + virtual RigidGroup* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual RigidGroup* add_raw(core::ObjectCollection* occurrences, bool includeChildren) = 0; +}; + +// Inline wrappers + +inline core::Ptr RigidGroups::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr RigidGroups::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t RigidGroups::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr RigidGroups::add(const core::Ptr& occurrences, bool includeChildren) +{ + core::Ptr res = add_raw(occurrences.get(), includeChildren); + return res; +} + +template inline void RigidGroups::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RIGIDGROUPS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/RigidJointMotion.h b/usr/autodesk/CPP/include/Fusion/Components/RigidJointMotion.h new file mode 100644 index 0000000..5413a90 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/RigidJointMotion.h @@ -0,0 +1,50 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "JointMotion.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RIGIDJOINTMOTION_CPP__ +# define ADSK_FUSION_RIGIDJOINTMOTION_API XI_EXPORT +# else +# define ADSK_FUSION_RIGIDJOINTMOTION_API +# endif +#else +# define ADSK_FUSION_RIGIDJOINTMOTION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Represents the set of information specific to a rigid joint. A +/// rigid joint doesn't support any additional information beyond +/// getting the joint type which it derives from JointMotion. +class RigidJointMotion : public JointMotion { +public: + + ADSK_FUSION_RIGIDJOINTMOTION_API static const char* classType(); + ADSK_FUSION_RIGIDJOINTMOTION_API const char* objectType() const override; + ADSK_FUSION_RIGIDJOINTMOTION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RIGIDJOINTMOTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RIGIDJOINTMOTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Components/SliderJointMotion.h b/usr/autodesk/CPP/include/Fusion/Components/SliderJointMotion.h new file mode 100644 index 0000000..f5e6800 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Components/SliderJointMotion.h @@ -0,0 +1,143 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "JointMotion.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SLIDERJOINTMOTION_CPP__ +# define ADSK_FUSION_SLIDERJOINTMOTION_API XI_EXPORT +# else +# define ADSK_FUSION_SLIDERJOINTMOTION_API +# endif +#else +# define ADSK_FUSION_SLIDERJOINTMOTION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class JointLimits; +}} +namespace adsk { namespace core { + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Represents the set of information specific to a slider joint. +class SliderJointMotion : public JointMotion { +public: + + /// Gets and sets the direction of the slide. This can be set to + /// XAxisJointDirection, YAxisJointDirection, or ZAxisJointDirection. It can + /// return those three directions and CustomJointDirection. If this returns + /// CustomJointDirection then the customSlideDirectionEntity will return an entity + /// that defines the direction. If there is a custom direction defined and this + /// property is set to one of the three standard axes, the custom direction will + /// be removed and customSlideDirectionEntity will return null. + JointDirections slideDirection() const; + bool slideDirection(JointDirections value); + + /// Returns the direction of the slide. This property will return null in the case + /// where the SliderJointMotion object was obtained from a JointInput object. + core::Ptr slideDirectionVector() const; + + /// This property can be set using various types of entities that can infer a + /// direction. For example, a linear edge, sketch line, planar face, and cylindrical face. + /// This property is only valid in the case where the slideDirection property returns + /// CustomJointDirection. Setting this property will automatically set + /// the slideDirection property to CustomJointDirection. + /// To set this property, you need to position the timeline marker to immediately before this joint. + /// This can be accomplished using the following code: thisJoint.timelineObject.rollTo(True) + core::Ptr customSlideDirectionEntity() const; + bool customSlideDirectionEntity(const core::Ptr& value); + + /// Gets and sets the slide value. This is in centimeters. Setting this value is + /// the equivalent of using the Drive Joints command. + double slideValue() const; + bool slideValue(double value); + + /// Returns a JointLimits object that defines the slide limits for this joint. + /// Use the functionality of the returned JointLimits object to get, set, and modify + /// the joint limits. + core::Ptr slideLimits() const; + + ADSK_FUSION_SLIDERJOINTMOTION_API static const char* classType(); + ADSK_FUSION_SLIDERJOINTMOTION_API const char* objectType() const override; + ADSK_FUSION_SLIDERJOINTMOTION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SLIDERJOINTMOTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual JointDirections slideDirection_raw() const = 0; + virtual bool slideDirection_raw(JointDirections value) = 0; + virtual core::Vector3D* slideDirectionVector_raw() const = 0; + virtual core::Base* customSlideDirectionEntity_raw() const = 0; + virtual bool customSlideDirectionEntity_raw(core::Base* value) = 0; + virtual double slideValue_raw() const = 0; + virtual bool slideValue_raw(double value) = 0; + virtual JointLimits* slideLimits_raw() const = 0; +}; + +// Inline wrappers + +inline JointDirections SliderJointMotion::slideDirection() const +{ + JointDirections res = slideDirection_raw(); + return res; +} + +inline bool SliderJointMotion::slideDirection(JointDirections value) +{ + return slideDirection_raw(value); +} + +inline core::Ptr SliderJointMotion::slideDirectionVector() const +{ + core::Ptr res = slideDirectionVector_raw(); + return res; +} + +inline core::Ptr SliderJointMotion::customSlideDirectionEntity() const +{ + core::Ptr res = customSlideDirectionEntity_raw(); + return res; +} + +inline bool SliderJointMotion::customSlideDirectionEntity(const core::Ptr& value) +{ + return customSlideDirectionEntity_raw(value.get()); +} + +inline double SliderJointMotion::slideValue() const +{ + double res = slideValue_raw(); + return res; +} + +inline bool SliderJointMotion::slideValue(double value) +{ + return slideValue_raw(value); +} + +inline core::Ptr SliderJointMotion::slideLimits() const +{ + core::Ptr res = slideLimits_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SLIDERJOINTMOTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxes.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxes.h new file mode 100644 index 0000000..f2fd6b3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxes.h @@ -0,0 +1,143 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXES_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXES_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXES_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class ConstructionAxis; + class ConstructionAxisInput; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the construction axes within a component and provides +/// methods to create new construction axes. +class ConstructionAxes : public core::Base { +public: + + /// Function that returns the specified construction axis using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the specified construction axis using the name of the construction + /// axis as it is displayed in the browser. + /// name : The name of the axis as it is displayed in the browser + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// The number of construction axes in the collection. + size_t count() const; + + /// Create a ConstructionAxisInput object that is in turn used to create a ConstructionAxis. + /// occurrenceForCreation : A creation occurrence is needed if the input is in another component AND the + /// construction axis is not in the root component. The occurrenceForCreation is analogous + /// to the active occurrence in the UI. + /// Returns a ConstructionAxisInput object + core::Ptr createInput(const core::Ptr& occurrenceForCreation = NULL) const; + + /// Creates and adds a new ConstructionAxis using the creation parameters in the ConstructionAxisInput. + /// If the ConstructionAxisInput was defined using the setByLine method then + /// the add will only work in a direct edit model (do not capture design history) and will fail in a parametric model. + /// input : A ConstructionAxisInput object + /// Returns the newly created construction axis or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// The component that owns this collection. + core::Ptr component() const; + + typedef ConstructionAxis iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_CONSTRUCTIONAXES_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXES_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ConstructionAxis* item_raw(size_t index) const = 0; + virtual ConstructionAxis* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual ConstructionAxisInput* createInput_raw(Occurrence* occurrenceForCreation) const = 0; + virtual ConstructionAxis* add_raw(ConstructionAxisInput* input) = 0; + virtual Component* component_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionAxes::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr ConstructionAxes::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t ConstructionAxes::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ConstructionAxes::createInput(const core::Ptr& occurrenceForCreation) const +{ + core::Ptr res = createInput_raw(occurrenceForCreation.get()); + return res; +} + +inline core::Ptr ConstructionAxes::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ConstructionAxes::component() const +{ + core::Ptr res = component_raw(); + return res; +} + +template inline void ConstructionAxes::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxis.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxis.h new file mode 100644 index 0000000..c87fa67 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxis.h @@ -0,0 +1,317 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXIS_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXIS_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXIS_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXIS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class Component; + class ConstructionAxisDefinition; + class Occurrence; + class TimelineObject; +}} +namespace adsk { namespace core { + class Attributes; + class InfiniteLine3D; +}} + +namespace adsk { namespace fusion { + +/// ConstructionAxis Object +class ConstructionAxis : public core::Base { +public: + + /// Returns an infinite line that represents the position and orientation of the + /// construction axis. This geometry is defined in the AssemblyContext of this + /// ConstructionAxis. + core::Ptr geometry() const; + + /// The name of the construction axis as it is shown in the browser. + std::string name() const; + bool name(const std::string& value); + + /// Returns the construction axis definition object which provides access to the information + /// defining the construction axis. + core::Ptr definition() const; + + /// Deletes the construction axis. + /// Returns a bool indicating if the delete was successful or not. + bool deleteMe(); + + /// Indicates if this construction axis is parametric or not. + bool isParametric() const; + + /// Indicates if this construction axis can be deleted. Base + /// construction axes can not be deleted. + bool isDeletable() const; + + /// Indicates if the light bulb (as displayed in the browser) is on. + /// A construction axis will only be visible if it's light bulb, and that of it's + /// containing folder and parent component/s are also on. + bool isLightBulbOn() const; + bool isLightBulbOn(bool value); + + /// Gets if the construction plane is visible. + /// This property is affected by the AssemblyContext of the construction axis. + bool isVisible() const; + + /// Returns the parent component or base feature. If both the design and the construction + /// axis are parametric, the parent will be a component. If the design is parametric and + /// the construction axis is not, the parent will be a base feature. If + /// the design is not parametric the parent will be a component. + core::Ptr parent() const; + + /// Returns the component this construction plane belongs to. + core::Ptr component() const; + + /// Returns the timeline object associated with this construction axis. + core::Ptr timelineObject() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// If this construction axis is associated with a base feature, this property will return that base feature. + /// If it's not associated with a base feature, this property will return null. + core::Ptr baseFeature() const; + + /// Returns the collection of attributes associated with this construction axis. + core::Ptr attributes() const; + + /// Returns the current health state of this construction axis. + FeatureHealthStates healthState() const; + + /// Returns the error or warning message in the case where the healthState property returns either + /// WarningFeatureHealthState or ErrorFeatureHealthState. Otherwise this property returns an empty string. + std::string errorOrWarningMessage() const; + + /// Returns a token for the ConstructionAxis object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same construction axis. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_CONSTRUCTIONAXIS_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXIS_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXIS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXIS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::InfiniteLine3D* geometry_raw() const = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual ConstructionAxisDefinition* definition_raw() const = 0; + virtual bool deleteMe_raw() = 0; + virtual bool isParametric_raw() const = 0; + virtual bool isDeletable_raw() const = 0; + virtual bool isLightBulbOn_raw() const = 0; + virtual bool isLightBulbOn_raw(bool value) = 0; + virtual bool isVisible_raw() const = 0; + virtual core::Base* parent_raw() const = 0; + virtual Component* component_raw() const = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual ConstructionAxis* nativeObject_raw() const = 0; + virtual ConstructionAxis* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual BaseFeature* baseFeature_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual FeatureHealthStates healthState_raw() const = 0; + virtual char* errorOrWarningMessage_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionAxis::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline std::string ConstructionAxis::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool ConstructionAxis::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline core::Ptr ConstructionAxis::definition() const +{ + core::Ptr res = definition_raw(); + return res; +} + +inline bool ConstructionAxis::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline bool ConstructionAxis::isParametric() const +{ + bool res = isParametric_raw(); + return res; +} + +inline bool ConstructionAxis::isDeletable() const +{ + bool res = isDeletable_raw(); + return res; +} + +inline bool ConstructionAxis::isLightBulbOn() const +{ + bool res = isLightBulbOn_raw(); + return res; +} + +inline bool ConstructionAxis::isLightBulbOn(bool value) +{ + return isLightBulbOn_raw(value); +} + +inline bool ConstructionAxis::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline core::Ptr ConstructionAxis::parent() const +{ + core::Ptr res = parent_raw(); + return res; +} + +inline core::Ptr ConstructionAxis::component() const +{ + core::Ptr res = component_raw(); + return res; +} + +inline core::Ptr ConstructionAxis::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline core::Ptr ConstructionAxis::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr ConstructionAxis::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ConstructionAxis::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr ConstructionAxis::baseFeature() const +{ + core::Ptr res = baseFeature_raw(); + return res; +} + +inline core::Ptr ConstructionAxis::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline FeatureHealthStates ConstructionAxis::healthState() const +{ + FeatureHealthStates res = healthState_raw(); + return res; +} + +inline std::string ConstructionAxis::errorOrWarningMessage() const +{ + std::string res; + + char* p= errorOrWarningMessage_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string ConstructionAxis::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXIS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisByLineDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisByLineDefinition.h new file mode 100644 index 0000000..db912d1 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisByLineDefinition.h @@ -0,0 +1,71 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionAxisDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXISBYLINEDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXISBYLINEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXISBYLINEDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXISBYLINEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class InfiniteLine3D; +}} + +namespace adsk { namespace fusion { + +/// The definition for a non-parametric construction axis. In a non-parametric design +/// all construction planes will return this type of definition regardless of how they +/// were initially created. +class ConstructionAxisByLineDefinition : public ConstructionAxisDefinition { +public: + + /// Gets and sets the infinite line that defines the position and direction of the axis + core::Ptr axis() const; + bool axis(const core::Ptr& value); + + ADSK_FUSION_CONSTRUCTIONAXISBYLINEDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXISBYLINEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXISBYLINEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXISBYLINEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::InfiniteLine3D* axis_raw() const = 0; + virtual bool axis_raw(core::InfiniteLine3D* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionAxisByLineDefinition::axis() const +{ + core::Ptr res = axis_raw(); + return res; +} + +inline bool ConstructionAxisByLineDefinition::axis(const core::Ptr& value) +{ + return axis_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXISBYLINEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisCircularFaceDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisCircularFaceDefinition.h new file mode 100644 index 0000000..d1f90ad --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisCircularFaceDefinition.h @@ -0,0 +1,70 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionAxisDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXISCIRCULARFACEDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXISCIRCULARFACEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXISCIRCULARFACEDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXISCIRCULARFACEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; +}} + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction axis created using the SetbyCircularFace method +class ConstructionAxisCircularFaceDefinition : public ConstructionAxisDefinition { +public: + + /// Gets and sets the cylinder, cone, or torus this work axis + /// is parametrically dependent on. + core::Ptr circularFace() const; + bool circularFace(const core::Ptr& value); + + ADSK_FUSION_CONSTRUCTIONAXISCIRCULARFACEDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXISCIRCULARFACEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXISCIRCULARFACEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXISCIRCULARFACEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace* circularFace_raw() const = 0; + virtual bool circularFace_raw(BRepFace* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionAxisCircularFaceDefinition::circularFace() const +{ + core::Ptr res = circularFace_raw(); + return res; +} + +inline bool ConstructionAxisCircularFaceDefinition::circularFace(const core::Ptr& value) +{ + return circularFace_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXISCIRCULARFACEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisDefinition.h new file mode 100644 index 0000000..17b5b92 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisDefinition.h @@ -0,0 +1,95 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXISDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXISDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXISDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXISDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ConstructionAxis; +}} + +namespace adsk { namespace fusion { + +/// A Base class to return the information (possibly parametric) used to +/// define a ConstructionAxis. +class ConstructionAxisDefinition : public core::Base { +public: + + /// Returns the ConstructionAxis object + core::Ptr parentConstructionAxis() const; + + ADSK_FUSION_CONSTRUCTIONAXISDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXISDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXISDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXISDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ConstructionAxis* parentConstructionAxis_raw() const = 0; + virtual void placeholderConstructionAxisDefinition0() {} + virtual void placeholderConstructionAxisDefinition1() {} + virtual void placeholderConstructionAxisDefinition2() {} + virtual void placeholderConstructionAxisDefinition3() {} + virtual void placeholderConstructionAxisDefinition4() {} + virtual void placeholderConstructionAxisDefinition5() {} + virtual void placeholderConstructionAxisDefinition6() {} + virtual void placeholderConstructionAxisDefinition7() {} + virtual void placeholderConstructionAxisDefinition8() {} + virtual void placeholderConstructionAxisDefinition9() {} + virtual void placeholderConstructionAxisDefinition10() {} + virtual void placeholderConstructionAxisDefinition11() {} + virtual void placeholderConstructionAxisDefinition12() {} + virtual void placeholderConstructionAxisDefinition13() {} + virtual void placeholderConstructionAxisDefinition14() {} + virtual void placeholderConstructionAxisDefinition15() {} + virtual void placeholderConstructionAxisDefinition16() {} + virtual void placeholderConstructionAxisDefinition17() {} + virtual void placeholderConstructionAxisDefinition18() {} + virtual void placeholderConstructionAxisDefinition19() {} + virtual void placeholderConstructionAxisDefinition20() {} + virtual void placeholderConstructionAxisDefinition21() {} + virtual void placeholderConstructionAxisDefinition22() {} + virtual void placeholderConstructionAxisDefinition23() {} + virtual void placeholderConstructionAxisDefinition24() {} + virtual void placeholderConstructionAxisDefinition25() {} + virtual void placeholderConstructionAxisDefinition26() {} + virtual void placeholderConstructionAxisDefinition27() {} + virtual void placeholderConstructionAxisDefinition28() {} + virtual void placeholderConstructionAxisDefinition29() {} + virtual void placeholderConstructionAxisDefinition30() {} +}; + +// Inline wrappers + +inline core::Ptr ConstructionAxisDefinition::parentConstructionAxis() const +{ + core::Ptr res = parentConstructionAxis_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXISDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisEdgeDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisEdgeDefinition.h new file mode 100644 index 0000000..838a152 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisEdgeDefinition.h @@ -0,0 +1,66 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionAxisDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXISEDGEDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXISEDGEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXISEDGEDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXISEDGEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction axis created using the SetbyEdge method +class ConstructionAxisEdgeDefinition : public ConstructionAxisDefinition { +public: + + /// Gets and sets the linear edge, construction line, or sketch line that defines + /// the construction axis. + core::Ptr edgeEntity() const; + bool edgeEntity(const core::Ptr& value); + + ADSK_FUSION_CONSTRUCTIONAXISEDGEDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXISEDGEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXISEDGEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXISEDGEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* edgeEntity_raw() const = 0; + virtual bool edgeEntity_raw(core::Base* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionAxisEdgeDefinition::edgeEntity() const +{ + core::Ptr res = edgeEntity_raw(); + return res; +} + +inline bool ConstructionAxisEdgeDefinition::edgeEntity(const core::Ptr& value) +{ + return edgeEntity_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXISEDGEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisInput.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisInput.h new file mode 100644 index 0000000..4157103 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisInput.h @@ -0,0 +1,215 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXISINPUT_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXISINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXISINPUT_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXISINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; + class Occurrence; +}} +namespace adsk { namespace core { + class InfiniteLine3D; +}} + +namespace adsk { namespace fusion { + +/// A ConstructionAxisInput is a throwaway object used to create a ConstructionAxis +/// The usage pattern is: +/// a. create a ConstructionAxisInput (ConstructionAxes.CreateInput) +/// b. call one of the member functions to specify how the ConstructionAxis is created +/// c. create the ConstructionAxis (call ConstructionAxes.Add) +/// d. stop referencing the ConstructionAxisInput (so it gets deleted). +class ConstructionAxisInput : public core::Base { +public: + + /// This input method is for creating a non-parametric construction axis whose position + /// in space is defined by an InfiniteLine3D object. + /// This method of defining a construction axis is only valid when working in a direct edit model (do not capture design history). + /// This is not valid when working in a parametric model and will fail. + /// line : An InFiniteLine3D object + /// Returns true if the creation of the ConstructionAxisInput is successful. + bool setByLine(const core::Ptr& line); + + /// This input method is for creating an axis coincident with the axis of a + /// cylindrical, conical or torus face. + /// This can result in a parametric or non-parametric construction axis depending + /// on whether the parent component is parametric or is a direct edit component. + /// circularFace : The face from a cylinder, cone, or torus. + /// Returns true if the creation of the ConstructionAxisInput is successful. + bool setByCircularFace(const core::Ptr& circularFace); + + /// This input method is for creating an axis that is normal to a face + /// at a specified point. + /// face : A face (BRepFace object) to create the axis normal to. + /// pointEntity : A construction point, sketch point or vertex the axis is to pass through. + /// Returns true if the creation of the ConstructionAxisInput is successful. + bool setByPerpendicularAtPoint(const core::Ptr& face, const core::Ptr& pointEntity); + + /// This input method is for creating a construction axis coincident with the + /// intersection of two planes or planar faces. + /// This will fail if the two planes are parallel. + /// This can result in a parametric or non-parametric construction axis depending + /// on whether the parent component is parametric or is a direct edit component. + /// planarEntityOne : The first planar face or construction plane to intersect + /// planarEntityTwo : The second planar face or construction plane to intersect + /// Returns true if the creation of the ConstructionAxisInput is successful. + bool setByTwoPlanes(const core::Ptr& planarEntityOne, const core::Ptr& planarEntityTwo); + + /// This input method is for creating a construction axis that passes through the two points + /// (work points, sketch points or vertices). + /// This will fail if the two points are coincident. + /// This can result in a parametric or non-parametric construction axis depending + /// on whether the parent component is parametric or is a direct edit component. + /// pointEntityOne : The first construction point, sketch point or vertex the axis passes through + /// pointEntityTwo : The second construction point, sketch point or vertex the axis passes through + /// Returns true if the creation of the ConstructionAxisInput is successful. + bool setByTwoPoints(const core::Ptr& pointEntityOne, const core::Ptr& pointEntityTwo); + + /// This input method is for creating a construction axis from a specified linear/circular edge + /// or sketch curve. + /// This can result in a parametric or non-parametric construction axis depending + /// on whether the parent component is parametric or is a direct edit component. + /// edgeEntity : A linear/circular edge, construction line, or sketch line + /// Returns true if the creation of the ConstructionAxisInput is successful. + bool setByEdge(const core::Ptr& edgeEntity); + + /// This input method if for creating a construction axis normal to a specified face + /// or sketch profile and that passes through a specified point. + /// This can result in a parametric or non-parametric construction axis depending + /// on whether the parent component is parametric or is a direct edit component. + /// face : The face (BRepFace object) to create the axis normal to. + /// pointEntity : A construction point, sketch point or vertex the axis passes through. + /// This point does not have to lie on the face. + /// Returns true if the creation of the ConstructionAxisInput is successful. + bool setByNormalToFaceAtPoint(const core::Ptr& face, const core::Ptr& pointEntity); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs + /// to be specified when the ConstructionAxis is created based on geometry + /// (e.g. a straight edge) in another component AND (the ConstructionAxis) is not in the + /// root component. The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// When creating a construction axis that is owned by a base or form feature, set this property to the + /// base or form feature you want to associate the new construction plane with. By default, this is null, + /// meaning it will not be associated with a base or form feature. + /// Because of a current limitation, if you want to create a construction axis associated with a base + /// or form feature, you must set this property AND call the edit method of the base or form feature, + /// create the feature, and then call the finishEdit method of the base or form feature. The base or form + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseOrFormFeature() const; + bool targetBaseOrFormFeature(const core::Ptr& value); + + ADSK_FUSION_CONSTRUCTIONAXISINPUT_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXISINPUT_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXISINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXISINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setByLine_raw(core::InfiniteLine3D* line) = 0; + virtual bool setByCircularFace_raw(BRepFace* circularFace) = 0; + virtual bool setByPerpendicularAtPoint_raw(BRepFace* face, core::Base* pointEntity) = 0; + virtual bool setByTwoPlanes_raw(core::Base* planarEntityOne, core::Base* planarEntityTwo) = 0; + virtual bool setByTwoPoints_raw(core::Base* pointEntityOne, core::Base* pointEntityTwo) = 0; + virtual bool setByEdge_raw(core::Base* edgeEntity) = 0; + virtual bool setByNormalToFaceAtPoint_raw(BRepFace* face, core::Base* pointEntity) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual core::Base* targetBaseOrFormFeature_raw() const = 0; + virtual bool targetBaseOrFormFeature_raw(core::Base* value) = 0; +}; + +// Inline wrappers + +inline bool ConstructionAxisInput::setByLine(const core::Ptr& line) +{ + bool res = setByLine_raw(line.get()); + return res; +} + +inline bool ConstructionAxisInput::setByCircularFace(const core::Ptr& circularFace) +{ + bool res = setByCircularFace_raw(circularFace.get()); + return res; +} + +inline bool ConstructionAxisInput::setByPerpendicularAtPoint(const core::Ptr& face, const core::Ptr& pointEntity) +{ + bool res = setByPerpendicularAtPoint_raw(face.get(), pointEntity.get()); + return res; +} + +inline bool ConstructionAxisInput::setByTwoPlanes(const core::Ptr& planarEntityOne, const core::Ptr& planarEntityTwo) +{ + bool res = setByTwoPlanes_raw(planarEntityOne.get(), planarEntityTwo.get()); + return res; +} + +inline bool ConstructionAxisInput::setByTwoPoints(const core::Ptr& pointEntityOne, const core::Ptr& pointEntityTwo) +{ + bool res = setByTwoPoints_raw(pointEntityOne.get(), pointEntityTwo.get()); + return res; +} + +inline bool ConstructionAxisInput::setByEdge(const core::Ptr& edgeEntity) +{ + bool res = setByEdge_raw(edgeEntity.get()); + return res; +} + +inline bool ConstructionAxisInput::setByNormalToFaceAtPoint(const core::Ptr& face, const core::Ptr& pointEntity) +{ + bool res = setByNormalToFaceAtPoint_raw(face.get(), pointEntity.get()); + return res; +} + +inline core::Ptr ConstructionAxisInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool ConstructionAxisInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline core::Ptr ConstructionAxisInput::targetBaseOrFormFeature() const +{ + core::Ptr res = targetBaseOrFormFeature_raw(); + return res; +} + +inline bool ConstructionAxisInput::targetBaseOrFormFeature(const core::Ptr& value) +{ + return targetBaseOrFormFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXISINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisNormalToFaceAtPointDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisNormalToFaceAtPointDefinition.h new file mode 100644 index 0000000..9842b79 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisNormalToFaceAtPointDefinition.h @@ -0,0 +1,82 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionAxisDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXISNORMALTOFACEATPOINTDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXISNORMALTOFACEATPOINTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXISNORMALTOFACEATPOINTDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXISNORMALTOFACEATPOINTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction axis created using the +/// SetByNormalToFaceAtPoint method +class ConstructionAxisNormalToFaceAtPointDefinition : public ConstructionAxisDefinition { +public: + + /// Gets the face the axis is normal to + core::Ptr face() const; + + /// Gets the point that positions the axis + core::Ptr pointEntity() const; + + /// Redefines the input geometry of the construction axis. + /// face : The face the axis is normal to + /// pointEntity : The point that positions the axis + /// Returns true if the redefinition of the construction axis is successful. + bool redefine(const core::Ptr& face, const core::Ptr& pointEntity); + + ADSK_FUSION_CONSTRUCTIONAXISNORMALTOFACEATPOINTDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXISNORMALTOFACEATPOINTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXISNORMALTOFACEATPOINTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXISNORMALTOFACEATPOINTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* face_raw() const = 0; + virtual core::Base* pointEntity_raw() const = 0; + virtual bool redefine_raw(core::Base* face, core::Base* pointEntity) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionAxisNormalToFaceAtPointDefinition::face() const +{ + core::Ptr res = face_raw(); + return res; +} + +inline core::Ptr ConstructionAxisNormalToFaceAtPointDefinition::pointEntity() const +{ + core::Ptr res = pointEntity_raw(); + return res; +} + +inline bool ConstructionAxisNormalToFaceAtPointDefinition::redefine(const core::Ptr& face, const core::Ptr& pointEntity) +{ + bool res = redefine_raw(face.get(), pointEntity.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXISNORMALTOFACEATPOINTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisPerpendicularAtPointDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisPerpendicularAtPointDefinition.h new file mode 100644 index 0000000..8213955 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisPerpendicularAtPointDefinition.h @@ -0,0 +1,86 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionAxisDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXISPERPENDICULARATPOINTDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXISPERPENDICULARATPOINTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXISPERPENDICULARATPOINTDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXISPERPENDICULARATPOINTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; +}} + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction axis created using the +/// SetByPerpendicularAtPoint method +class ConstructionAxisPerpendicularAtPointDefinition : public ConstructionAxisDefinition { +public: + + /// Returns the face the construction axis is perpendicular to. + core::Ptr face() const; + + /// Returns the point (construction or sketch point) that positions the axis. + core::Ptr point() const; + + /// Redefines the input geometry of the construction axis. + /// face : The face (BRepFace object) to create the axis perpendicular to. + /// pointEntity : The point (sketch point, vertex, construction point) used to position the axis. + /// Returns true if the redefinition of the axis is successful. + bool redefine(const core::Ptr& face, const core::Ptr& pointEntity); + + ADSK_FUSION_CONSTRUCTIONAXISPERPENDICULARATPOINTDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXISPERPENDICULARATPOINTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXISPERPENDICULARATPOINTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXISPERPENDICULARATPOINTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace* face_raw() const = 0; + virtual core::Base* point_raw() const = 0; + virtual bool redefine_raw(BRepFace* face, core::Base* pointEntity) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionAxisPerpendicularAtPointDefinition::face() const +{ + core::Ptr res = face_raw(); + return res; +} + +inline core::Ptr ConstructionAxisPerpendicularAtPointDefinition::point() const +{ + core::Ptr res = point_raw(); + return res; +} + +inline bool ConstructionAxisPerpendicularAtPointDefinition::redefine(const core::Ptr& face, const core::Ptr& pointEntity) +{ + bool res = redefine_raw(face.get(), pointEntity.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXISPERPENDICULARATPOINTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisTwoPlaneDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisTwoPlaneDefinition.h new file mode 100644 index 0000000..102b7ae --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisTwoPlaneDefinition.h @@ -0,0 +1,81 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionAxisDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXISTWOPLANEDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXISTWOPLANEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXISTWOPLANEDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXISTWOPLANEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction axis created using the SetByTwoPlanes method +class ConstructionAxisTwoPlaneDefinition : public ConstructionAxisDefinition { +public: + + /// Gets the first planar face or construction plane + core::Ptr planarEntityOne() const; + + /// Gets the second planar face or construction plane + core::Ptr planarEntityTwo() const; + + /// Redefines the input geometry of the construction axis. + /// planarEntityOne : The first planar face or construction plane + /// planarEntityTwo : The second planar face or construction plane + /// Returns true if the redefinition of the axis is successful. + bool redefine(const core::Ptr& planarEntityOne, const core::Ptr& planarEntityTwo); + + ADSK_FUSION_CONSTRUCTIONAXISTWOPLANEDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXISTWOPLANEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXISTWOPLANEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXISTWOPLANEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* planarEntityOne_raw() const = 0; + virtual core::Base* planarEntityTwo_raw() const = 0; + virtual bool redefine_raw(core::Base* planarEntityOne, core::Base* planarEntityTwo) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionAxisTwoPlaneDefinition::planarEntityOne() const +{ + core::Ptr res = planarEntityOne_raw(); + return res; +} + +inline core::Ptr ConstructionAxisTwoPlaneDefinition::planarEntityTwo() const +{ + core::Ptr res = planarEntityTwo_raw(); + return res; +} + +inline bool ConstructionAxisTwoPlaneDefinition::redefine(const core::Ptr& planarEntityOne, const core::Ptr& planarEntityTwo) +{ + bool res = redefine_raw(planarEntityOne.get(), planarEntityTwo.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXISTWOPLANEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisTwoPointDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisTwoPointDefinition.h new file mode 100644 index 0000000..98fbe71 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionAxisTwoPointDefinition.h @@ -0,0 +1,81 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionAxisDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONAXISTWOPOINTDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONAXISTWOPOINTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONAXISTWOPOINTDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONAXISTWOPOINTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction axis created using the SetbyTwoPoints method +class ConstructionAxisTwoPointDefinition : public ConstructionAxisDefinition { +public: + + /// Gets the first point. + core::Ptr pointEntityOne() const; + + /// Gets the second point. + core::Ptr pointEntityTwo() const; + + /// Redefines the input geometry of the construction axis. + /// pointEntityOne : The first point + /// pointEntityTwo : The second point + /// Returns true if the redefinition of the construction axis is successful. + bool redefine(const core::Ptr& pointEntityOne, const core::Ptr& pointEntityTwo); + + ADSK_FUSION_CONSTRUCTIONAXISTWOPOINTDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONAXISTWOPOINTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONAXISTWOPOINTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONAXISTWOPOINTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* pointEntityOne_raw() const = 0; + virtual core::Base* pointEntityTwo_raw() const = 0; + virtual bool redefine_raw(core::Base* pointEntityOne, core::Base* pointEntityTwo) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionAxisTwoPointDefinition::pointEntityOne() const +{ + core::Ptr res = pointEntityOne_raw(); + return res; +} + +inline core::Ptr ConstructionAxisTwoPointDefinition::pointEntityTwo() const +{ + core::Ptr res = pointEntityTwo_raw(); + return res; +} + +inline bool ConstructionAxisTwoPointDefinition::redefine(const core::Ptr& pointEntityOne, const core::Ptr& pointEntityTwo) +{ + bool res = redefine_raw(pointEntityOne.get(), pointEntityTwo.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONAXISTWOPOINTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlane.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlane.h new file mode 100644 index 0000000..0af8d77 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlane.h @@ -0,0 +1,356 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANE_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANE_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANE_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class Component; + class ConstructionPlaneDefinition; + class Occurrence; + class TimelineObject; +}} +namespace adsk { namespace core { + class Attributes; + class BoundingBox2D; + class Matrix3D; + class Plane; +}} + +namespace adsk { namespace fusion { + +/// ConstructionPlane Object +class ConstructionPlane : public core::Base { +public: + + /// Returns a plane that represents the position and orientation of the construction plane. + /// This geometry is defined in the AssemblyContext of this ConstructionPlane. + core::Ptr geometry() const; + + /// Returns the name of the construction plane as it is shown in the browser. + std::string name() const; + bool name(const std::string& value); + + /// Returns the ConstructionPlaneDefinition object which provides access to the information + /// defining this ConstructionPlane. + core::Ptr definition() const; + + /// Deletes the construction plane. + /// Returns a bool indicating if the delete was successful or not. + bool deleteMe(); + + /// Indicates if this construction plane can be deleted. Base + /// construction planes can not be deleted. + bool isDeletable() const; + + /// Indicates if this construction plane is parametric or not. + bool isParametric() const; + + /// Indicates if the light bulb (as displayed in the browser) is on. + /// A construction plane will only be visible if it's light bulb, and that of it's + /// containing folder and parent component/s are also on. + bool isLightBulbOn() const; + bool isLightBulbOn(bool value); + + /// Indicates if the construction plane is visible. + /// This property is affected by the AssemblyContext of the construction plane. + bool isVisible() const; + + /// Gets and sets the display size of the construction plane. The bounding + /// box defines the min and max corners of the plane as defined in the + /// 2D space of the construction plane. + core::Ptr displayBounds() const; + bool displayBounds(const core::Ptr& value); + + /// Returns the parent component or base feature. If both the design and the construction + /// plane are parametric, the parent will be a component. If the design is parametric and + /// the construction plane is not, the parent will be a base feature. If + /// the design is not parametric the parent will be a component. + core::Ptr parent() const; + + /// Returns the component this construction plane belongs to. + core::Ptr component() const; + + /// Returns the timeline object associated with this construction plane. + core::Ptr timelineObject() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// If this construction plane is associated with a base feature, this property will return that base feature. + /// If it's not associated with a base feature, this property will return null. + core::Ptr baseFeature() const; + + /// Returns the collection of attributes associated with this construction plane. + core::Ptr attributes() const; + + /// Returns the current health state of this construction plane. + FeatureHealthStates healthState() const; + + /// Returns the error or warning message in the case where the healthState property returns either + /// WarningFeatureHealthState or ErrorFeatureHealthState. Otherwise this property returns an empty string. + std::string errorOrWarningMessage() const; + + /// Returns the current position and orientation of the construction plane as a matrix. + /// For a parametric construction plane, this property is read-only. For a construction + /// plane in a direct modeling model or in a base feature, this is read-write and can be + /// used to reposition the constructions plane. + core::Ptr transform() const; + bool transform(const core::Ptr& value); + + /// Returns a token for the ConstructionPlane object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same construction plane. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_CONSTRUCTIONPLANE_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANE_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Plane* geometry_raw() const = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual ConstructionPlaneDefinition* definition_raw() const = 0; + virtual bool deleteMe_raw() = 0; + virtual bool isDeletable_raw() const = 0; + virtual bool isParametric_raw() const = 0; + virtual bool isLightBulbOn_raw() const = 0; + virtual bool isLightBulbOn_raw(bool value) = 0; + virtual bool isVisible_raw() const = 0; + virtual core::BoundingBox2D* displayBounds_raw() const = 0; + virtual bool displayBounds_raw(core::BoundingBox2D* value) = 0; + virtual core::Base* parent_raw() const = 0; + virtual Component* component_raw() const = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual ConstructionPlane* nativeObject_raw() const = 0; + virtual ConstructionPlane* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual BaseFeature* baseFeature_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual FeatureHealthStates healthState_raw() const = 0; + virtual char* errorOrWarningMessage_raw() const = 0; + virtual core::Matrix3D* transform_raw() const = 0; + virtual bool transform_raw(core::Matrix3D* value) = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlane::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline std::string ConstructionPlane::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool ConstructionPlane::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline core::Ptr ConstructionPlane::definition() const +{ + core::Ptr res = definition_raw(); + return res; +} + +inline bool ConstructionPlane::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline bool ConstructionPlane::isDeletable() const +{ + bool res = isDeletable_raw(); + return res; +} + +inline bool ConstructionPlane::isParametric() const +{ + bool res = isParametric_raw(); + return res; +} + +inline bool ConstructionPlane::isLightBulbOn() const +{ + bool res = isLightBulbOn_raw(); + return res; +} + +inline bool ConstructionPlane::isLightBulbOn(bool value) +{ + return isLightBulbOn_raw(value); +} + +inline bool ConstructionPlane::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline core::Ptr ConstructionPlane::displayBounds() const +{ + core::Ptr res = displayBounds_raw(); + return res; +} + +inline bool ConstructionPlane::displayBounds(const core::Ptr& value) +{ + return displayBounds_raw(value.get()); +} + +inline core::Ptr ConstructionPlane::parent() const +{ + core::Ptr res = parent_raw(); + return res; +} + +inline core::Ptr ConstructionPlane::component() const +{ + core::Ptr res = component_raw(); + return res; +} + +inline core::Ptr ConstructionPlane::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline core::Ptr ConstructionPlane::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr ConstructionPlane::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ConstructionPlane::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr ConstructionPlane::baseFeature() const +{ + core::Ptr res = baseFeature_raw(); + return res; +} + +inline core::Ptr ConstructionPlane::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline FeatureHealthStates ConstructionPlane::healthState() const +{ + FeatureHealthStates res = healthState_raw(); + return res; +} + +inline std::string ConstructionPlane::errorOrWarningMessage() const +{ + std::string res; + + char* p= errorOrWarningMessage_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr ConstructionPlane::transform() const +{ + core::Ptr res = transform_raw(); + return res; +} + +inline bool ConstructionPlane::transform(const core::Ptr& value) +{ + return transform_raw(value.get()); +} + +inline std::string ConstructionPlane::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneAtAngleDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneAtAngleDefinition.h new file mode 100644 index 0000000..da48eaa --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneAtAngleDefinition.h @@ -0,0 +1,105 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPlaneDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANEATANGLEDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANEATANGLEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANEATANGLEDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANEATANGLEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Parameter; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// ConstructionPlaneAtAngleDefinition defines a ConstructionPlane by... +class ConstructionPlaneAtAngleDefinition : public ConstructionPlaneDefinition { +public: + + /// Returns a Value object that for a transient definition provides the current + /// assigned value. For a definition associated with a construction plane, this + /// provides access to the associated parameter controlling the angle. + core::Ptr angle() const; + + /// Gets the linear edge, construction line, or sketch line that defines + /// the axis of rotation for the construction plane. + core::Ptr linearEntity() const; + + /// Gets the planar face or construction plane the angle for this + /// construction plane is measured from and is parametrically dependent on. + core::Ptr planarEntity() const; + + /// Redefines the input geometry of the construction plane. + /// angle : A ValueInput object that defines the angle at which to create the construction plane + /// linearEntity : The linear edge, construction line, or sketch line that defines the axis of rotation to + /// measure the angle about + /// planarEntity : A plane, planar face or construction plane the angle of the construction plane is + /// measured from + /// Returns true if the redefinition of the plane is successful. + bool redefine(const core::Ptr& angle, const core::Ptr& linearEntity, const core::Ptr& planarEntity); + + ADSK_FUSION_CONSTRUCTIONPLANEATANGLEDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANEATANGLEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANEATANGLEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANEATANGLEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Parameter* angle_raw() const = 0; + virtual core::Base* linearEntity_raw() const = 0; + virtual core::Base* planarEntity_raw() const = 0; + virtual bool redefine_raw(core::ValueInput* angle, core::Base* linearEntity, core::Base* planarEntity) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlaneAtAngleDefinition::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline core::Ptr ConstructionPlaneAtAngleDefinition::linearEntity() const +{ + core::Ptr res = linearEntity_raw(); + return res; +} + +inline core::Ptr ConstructionPlaneAtAngleDefinition::planarEntity() const +{ + core::Ptr res = planarEntity_raw(); + return res; +} + +inline bool ConstructionPlaneAtAngleDefinition::redefine(const core::Ptr& angle, const core::Ptr& linearEntity, const core::Ptr& planarEntity) +{ + bool res = redefine_raw(angle.get(), linearEntity.get(), planarEntity.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANEATANGLEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneByPlaneDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneByPlaneDefinition.h new file mode 100644 index 0000000..71bd3b8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneByPlaneDefinition.h @@ -0,0 +1,70 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPlaneDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANEBYPLANEDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANEBYPLANEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANEBYPLANEDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANEBYPLANEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Plane; +}} + +namespace adsk { namespace fusion { + +/// The definition for a non-parametric construction plane. All constructions planes will +/// return this type of definition regardless of method used to initially create them. +class ConstructionPlaneByPlaneDefinition : public ConstructionPlaneDefinition { +public: + + /// Gets and sets the position of the construction plane. + core::Ptr plane() const; + bool plane(const core::Ptr& value); + + ADSK_FUSION_CONSTRUCTIONPLANEBYPLANEDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANEBYPLANEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANEBYPLANEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANEBYPLANEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Plane* plane_raw() const = 0; + virtual bool plane_raw(core::Plane* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlaneByPlaneDefinition::plane() const +{ + core::Ptr res = plane_raw(); + return res; +} + +inline bool ConstructionPlaneByPlaneDefinition::plane(const core::Ptr& value) +{ + return plane_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANEBYPLANEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneDefinition.h new file mode 100644 index 0000000..df4239f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneDefinition.h @@ -0,0 +1,94 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANEDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANEDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ConstructionPlane; +}} + +namespace adsk { namespace fusion { + +/// A Base class to return the information, possibly parametric, used to define the ConstructionPlane. +class ConstructionPlaneDefinition : public core::Base { +public: + + /// Returns the ConstructionPlane object + core::Ptr parentConstructionPlane() const; + + ADSK_FUSION_CONSTRUCTIONPLANEDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ConstructionPlane* parentConstructionPlane_raw() const = 0; + virtual void placeholderConstructionPlaneDefinition0() {} + virtual void placeholderConstructionPlaneDefinition1() {} + virtual void placeholderConstructionPlaneDefinition2() {} + virtual void placeholderConstructionPlaneDefinition3() {} + virtual void placeholderConstructionPlaneDefinition4() {} + virtual void placeholderConstructionPlaneDefinition5() {} + virtual void placeholderConstructionPlaneDefinition6() {} + virtual void placeholderConstructionPlaneDefinition7() {} + virtual void placeholderConstructionPlaneDefinition8() {} + virtual void placeholderConstructionPlaneDefinition9() {} + virtual void placeholderConstructionPlaneDefinition10() {} + virtual void placeholderConstructionPlaneDefinition11() {} + virtual void placeholderConstructionPlaneDefinition12() {} + virtual void placeholderConstructionPlaneDefinition13() {} + virtual void placeholderConstructionPlaneDefinition14() {} + virtual void placeholderConstructionPlaneDefinition15() {} + virtual void placeholderConstructionPlaneDefinition16() {} + virtual void placeholderConstructionPlaneDefinition17() {} + virtual void placeholderConstructionPlaneDefinition18() {} + virtual void placeholderConstructionPlaneDefinition19() {} + virtual void placeholderConstructionPlaneDefinition20() {} + virtual void placeholderConstructionPlaneDefinition21() {} + virtual void placeholderConstructionPlaneDefinition22() {} + virtual void placeholderConstructionPlaneDefinition23() {} + virtual void placeholderConstructionPlaneDefinition24() {} + virtual void placeholderConstructionPlaneDefinition25() {} + virtual void placeholderConstructionPlaneDefinition26() {} + virtual void placeholderConstructionPlaneDefinition27() {} + virtual void placeholderConstructionPlaneDefinition28() {} + virtual void placeholderConstructionPlaneDefinition29() {} + virtual void placeholderConstructionPlaneDefinition30() {} +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlaneDefinition::parentConstructionPlane() const +{ + core::Ptr res = parentConstructionPlane_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneDistanceOnPathDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneDistanceOnPathDefinition.h new file mode 100644 index 0000000..0d21504 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneDistanceOnPathDefinition.h @@ -0,0 +1,89 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPlaneDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANEDISTANCEONPATHDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANEDISTANCEONPATHDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANEDISTANCEONPATHDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANEDISTANCEONPATHDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Parameter; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// ConstructionDistanceOnPathDefinition defines a ConstructionPlane normal to an edge or +/// sketch profile at a specified position along the path defined by the edge or sketch profile. +class ConstructionPlaneDistanceOnPathDefinition : public ConstructionPlaneDefinition { +public: + + /// Gets the sketch curve, edge, or a profile object. + core::Ptr pathEntity() const; + + /// Redefines the input defining the construction plane. + /// pathEntity : The sketch curve, edge, or a profile object + /// distance : The ValueInput object that defines the distance along the path + /// Returns true if the redefinition of the plane is successful. + bool redefine(const core::Ptr& pathEntity, const core::Ptr& distance); + + /// Gets the distance along the path. + core::Ptr distance() const; + + ADSK_FUSION_CONSTRUCTIONPLANEDISTANCEONPATHDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANEDISTANCEONPATHDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANEDISTANCEONPATHDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANEDISTANCEONPATHDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* pathEntity_raw() const = 0; + virtual bool redefine_raw(core::Base* pathEntity, core::ValueInput* distance) = 0; + virtual Parameter* distance_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlaneDistanceOnPathDefinition::pathEntity() const +{ + core::Ptr res = pathEntity_raw(); + return res; +} + +inline bool ConstructionPlaneDistanceOnPathDefinition::redefine(const core::Ptr& pathEntity, const core::Ptr& distance) +{ + bool res = redefine_raw(pathEntity.get(), distance.get()); + return res; +} + +inline core::Ptr ConstructionPlaneDistanceOnPathDefinition::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANEDISTANCEONPATHDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneInput.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneInput.h new file mode 100644 index 0000000..c3675d9 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneInput.h @@ -0,0 +1,260 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANEINPUT_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANEINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANEINPUT_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANEINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; + class Occurrence; +}} +namespace adsk { namespace core { + class Plane; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// A ConstructionPlaneInput is a throwaway object used to create a ConstructionPlane +/// The usage pattern is: +/// a. create a ConstructionPlaneInput (ConstructionPlanes.CreateInput) +/// b. call one of the member functions to specify how the ConstructionPlane is created +/// c. create the ConstructionPlane (call ConstructionPlanes.Add) +/// d. stop referencing the ConstructionPlaneInput (so it gets deleted). +class ConstructionPlaneInput : public core::Base { +public: + + /// This input method is for creating a non-parametric construction plane positioned in + /// space as defined by the input Plane object. + /// This method of defining a construction plane is only valid when working in a direct edit model (do not capture design history). + /// This is not valid when working in a parametric model and will fail. + /// plane : A transient plane object + /// Returns true if the construction plane definition is successful. + bool setByPlane(const core::Ptr& plane); + + /// This input method is for creating a construction plane that is offset from a planar + /// face or construction plane at a specified distance. This can result in + /// a parametric or non-parametric construction plane depending on whether the parent + /// component is parametric or is a direct edit component. + /// planarEntity : A plane, planar face or construction plane from which to create the offset plane + /// offset : ValueInput object that specifies the offset distance for the plane + /// Returns true if the construction plane definition is successful. + bool setByOffset(const core::Ptr& planarEntity, const core::Ptr& offset); + + /// This input method is for creating a construction plane through an edge, axis or line + /// at a specified angle. This can result in a parametric or non-parametric construction + /// plane depending on whether the parent component is parametric or is a direct edit + /// component. + /// linearEntity : The axis about which to rotate the plane + /// angle : The angle at which to create the plane + /// planarEntity : The planar face or construction plane the angle is measured from. + /// Returns true if the construction plane definition is successful. + bool setByAngle(const core::Ptr& linearEntity, const core::Ptr& angle, const core::Ptr& planarEntity); + + /// This input method is for creating a construction plane tangent to a cylindrical or + /// conical face at a specified point. This can result in a parametric or non-parametric construction + /// plane depending on whether the parent component is parametric or is a direct edit + /// component. + /// tangentFace : A cylindrical or conical face to create the plane tangent to + /// angle : The angle relative to the planarEntity input at which to create the tangent plane + /// planarEntity : The planar face or construction plane the tangent is measured from. + /// Returns true if the construction plane definition is successful. + bool setByTangent(const core::Ptr& tangentFace, const core::Ptr& angle, const core::Ptr& planarEntity); + + /// This input method is for creating a construction plane at the midpoint between + /// two planar faces or construction planes. This can result in a parametric or + /// non-parametric construction plane depending on whether the parent component is + /// parametric or is a direct edit component. + /// planarEntityOne : The first planar face or construction plane to create a bisecting plane between + /// planarEntityTwo : The second planar face or construction plane to create a bisecting plane between + /// Returns true if the construction plane definition is successful. + /// This will fail if the two planes are co-planar. + bool setByTwoPlanes(const core::Ptr& planarEntityOne, const core::Ptr& planarEntityTwo); + + /// This input method is for creating a construction plane that passes through two + /// coplanar linear entities or axes. + /// Defines a plane by specifying two coplanar linear entities. This can result in a + /// parametric or non-parametric construction plane depending on whether the parent + /// component is parametric or is a direct edit component. + /// linearEntityOne : The first of two coplanar linear entities to define the plane + /// linearEntityTwo : The second of two coplanar linear entities to define the plane + /// Returns true if the construction plane definition is successful. + /// This will fail if the two linear entities are not coplanar. + bool setByTwoEdges(const core::Ptr& linearEntityOne, const core::Ptr& linearEntityTwo); + + /// This input method is for creating a construction plane through three points that + /// define a triangle. This can result in a parametric or non-parametric construction + /// plane depending on whether the parent component is parametric or is a direct edit + /// component. + /// pointEntityOne : The first construction point, sketch point or vertex in the triangle + /// pointEntityTwo : The second construction point, sketch point or vertex in the triangle + /// pointEntityThree : The third construction point, sketch point or vertex in the triangle + /// Returns true if the construction plane definition is successful. + /// This will fail if the points do not form a triangle (no two + /// points can be coincident and all three cannot be collinear). + bool setByThreePoints(const core::Ptr& pointEntityOne, const core::Ptr& pointEntityTwo, const core::Ptr& pointEntityThree); + + /// This input method is for creating a construction plane tangent to a face + /// and aligned to a point. This can result in a parametric or non-parametric + /// construction plane depending on whether the parent component is parametric or is a + /// direct edit component. + /// tangentFace : A face to create the plane tangent to + /// pointEntity : A construction point, sketch point or vertex the tangent plane aligns to. + /// This point need not lie on the tangent face. + /// Returns true if the construction plane definition is successful. + bool setByTangentAtPoint(const core::Ptr& tangentFace, const core::Ptr& pointEntity); + + /// This input method is for creating a construction plane normal to, and at + /// specified distance along, a path defined by an edge or sketch profile. + /// This can result in a parametric or non-parametric + /// construction plane depending on whether the parent component is parametric or is a + /// direct edit component. + /// pathEntity : The path can be an edge, sketch curve, or a path of multiple entities. + /// distance : The distance is a value from 0 to 1 indicating the position along the path where 0 + /// is at the start and 1 is at the end. + /// Returns true if the construction plane definition is successful. + bool setByDistanceOnPath(const core::Ptr& pathEntity, const core::Ptr& distance); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs to be + /// specified when the ConstructionPlane is created based on geometry (e.g. a planarEntity) + /// in another component AND (the ConstructionPlane) is not in the root component. + /// The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// When creating a construction plane that is owned by a base or form feature, set this property to the + /// base or form feature you want to associate the new construction plane with. By default, this is null, + /// meaning it will not be associated with a base or form feature. + /// Because of a current limitation, if you want to create a construction plane associated with a base + /// or form feature, you must set this property AND call the edit method of the base or form feature, + /// create the feature, and then call the finishEdit method of the base or form feature. The base or form + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseOrFormFeature() const; + bool targetBaseOrFormFeature(const core::Ptr& value); + + ADSK_FUSION_CONSTRUCTIONPLANEINPUT_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANEINPUT_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANEINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANEINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setByPlane_raw(core::Plane* plane) = 0; + virtual bool setByOffset_raw(core::Base* planarEntity, core::ValueInput* offset) = 0; + virtual bool setByAngle_raw(core::Base* linearEntity, core::ValueInput* angle, core::Base* planarEntity) = 0; + virtual bool setByTangent_raw(BRepFace* tangentFace, core::ValueInput* angle, core::Base* planarEntity) = 0; + virtual bool setByTwoPlanes_raw(core::Base* planarEntityOne, core::Base* planarEntityTwo) = 0; + virtual bool setByTwoEdges_raw(core::Base* linearEntityOne, core::Base* linearEntityTwo) = 0; + virtual bool setByThreePoints_raw(core::Base* pointEntityOne, core::Base* pointEntityTwo, core::Base* pointEntityThree) = 0; + virtual bool setByTangentAtPoint_raw(BRepFace* tangentFace, core::Base* pointEntity) = 0; + virtual bool setByDistanceOnPath_raw(core::Base* pathEntity, core::ValueInput* distance) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual core::Base* targetBaseOrFormFeature_raw() const = 0; + virtual bool targetBaseOrFormFeature_raw(core::Base* value) = 0; +}; + +// Inline wrappers + +inline bool ConstructionPlaneInput::setByPlane(const core::Ptr& plane) +{ + bool res = setByPlane_raw(plane.get()); + return res; +} + +inline bool ConstructionPlaneInput::setByOffset(const core::Ptr& planarEntity, const core::Ptr& offset) +{ + bool res = setByOffset_raw(planarEntity.get(), offset.get()); + return res; +} + +inline bool ConstructionPlaneInput::setByAngle(const core::Ptr& linearEntity, const core::Ptr& angle, const core::Ptr& planarEntity) +{ + bool res = setByAngle_raw(linearEntity.get(), angle.get(), planarEntity.get()); + return res; +} + +inline bool ConstructionPlaneInput::setByTangent(const core::Ptr& tangentFace, const core::Ptr& angle, const core::Ptr& planarEntity) +{ + bool res = setByTangent_raw(tangentFace.get(), angle.get(), planarEntity.get()); + return res; +} + +inline bool ConstructionPlaneInput::setByTwoPlanes(const core::Ptr& planarEntityOne, const core::Ptr& planarEntityTwo) +{ + bool res = setByTwoPlanes_raw(planarEntityOne.get(), planarEntityTwo.get()); + return res; +} + +inline bool ConstructionPlaneInput::setByTwoEdges(const core::Ptr& linearEntityOne, const core::Ptr& linearEntityTwo) +{ + bool res = setByTwoEdges_raw(linearEntityOne.get(), linearEntityTwo.get()); + return res; +} + +inline bool ConstructionPlaneInput::setByThreePoints(const core::Ptr& pointEntityOne, const core::Ptr& pointEntityTwo, const core::Ptr& pointEntityThree) +{ + bool res = setByThreePoints_raw(pointEntityOne.get(), pointEntityTwo.get(), pointEntityThree.get()); + return res; +} + +inline bool ConstructionPlaneInput::setByTangentAtPoint(const core::Ptr& tangentFace, const core::Ptr& pointEntity) +{ + bool res = setByTangentAtPoint_raw(tangentFace.get(), pointEntity.get()); + return res; +} + +inline bool ConstructionPlaneInput::setByDistanceOnPath(const core::Ptr& pathEntity, const core::Ptr& distance) +{ + bool res = setByDistanceOnPath_raw(pathEntity.get(), distance.get()); + return res; +} + +inline core::Ptr ConstructionPlaneInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool ConstructionPlaneInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline core::Ptr ConstructionPlaneInput::targetBaseOrFormFeature() const +{ + core::Ptr res = targetBaseOrFormFeature_raw(); + return res; +} + +inline bool ConstructionPlaneInput::targetBaseOrFormFeature(const core::Ptr& value) +{ + return targetBaseOrFormFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANEINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneMidplaneDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneMidplaneDefinition.h new file mode 100644 index 0000000..e51210b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneMidplaneDefinition.h @@ -0,0 +1,81 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPlaneDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANEMIDPLANEDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANEMIDPLANEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANEMIDPLANEDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANEMIDPLANEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// ConstructionPlaneMidplaneDefinition defines a ConstructionPlane by... +class ConstructionPlaneMidplaneDefinition : public ConstructionPlaneDefinition { +public: + + /// Gets the first planar face or construction plane that defines this ConstructionPlane. + core::Ptr planarEntityOne() const; + + /// Gets the second planar face or construction plane that defines this ConstructionPlane. + core::Ptr planarEntityTwo() const; + + /// Redefines the input geometry of the construction plane. + /// planarEntityOne : The first planar face or construction plane that defines this ConstructionPlane. + /// planarEntityTwo : The second planar face or construction plane that defines this ConstructionPlane. + /// Returns true if the redefinition of the plane is successful. + bool redefine(const core::Ptr& planarEntityOne, const core::Ptr& planarEntityTwo); + + ADSK_FUSION_CONSTRUCTIONPLANEMIDPLANEDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANEMIDPLANEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANEMIDPLANEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANEMIDPLANEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* planarEntityOne_raw() const = 0; + virtual core::Base* planarEntityTwo_raw() const = 0; + virtual bool redefine_raw(core::Base* planarEntityOne, core::Base* planarEntityTwo) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlaneMidplaneDefinition::planarEntityOne() const +{ + core::Ptr res = planarEntityOne_raw(); + return res; +} + +inline core::Ptr ConstructionPlaneMidplaneDefinition::planarEntityTwo() const +{ + core::Ptr res = planarEntityTwo_raw(); + return res; +} + +inline bool ConstructionPlaneMidplaneDefinition::redefine(const core::Ptr& planarEntityOne, const core::Ptr& planarEntityTwo) +{ + bool res = redefine_raw(planarEntityOne.get(), planarEntityTwo.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANEMIDPLANEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneOffsetDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneOffsetDefinition.h new file mode 100644 index 0000000..eb3d671 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneOffsetDefinition.h @@ -0,0 +1,91 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPlaneDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANEOFFSETDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANEOFFSETDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANEOFFSETDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANEOFFSETDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Parameter; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// ConstructionPlaneOffsetDefinition defines a ConstructionPlane by... +class ConstructionPlaneOffsetDefinition : public ConstructionPlaneDefinition { +public: + + /// Returns a Value object that for a transient definition that provides the current + /// assigned value and for a definition associated with a construction plane + /// Provides access to the associated parameter controlling the offset. + core::Ptr offset() const; + + /// Gets the planar face or construction plane this construction plane + /// is parametrically dependent on. + core::Ptr planarEntity() const; + + /// Redefines the input geometry of the construction plane. + /// offset : ValueInput object that specifies the offset distance + /// planarEntity : A plane, planar face or construction plane from which to measure the offset from + /// Returns true is the operation is successful + bool redefine(const core::Ptr& offset, const core::Ptr& planarEntity); + + ADSK_FUSION_CONSTRUCTIONPLANEOFFSETDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANEOFFSETDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANEOFFSETDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANEOFFSETDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Parameter* offset_raw() const = 0; + virtual core::Base* planarEntity_raw() const = 0; + virtual bool redefine_raw(core::ValueInput* offset, core::Base* planarEntity) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlaneOffsetDefinition::offset() const +{ + core::Ptr res = offset_raw(); + return res; +} + +inline core::Ptr ConstructionPlaneOffsetDefinition::planarEntity() const +{ + core::Ptr res = planarEntity_raw(); + return res; +} + +inline bool ConstructionPlaneOffsetDefinition::redefine(const core::Ptr& offset, const core::Ptr& planarEntity) +{ + bool res = redefine_raw(offset.get(), planarEntity.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANEOFFSETDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneTangentAtPointDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneTangentAtPointDefinition.h new file mode 100644 index 0000000..686dc8a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneTangentAtPointDefinition.h @@ -0,0 +1,86 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPlaneDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANETANGENTATPOINTDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANETANGENTATPOINTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANETANGENTATPOINTDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANETANGENTATPOINTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; +}} + +namespace adsk { namespace fusion { + +/// ConstructionPlaneTangentAtPointDefinition defines a ConstructionPlane tangent to a +/// face and aligned to a point. +class ConstructionPlaneTangentAtPointDefinition : public ConstructionPlaneDefinition { +public: + + /// Gets the tangent face. + core::Ptr tangentFace() const; + + /// Gets the point (sketch point, vertex, construction point) used to align the plane. + core::Ptr pointEntity() const; + + /// Redefines the input geometry of the construction plane. + /// tangentFace : The face to create the plane tangent to + /// pointEntity : The point (sketch point, vertex, construction point) used to align the plane. + /// Returns true if the redefinition of the plane is successful. + bool redefine(const core::Ptr& tangentFace, const core::Ptr& pointEntity); + + ADSK_FUSION_CONSTRUCTIONPLANETANGENTATPOINTDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANETANGENTATPOINTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANETANGENTATPOINTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANETANGENTATPOINTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace* tangentFace_raw() const = 0; + virtual core::Base* pointEntity_raw() const = 0; + virtual bool redefine_raw(core::Base* tangentFace, core::Base* pointEntity) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlaneTangentAtPointDefinition::tangentFace() const +{ + core::Ptr res = tangentFace_raw(); + return res; +} + +inline core::Ptr ConstructionPlaneTangentAtPointDefinition::pointEntity() const +{ + core::Ptr res = pointEntity_raw(); + return res; +} + +inline bool ConstructionPlaneTangentAtPointDefinition::redefine(const core::Ptr& tangentFace, const core::Ptr& pointEntity) +{ + bool res = redefine_raw(tangentFace.get(), pointEntity.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANETANGENTATPOINTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneTangentDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneTangentDefinition.h new file mode 100644 index 0000000..1a2f328 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneTangentDefinition.h @@ -0,0 +1,105 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPlaneDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANETANGENTDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANETANGENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANETANGENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANETANGENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Parameter; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// ConstructionPlaneTangentDefinition defines a ConstructionPlane tangent to a cylindrical or conical +/// face at a point. +class ConstructionPlaneTangentDefinition : public ConstructionPlaneDefinition { +public: + + /// Returns a Value object that for a transient definition provides the current + /// assigned value. For a definition associated with a construction plane, it + /// provides access to the associated parameter controlling the angle. + core::Ptr angle() const; + + /// Gets the cylindrical or conical face that the construction plane + /// is tangent to. + core::Ptr tangentFace() const; + + /// Gets the planar face or construction plane the angle for this + /// construction plane is measured from and is parametrically dependent on. + core::Ptr planarEntity() const; + + /// Redefines the input geometry of the construction plane. + /// angle : A Value object that defines the angle of the construction plane + /// tangentFace : The cylindrical or conical face that the construction plane is tangent to. + /// planarEntity : The planar face or construction plane the angle for this + /// construction plane is measured from + /// Returns true if the redefinition of the plane is successful. + bool redefine(const core::Ptr& angle, const core::Ptr& tangentFace, const core::Ptr& planarEntity); + + ADSK_FUSION_CONSTRUCTIONPLANETANGENTDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANETANGENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANETANGENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANETANGENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Parameter* angle_raw() const = 0; + virtual core::Base* tangentFace_raw() const = 0; + virtual core::Base* planarEntity_raw() const = 0; + virtual bool redefine_raw(core::ValueInput* angle, core::Base* tangentFace, core::Base* planarEntity) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlaneTangentDefinition::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline core::Ptr ConstructionPlaneTangentDefinition::tangentFace() const +{ + core::Ptr res = tangentFace_raw(); + return res; +} + +inline core::Ptr ConstructionPlaneTangentDefinition::planarEntity() const +{ + core::Ptr res = planarEntity_raw(); + return res; +} + +inline bool ConstructionPlaneTangentDefinition::redefine(const core::Ptr& angle, const core::Ptr& tangentFace, const core::Ptr& planarEntity) +{ + bool res = redefine_raw(angle.get(), tangentFace.get(), planarEntity.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANETANGENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneThreePointsDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneThreePointsDefinition.h new file mode 100644 index 0000000..ff64275 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneThreePointsDefinition.h @@ -0,0 +1,94 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPlaneDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANETHREEPOINTSDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANETHREEPOINTSDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANETHREEPOINTSDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANETHREEPOINTSDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// ConstructionPlaneThreePointDefinition defines a ConstructionPlane by 3 point entities +/// (e.g. (sketch points, vertices or construction points) that form a triangle (i.e. +/// no two points the same and they aren't collinear). +class ConstructionPlaneThreePointsDefinition : public ConstructionPlaneDefinition { +public: + + /// Gets the first construction point, sketch point or vertex. + core::Ptr pointEntityOne() const; + + /// Gets the second construction point, sketch point or vertex. + core::Ptr pointEntityTwo() const; + + /// Gets the third construction point, sketch point or vertex. + core::Ptr pointEntityThree() const; + + /// Redefines the input geometry of the construction plane. + /// pointEntityOne : Gets the first construction point, sketch point or vertex. + /// pointEntityTwo : Gets the second construction point, sketch point or vertex. + /// pointEntityThree : Gets the third construction point, sketch point or vertex. + /// Returns true if the redefinition of the plane is successful. + bool redefine(const core::Ptr& pointEntityOne, const core::Ptr& pointEntityTwo, const core::Ptr& pointEntityThree); + + ADSK_FUSION_CONSTRUCTIONPLANETHREEPOINTSDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANETHREEPOINTSDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANETHREEPOINTSDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANETHREEPOINTSDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* pointEntityOne_raw() const = 0; + virtual core::Base* pointEntityTwo_raw() const = 0; + virtual core::Base* pointEntityThree_raw() const = 0; + virtual bool redefine_raw(core::Base* pointEntityOne, core::Base* pointEntityTwo, core::Base* pointEntityThree) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlaneThreePointsDefinition::pointEntityOne() const +{ + core::Ptr res = pointEntityOne_raw(); + return res; +} + +inline core::Ptr ConstructionPlaneThreePointsDefinition::pointEntityTwo() const +{ + core::Ptr res = pointEntityTwo_raw(); + return res; +} + +inline core::Ptr ConstructionPlaneThreePointsDefinition::pointEntityThree() const +{ + core::Ptr res = pointEntityThree_raw(); + return res; +} + +inline bool ConstructionPlaneThreePointsDefinition::redefine(const core::Ptr& pointEntityOne, const core::Ptr& pointEntityTwo, const core::Ptr& pointEntityThree) +{ + bool res = redefine_raw(pointEntityOne.get(), pointEntityTwo.get(), pointEntityThree.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANETHREEPOINTSDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneTwoEdgesDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneTwoEdgesDefinition.h new file mode 100644 index 0000000..81b949f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlaneTwoEdgesDefinition.h @@ -0,0 +1,86 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPlaneDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANETWOEDGESDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANETWOEDGESDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANETWOEDGESDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANETWOEDGESDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// ConstructionPlaneTwoEdgesDefinition defines a ConstructionPlane by two co-planar +/// linear entities like edges, sketch lines or construction axis. +class ConstructionPlaneTwoEdgesDefinition : public ConstructionPlaneDefinition { +public: + + /// Gets the first linear edge, construction line, or sketch line that defines + /// the construction plane. + core::Ptr linearEntityOne() const; + + /// Gets the second linear edge, construction line, or sketch line that defines + /// the construction plane. + core::Ptr linearEntityTwo() const; + + /// Redefines the input geometry of the construction plane. + /// linearEntityOne : The first linear edge, construction line, or sketch line that defines + /// the construction plane. + /// linearEntityTwo : The second linear edge, construction line, or sketch line that defines + /// the construction plane. + /// + bool redefine(const core::Ptr& linearEntityOne, const core::Ptr& linearEntityTwo); + + ADSK_FUSION_CONSTRUCTIONPLANETWOEDGESDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANETWOEDGESDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANETWOEDGESDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANETWOEDGESDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* linearEntityOne_raw() const = 0; + virtual core::Base* linearEntityTwo_raw() const = 0; + virtual bool redefine_raw(core::Base* linearEntityOne, core::Base* linearEntityTwo) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlaneTwoEdgesDefinition::linearEntityOne() const +{ + core::Ptr res = linearEntityOne_raw(); + return res; +} + +inline core::Ptr ConstructionPlaneTwoEdgesDefinition::linearEntityTwo() const +{ + core::Ptr res = linearEntityTwo_raw(); + return res; +} + +inline bool ConstructionPlaneTwoEdgesDefinition::redefine(const core::Ptr& linearEntityOne, const core::Ptr& linearEntityTwo) +{ + bool res = redefine_raw(linearEntityOne.get(), linearEntityTwo.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANETWOEDGESDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlanes.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlanes.h new file mode 100644 index 0000000..937d105 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPlanes.h @@ -0,0 +1,144 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPLANES_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPLANES_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPLANES_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPLANES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class ConstructionPlane; + class ConstructionPlaneInput; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the construction planes within a component and provides +/// methods to create new construction planes. +class ConstructionPlanes : public core::Base { +public: + + /// Function that returns the specified construction plane using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the specified construction plane using the name of the construction + /// plane as it is displayed in the browser. + /// name : The name of the construction plane as it is displayed in the browser + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns the number of construction planes in the collection. + size_t count() const; + + /// Create a ConstructionPlaneInput object that is in turn used to create a ConstructionPlane. + /// occurrenceForCreation : A creation occurrence is needed if the input is in another component AND the + /// construction plane is not in the root component. The occurrenceForCreation is analogous + /// to the active occurrence in the UI. + /// Returns a ConstructionPlaneInput object + core::Ptr createInput(const core::Ptr& occurrenceForCreation = NULL) const; + + /// Creates and adds a new ConstructionPlane using the creation parameters in + /// the ConstructionPlaneInput. + /// If the ConstructionPlaneInput was defined using the setByPlane method then + /// the add will only work in a direct edit model (do not capture design history) and will fail in a parametric model. + /// input : A ConstructionPlaneInput object + /// Returns the newly created construction plane or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Returns the component that owns this collection. + core::Ptr component() const; + + typedef ConstructionPlane iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_CONSTRUCTIONPLANES_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPLANES_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPLANES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPLANES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ConstructionPlane* item_raw(size_t index) const = 0; + virtual ConstructionPlane* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual ConstructionPlaneInput* createInput_raw(Occurrence* occurrenceForCreation) const = 0; + virtual ConstructionPlane* add_raw(ConstructionPlaneInput* input) = 0; + virtual Component* component_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPlanes::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr ConstructionPlanes::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t ConstructionPlanes::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ConstructionPlanes::createInput(const core::Ptr& occurrenceForCreation) const +{ + core::Ptr res = createInput_raw(occurrenceForCreation.get()); + return res; +} + +inline core::Ptr ConstructionPlanes::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ConstructionPlanes::component() const +{ + core::Ptr res = component_raw(); + return res; +} + +template inline void ConstructionPlanes::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPLANES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPoint.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPoint.h new file mode 100644 index 0000000..8917b8c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPoint.h @@ -0,0 +1,315 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPOINT_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPOINT_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPOINT_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPOINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class Component; + class ConstructionPointDefinition; + class Occurrence; + class TimelineObject; +}} +namespace adsk { namespace core { + class Attributes; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// ConstructionPoint Object +class ConstructionPoint : public core::Base { +public: + + /// Returns a Point3D object that represents the position of the construction point. + /// The returned geometry is in the AssemblyContext of this ConstructionPoint. + core::Ptr geometry() const; + + /// The name of the construction point as it is displayed in the browser. + std::string name() const; + bool name(const std::string& value); + + /// Returns the construction point definition object which provides access to the + /// information defining the construction point. + core::Ptr definition() const; + + /// Deletes the construction point. + /// Returns a bool indicating if the delete was successful or not. + bool deleteMe(); + + /// Indicates if this construction point can be deleted. The base + /// construction point cannot be deleted. + bool isDeletable() const; + + /// Indicates if the light bulb (as displayed in the browser) is on. + /// A construction point will only be visible if it's light bulb, and that of it's + /// containing folder and parent component/s are also on. + bool isLightBulbOn() const; + bool isLightBulbOn(bool value); + + /// Gets if the construction point is visible. + /// This property is affected by the AssemblyContext of the construction point. + bool isVisible() const; + + /// Returns the parent component or base feature. If both the design and the construction + /// point are parametric, the parent will be a component. If the design is parametric and + /// the construction point is not, the parent will be a base feature. If + /// the design is not parametric the parent will be a component. + core::Ptr parent() const; + + /// Returns the component this construction point belongs to. + core::Ptr component() const; + + /// Indicates if the construction point is parametric. + bool isParametric() const; + + /// Returns the timeline object associated with this construction point. + core::Ptr timelineObject() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// If this construction point is associated with a base feature, this property will return that base feature. + /// If it's not associated with a base feature, this property will return null. + core::Ptr baseFeature() const; + + /// Returns the collection of attributes associated with this construction point. + core::Ptr attributes() const; + + /// Returns the current health state of this construction point. + FeatureHealthStates healthState() const; + + /// Returns the error or warning message in the case where the healthState property returns either + /// WarningFeatureHealthState or ErrorFeatureHealthState. Otherwise this property returns an empty string. + std::string errorOrWarningMessage() const; + + /// Returns a token for the ConstructionPoint object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same construction point. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_CONSTRUCTIONPOINT_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPOINT_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPOINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPOINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Point3D* geometry_raw() const = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual ConstructionPointDefinition* definition_raw() const = 0; + virtual bool deleteMe_raw() = 0; + virtual bool isDeletable_raw() const = 0; + virtual bool isLightBulbOn_raw() const = 0; + virtual bool isLightBulbOn_raw(bool value) = 0; + virtual bool isVisible_raw() const = 0; + virtual core::Base* parent_raw() const = 0; + virtual Component* component_raw() const = 0; + virtual bool isParametric_raw() const = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual ConstructionPoint* nativeObject_raw() const = 0; + virtual ConstructionPoint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual BaseFeature* baseFeature_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual FeatureHealthStates healthState_raw() const = 0; + virtual char* errorOrWarningMessage_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPoint::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline std::string ConstructionPoint::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool ConstructionPoint::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline core::Ptr ConstructionPoint::definition() const +{ + core::Ptr res = definition_raw(); + return res; +} + +inline bool ConstructionPoint::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline bool ConstructionPoint::isDeletable() const +{ + bool res = isDeletable_raw(); + return res; +} + +inline bool ConstructionPoint::isLightBulbOn() const +{ + bool res = isLightBulbOn_raw(); + return res; +} + +inline bool ConstructionPoint::isLightBulbOn(bool value) +{ + return isLightBulbOn_raw(value); +} + +inline bool ConstructionPoint::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline core::Ptr ConstructionPoint::parent() const +{ + core::Ptr res = parent_raw(); + return res; +} + +inline core::Ptr ConstructionPoint::component() const +{ + core::Ptr res = component_raw(); + return res; +} + +inline bool ConstructionPoint::isParametric() const +{ + bool res = isParametric_raw(); + return res; +} + +inline core::Ptr ConstructionPoint::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline core::Ptr ConstructionPoint::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr ConstructionPoint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ConstructionPoint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr ConstructionPoint::baseFeature() const +{ + core::Ptr res = baseFeature_raw(); + return res; +} + +inline core::Ptr ConstructionPoint::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline FeatureHealthStates ConstructionPoint::healthState() const +{ + FeatureHealthStates res = healthState_raw(); + return res; +} + +inline std::string ConstructionPoint::errorOrWarningMessage() const +{ + std::string res; + + char* p= errorOrWarningMessage_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string ConstructionPoint::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPOINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointCenterDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointCenterDefinition.h new file mode 100644 index 0000000..4e87123 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointCenterDefinition.h @@ -0,0 +1,66 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPointDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPOINTCENTERDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPOINTCENTERDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPOINTCENTERDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPOINTCENTERDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction point created using the SetbyCenter method +class ConstructionPointCenterDefinition : public ConstructionPointDefinition { +public: + + /// Gets and sets the spherical face (sphere or torus), circular edge or sketch arc/circle + /// whose center defines the location for the construction point. + core::Ptr circularEntity() const; + bool circularEntity(const core::Ptr& value); + + ADSK_FUSION_CONSTRUCTIONPOINTCENTERDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPOINTCENTERDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPOINTCENTERDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPOINTCENTERDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* circularEntity_raw() const = 0; + virtual bool circularEntity_raw(core::Base* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPointCenterDefinition::circularEntity() const +{ + core::Ptr res = circularEntity_raw(); + return res; +} + +inline bool ConstructionPointCenterDefinition::circularEntity(const core::Ptr& value) +{ + return circularEntity_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPOINTCENTERDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointDefinition.h new file mode 100644 index 0000000..a672a02 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointDefinition.h @@ -0,0 +1,95 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPOINTDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPOINTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPOINTDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPOINTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ConstructionPoint; +}} + +namespace adsk { namespace fusion { + +/// A Base class to return the information (possibly parametric) used to +/// define a ConstructionPoint. +class ConstructionPointDefinition : public core::Base { +public: + + /// Returns the ConstructionPoint object + core::Ptr parentConstructionPoint() const; + + ADSK_FUSION_CONSTRUCTIONPOINTDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPOINTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPOINTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPOINTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ConstructionPoint* parentConstructionPoint_raw() const = 0; + virtual void placeholderConstructionPointDefinition0() {} + virtual void placeholderConstructionPointDefinition1() {} + virtual void placeholderConstructionPointDefinition2() {} + virtual void placeholderConstructionPointDefinition3() {} + virtual void placeholderConstructionPointDefinition4() {} + virtual void placeholderConstructionPointDefinition5() {} + virtual void placeholderConstructionPointDefinition6() {} + virtual void placeholderConstructionPointDefinition7() {} + virtual void placeholderConstructionPointDefinition8() {} + virtual void placeholderConstructionPointDefinition9() {} + virtual void placeholderConstructionPointDefinition10() {} + virtual void placeholderConstructionPointDefinition11() {} + virtual void placeholderConstructionPointDefinition12() {} + virtual void placeholderConstructionPointDefinition13() {} + virtual void placeholderConstructionPointDefinition14() {} + virtual void placeholderConstructionPointDefinition15() {} + virtual void placeholderConstructionPointDefinition16() {} + virtual void placeholderConstructionPointDefinition17() {} + virtual void placeholderConstructionPointDefinition18() {} + virtual void placeholderConstructionPointDefinition19() {} + virtual void placeholderConstructionPointDefinition20() {} + virtual void placeholderConstructionPointDefinition21() {} + virtual void placeholderConstructionPointDefinition22() {} + virtual void placeholderConstructionPointDefinition23() {} + virtual void placeholderConstructionPointDefinition24() {} + virtual void placeholderConstructionPointDefinition25() {} + virtual void placeholderConstructionPointDefinition26() {} + virtual void placeholderConstructionPointDefinition27() {} + virtual void placeholderConstructionPointDefinition28() {} + virtual void placeholderConstructionPointDefinition29() {} + virtual void placeholderConstructionPointDefinition30() {} +}; + +// Inline wrappers + +inline core::Ptr ConstructionPointDefinition::parentConstructionPoint() const +{ + core::Ptr res = parentConstructionPoint_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPOINTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointEdgePlaneDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointEdgePlaneDefinition.h new file mode 100644 index 0000000..f70fb83 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointEdgePlaneDefinition.h @@ -0,0 +1,81 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPointDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPOINTEDGEPLANEDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPOINTEDGEPLANEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPOINTEDGEPLANEDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPOINTEDGEPLANEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction point created using the SetbyEdgePlane method +class ConstructionPointEdgePlaneDefinition : public ConstructionPointDefinition { +public: + + /// A linear B-Rep edge, construction axis or sketch line. + core::Ptr edge() const; + + /// A plane, planar B-Rep face or construction plane. + core::Ptr plane() const; + + /// Redefines the input geometry of the construction point. + /// edge : A linear B-Rep edge, construction axis or sketch line. + /// plane : A plane, planar B-Rep face or construction plane. + /// Returns true if the redefinition of the Construction Point is successful. + bool redefine(const core::Ptr& edge, const core::Ptr& plane); + + ADSK_FUSION_CONSTRUCTIONPOINTEDGEPLANEDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPOINTEDGEPLANEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPOINTEDGEPLANEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPOINTEDGEPLANEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* edge_raw() const = 0; + virtual core::Base* plane_raw() const = 0; + virtual bool redefine_raw(core::Base* edge, core::Base* plane) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPointEdgePlaneDefinition::edge() const +{ + core::Ptr res = edge_raw(); + return res; +} + +inline core::Ptr ConstructionPointEdgePlaneDefinition::plane() const +{ + core::Ptr res = plane_raw(); + return res; +} + +inline bool ConstructionPointEdgePlaneDefinition::redefine(const core::Ptr& edge, const core::Ptr& plane) +{ + bool res = redefine_raw(edge.get(), plane.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPOINTEDGEPLANEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointInput.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointInput.h new file mode 100644 index 0000000..a9d473f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointInput.h @@ -0,0 +1,184 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPOINTINPUT_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPOINTINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPOINTINPUT_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPOINTINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// A ConstructionPointInput is a throwaway object used to create a ConstructionPoint +/// The usage pattern is +/// a. create a ConstructionPointInput (ConstructionPoints.CreateInput) +/// b. call one of the member functions to specify how the ConstructionPoint is created +/// c. create the ConstructionPoint (call ConstructionPoints.Add) +/// d. stop referencing the ConstructionPointInput (so it gets deleted). +class ConstructionPointInput : public core::Base { +public: + + /// This input method is for creating a construction point at the intersection of + /// the two linear edges or sketch lines. + /// The edges can be B-Rep edges or sketch lines. + /// This can result in a parametric or non-parametric construction point depending + /// on whether the parent component is parametric or is a direct edit component. + /// edgeOne : The first B-Rep edge or sketch line + /// edgeTwo : The second B-Rep edge or sketch line + /// Returns true if the creation of the ConstructionPointInput is successful. + bool setByTwoEdges(const core::Ptr& edgeOne, const core::Ptr& edgeTwo); + + /// This input method is for creating a construction point at the intersection of the + /// three planes or planar faces. + /// This can result in a parametric or non-parametric construction point depending + /// on whether the parent component is parametric or is a direct edit component. + /// planeOne : The first plane or planar face to intersect + /// planeTwo : The second plane or planar face to intersect + /// planeThree : The third plane or planar face to intersect + /// Returns true if the creation of the ConstructionPointInput is successful. + bool setByThreePlanes(const core::Ptr& planeOne, const core::Ptr& planeTwo, const core::Ptr& planeThree); + + /// This input method is for creating a construction point at the intersection of a + /// construction plane, planar face or sketch profile and a linear edge, construction axis + /// or sketch line. + /// This can result in a parametric or non-parametric construction point depending + /// on whether the parent component is parametric or is a direct edit component. + /// edge : A linear B-Rep edge, construction axis or sketch line. + /// plane : A plane, planar B-Rep face or construction plane. + /// Returns true if the creation of the ConstructionPointInput is successful. + bool setByEdgePlane(const core::Ptr& edge, const core::Ptr& plane); + + /// This input method is for creating a construction point at the center of a spherical + /// face (sphere or torus), circular edge or sketch arc/circle + /// This can result in a parametric or non-parametric construction point depending + /// on whether the parent component is parametric or is a direct edit component. + /// circularEntity : A spherical face (sphere or torus), circular edge or sketch arc/circle + /// Returns true if the creation of the ConstructionPointInput is successful. + bool setByCenter(const core::Ptr& circularEntity); + + /// This input method is for creating a construction point on the specified point + /// or vertex. The point can be either a B-Rep vertex, SketchPoint, or a Point3D object. + /// Providing a Point3D object is only valid when working in a direct edit model (do not capture design history). + /// This is not valid when working in a parametric model and will fail. + /// Even when providing a B-Rep vertex, or SketchPoint the result will be non-parametric + /// if the parent component is a direct edit component. + /// point : A B-Rep vertex, SketchPoint, or Point object + /// Returns true if the creation of the ConstructionPointInput is successful. + bool setByPoint(const core::Ptr& point); + + /// In order for geometry to be transformed correctly, an occurrence for creation needs + /// to be specified when the ConstructionPoint is created based on geometry + /// (e.g. a sketch point) in another component AND (the ConstructionPoint) is not in the + /// root component. The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// When creating a construction point that is owned by a base or form feature, set this property to the + /// base or form feature you want to associate the new construction point with. By default, this is null, + /// meaning it will not be associated with a base or form feature. + /// Because of a current limitation, if you want to create a construction point associated with a base + /// or form feature, you must set this property AND call the edit method of the base or form feature, + /// create the feature, and then call the finishEdit method of the base or form feature. The base or form + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseOrFormFeature() const; + bool targetBaseOrFormFeature(const core::Ptr& value); + + ADSK_FUSION_CONSTRUCTIONPOINTINPUT_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPOINTINPUT_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPOINTINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPOINTINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setByTwoEdges_raw(core::Base* edgeOne, core::Base* edgeTwo) = 0; + virtual bool setByThreePlanes_raw(core::Base* planeOne, core::Base* planeTwo, core::Base* planeThree) = 0; + virtual bool setByEdgePlane_raw(core::Base* edge, core::Base* plane) = 0; + virtual bool setByCenter_raw(core::Base* circularEntity) = 0; + virtual bool setByPoint_raw(core::Base* point) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual core::Base* targetBaseOrFormFeature_raw() const = 0; + virtual bool targetBaseOrFormFeature_raw(core::Base* value) = 0; +}; + +// Inline wrappers + +inline bool ConstructionPointInput::setByTwoEdges(const core::Ptr& edgeOne, const core::Ptr& edgeTwo) +{ + bool res = setByTwoEdges_raw(edgeOne.get(), edgeTwo.get()); + return res; +} + +inline bool ConstructionPointInput::setByThreePlanes(const core::Ptr& planeOne, const core::Ptr& planeTwo, const core::Ptr& planeThree) +{ + bool res = setByThreePlanes_raw(planeOne.get(), planeTwo.get(), planeThree.get()); + return res; +} + +inline bool ConstructionPointInput::setByEdgePlane(const core::Ptr& edge, const core::Ptr& plane) +{ + bool res = setByEdgePlane_raw(edge.get(), plane.get()); + return res; +} + +inline bool ConstructionPointInput::setByCenter(const core::Ptr& circularEntity) +{ + bool res = setByCenter_raw(circularEntity.get()); + return res; +} + +inline bool ConstructionPointInput::setByPoint(const core::Ptr& point) +{ + bool res = setByPoint_raw(point.get()); + return res; +} + +inline core::Ptr ConstructionPointInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool ConstructionPointInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline core::Ptr ConstructionPointInput::targetBaseOrFormFeature() const +{ + core::Ptr res = targetBaseOrFormFeature_raw(); + return res; +} + +inline bool ConstructionPointInput::targetBaseOrFormFeature(const core::Ptr& value) +{ + return targetBaseOrFormFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPOINTINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointPointDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointPointDefinition.h new file mode 100644 index 0000000..3423302 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointPointDefinition.h @@ -0,0 +1,69 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPointDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPOINTPOINTDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPOINTPOINTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPOINTPOINTDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPOINTPOINTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction point created using the SetbyPoint method +/// All non-parametric constructions points will return this type of definition regardless +/// of the method used to initially create them. +class ConstructionPointPointDefinition : public ConstructionPointDefinition { +public: + + /// Gets and sets the position of the point using a construction point, sketch point or + /// vertex. + /// Non-parametric points will always return a Point3D object + core::Ptr pointEntity() const; + bool pointEntity(const core::Ptr& value); + + ADSK_FUSION_CONSTRUCTIONPOINTPOINTDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPOINTPOINTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPOINTPOINTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPOINTPOINTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* pointEntity_raw() const = 0; + virtual bool pointEntity_raw(core::Base* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPointPointDefinition::pointEntity() const +{ + core::Ptr res = pointEntity_raw(); + return res; +} + +inline bool ConstructionPointPointDefinition::pointEntity(const core::Ptr& value) +{ + return pointEntity_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPOINTPOINTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointThreePlanesDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointThreePlanesDefinition.h new file mode 100644 index 0000000..b174879 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointThreePlanesDefinition.h @@ -0,0 +1,92 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPointDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPOINTTHREEPLANESDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPOINTTHREEPLANESDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPOINTTHREEPLANESDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPOINTTHREEPLANESDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction point created using the SetbyThreePlanes method +class ConstructionPointThreePlanesDefinition : public ConstructionPointDefinition { +public: + + /// The first plane or planar face + core::Ptr planeOne() const; + + /// The second plane or planar face + core::Ptr planeTwo() const; + + /// The third plane or planar face + core::Ptr planeThree() const; + + /// Redefines the input geometry of the construction point. + /// planeOne : The first plane or planar face to intersect + /// planeTwo : The second plane or planar face to intersect + /// planeThree : The third plane or planar face to intersect + /// Returns true if the redefinition of the Construction Point is successful. + bool redefine(const core::Ptr& planeOne, const core::Ptr& planeTwo, const core::Ptr& planeThree); + + ADSK_FUSION_CONSTRUCTIONPOINTTHREEPLANESDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPOINTTHREEPLANESDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPOINTTHREEPLANESDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPOINTTHREEPLANESDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* planeOne_raw() const = 0; + virtual core::Base* planeTwo_raw() const = 0; + virtual core::Base* planeThree_raw() const = 0; + virtual bool redefine_raw(core::Base* planeOne, core::Base* planeTwo, core::Base* planeThree) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPointThreePlanesDefinition::planeOne() const +{ + core::Ptr res = planeOne_raw(); + return res; +} + +inline core::Ptr ConstructionPointThreePlanesDefinition::planeTwo() const +{ + core::Ptr res = planeTwo_raw(); + return res; +} + +inline core::Ptr ConstructionPointThreePlanesDefinition::planeThree() const +{ + core::Ptr res = planeThree_raw(); + return res; +} + +inline bool ConstructionPointThreePlanesDefinition::redefine(const core::Ptr& planeOne, const core::Ptr& planeTwo, const core::Ptr& planeThree) +{ + bool res = redefine_raw(planeOne.get(), planeTwo.get(), planeThree.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPOINTTHREEPLANESDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointTwoEdgesDefinition.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointTwoEdgesDefinition.h new file mode 100644 index 0000000..02e4a18 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPointTwoEdgesDefinition.h @@ -0,0 +1,81 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ConstructionPointDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPOINTTWOEDGESDEFINITION_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPOINTTWOEDGESDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPOINTTWOEDGESDEFINITION_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPOINTTWOEDGESDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The definition for a parametric construction point created using the SetbyTwoEdges method +class ConstructionPointTwoEdgesDefinition : public ConstructionPointDefinition { +public: + + /// Returns a B-Rep edge or sketch line + core::Ptr edgeOne() const; + + /// Returns a B-Rep edge or sketch line + core::Ptr edgeTwo() const; + + /// Redefines the input geometry of the construction point. + /// edgeOne : The first B-Rep edge or sketch line + /// edgeTwo : The second B-Rep edge or sketch line + /// Returns true if the redefinition of the Construction Point is successful. + bool redefine(const core::Ptr& edgeOne, const core::Ptr& edgeTwo); + + ADSK_FUSION_CONSTRUCTIONPOINTTWOEDGESDEFINITION_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPOINTTWOEDGESDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPOINTTWOEDGESDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPOINTTWOEDGESDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* edgeOne_raw() const = 0; + virtual core::Base* edgeTwo_raw() const = 0; + virtual bool redefine_raw(core::Base* edgeOne, core::Base* edgeTwo) = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPointTwoEdgesDefinition::edgeOne() const +{ + core::Ptr res = edgeOne_raw(); + return res; +} + +inline core::Ptr ConstructionPointTwoEdgesDefinition::edgeTwo() const +{ + core::Ptr res = edgeTwo_raw(); + return res; +} + +inline bool ConstructionPointTwoEdgesDefinition::redefine(const core::Ptr& edgeOne, const core::Ptr& edgeTwo) +{ + bool res = redefine_raw(edgeOne.get(), edgeTwo.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPOINTTWOEDGESDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPoints.h b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPoints.h new file mode 100644 index 0000000..37ebec4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Construction/ConstructionPoints.h @@ -0,0 +1,144 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTRUCTIONPOINTS_CPP__ +# define ADSK_FUSION_CONSTRUCTIONPOINTS_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTRUCTIONPOINTS_API +# endif +#else +# define ADSK_FUSION_CONSTRUCTIONPOINTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class ConstructionPoint; + class ConstructionPointInput; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the construction points within a component and provides +/// methods to create new construction points. +class ConstructionPoints : public core::Base { +public: + + /// Function that returns the specified construction point using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the specified construction point using the name of the construction + /// point as it is displayed in the browser. + /// name : The name of the construction point as it is displayed in the browser. + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// The number of construction points in the collection. + size_t count() const; + + /// Create a ConstructionPointInput object that is in turn used + /// to create a ConstructionPoint. + /// occurrenceForCreation : A creation occurrence is needed if the input is in another component AND the + /// construction point is not in the root component. The occurrenceForCreation is analogous + /// to the active occurrence in the UI. + /// Returns a ConstructionPointInput object + core::Ptr createInput(const core::Ptr& occurrenceForCreation = NULL) const; + + /// Creates a new construction point. + /// If the ConstructionPointInput was defined using the setByPoint method using a Point3D object then + /// the add will only work in a direct edit model (do not capture design history) and will fail in a parametric model. + /// input : A ConstructionPointInput object + /// Returns the newly created construction point or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// The component that owns this collection. + core::Ptr component() const; + + typedef ConstructionPoint iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_CONSTRUCTIONPOINTS_API static const char* classType(); + ADSK_FUSION_CONSTRUCTIONPOINTS_API const char* objectType() const override; + ADSK_FUSION_CONSTRUCTIONPOINTS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTRUCTIONPOINTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ConstructionPoint* item_raw(size_t index) const = 0; + virtual ConstructionPoint* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual ConstructionPointInput* createInput_raw(Occurrence* occurrenceForCreation) const = 0; + virtual ConstructionPoint* add_raw(ConstructionPointInput* input) = 0; + virtual Component* component_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstructionPoints::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr ConstructionPoints::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t ConstructionPoints::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ConstructionPoints::createInput(const core::Ptr& occurrenceForCreation) const +{ + core::Ptr res = createInput_raw(occurrenceForCreation.get()); + return res; +} + +inline core::Ptr ConstructionPoints::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ConstructionPoints::component() const +{ + core::Ptr res = component_raw(); + return res; +} + +template inline void ConstructionPoints::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTRUCTIONPOINTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/AllExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/AllExtentDefinition.h new file mode 100644 index 0000000..0677bcd --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/AllExtentDefinition.h @@ -0,0 +1,69 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_ALLEXTENTDEFINITION_CPP__ +# define ADSK_FUSION_ALLEXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_ALLEXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_ALLEXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines the inputs for a AllExtentDefinition object. +/// This defines a feature extent where the direction can be positive, negative, or symmetric. +/// Setting the direction to Symmetric specifies that the extrusion is through-all, +/// and goes in both directions. +class AllExtentDefinition : public ExtentDefinition { +public: + + /// Gets and sets the direction of the extent. + ExtentDirections direction() const; + bool direction(ExtentDirections value); + + ADSK_FUSION_ALLEXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_ALLEXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_ALLEXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_ALLEXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ExtentDirections direction_raw() const = 0; + virtual bool direction_raw(ExtentDirections value) = 0; +}; + +// Inline wrappers + +inline ExtentDirections AllExtentDefinition::direction() const +{ + ExtentDirections res = direction_raw(); + return res; +} + +inline bool AllExtentDefinition::direction(ExtentDirections value) +{ + return direction_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_ALLEXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/AngleExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/AngleExtentDefinition.h new file mode 100644 index 0000000..f029cdf --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/AngleExtentDefinition.h @@ -0,0 +1,83 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_ANGLEEXTENTDEFINITION_CPP__ +# define ADSK_FUSION_ANGLEEXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_ANGLEEXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_ANGLEEXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} + +namespace adsk { namespace fusion { + +/// Defines the inputs for a AngleExtentDefinition object. +/// This feature extent is defined by an angle as well as whether the extent is symmetric or only in one direction. +/// If the extent is not symmetric, a positive or negative angle can be used to control the direction. +class AngleExtentDefinition : public ExtentDefinition { +public: + + /// Gets and sets if the angle extent is in one direction or symmetric. + /// For a hole this property will always return false and setting it is ignored. + bool isSymmetric() const; + bool isSymmetric(bool value); + + /// Gets the ModelParameter that defines the angle. The value of the angle can be edited + /// by using the properties on the ModelParameter object to edit the parameter. + core::Ptr angle() const; + + ADSK_FUSION_ANGLEEXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_ANGLEEXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_ANGLEEXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_ANGLEEXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isSymmetric_raw() const = 0; + virtual bool isSymmetric_raw(bool value) = 0; + virtual ModelParameter* angle_raw() const = 0; +}; + +// Inline wrappers + +inline bool AngleExtentDefinition::isSymmetric() const +{ + bool res = isSymmetric_raw(); + return res; +} + +inline bool AngleExtentDefinition::isSymmetric(bool value) +{ + return isSymmetric_raw(value); +} + +inline core::Ptr AngleExtentDefinition::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_ANGLEEXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/AtCenterHolePositionDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/AtCenterHolePositionDefinition.h new file mode 100644 index 0000000..7b9d0c9 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/AtCenterHolePositionDefinition.h @@ -0,0 +1,73 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "HolePositionDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_ATCENTERHOLEPOSITIONDEFINITION_CPP__ +# define ADSK_FUSION_ATCENTERHOLEPOSITIONDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_ATCENTERHOLEPOSITIONDEFINITION_API +# endif +#else +# define ADSK_FUSION_ATCENTERHOLEPOSITIONDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepEdge; +}} + +namespace adsk { namespace fusion { + +/// Provides positioning information for a hole that is positioned at the center of a +/// circular or elliptical edge. +class AtCenterHolePositionDefinition : public HolePositionDefinition { +public: + + /// Returns the plane that defines the orientation and start of the hole. + core::Ptr planarEntity() const; + + /// Returns the circular or elliptical edge the hole is centered at. + core::Ptr centerEdge() const; + + ADSK_FUSION_ATCENTERHOLEPOSITIONDEFINITION_API static const char* classType(); + ADSK_FUSION_ATCENTERHOLEPOSITIONDEFINITION_API const char* objectType() const override; + ADSK_FUSION_ATCENTERHOLEPOSITIONDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_ATCENTERHOLEPOSITIONDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* planarEntity_raw() const = 0; + virtual BRepEdge* centerEdge_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr AtCenterHolePositionDefinition::planarEntity() const +{ + core::Ptr res = planarEntity_raw(); + return res; +} + +inline core::Ptr AtCenterHolePositionDefinition::centerEdge() const +{ + core::Ptr res = centerEdge_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_ATCENTERHOLEPOSITIONDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/BRepCell.h b/usr/autodesk/CPP/include/Fusion/Features/BRepCell.h new file mode 100644 index 0000000..0e6c79e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/BRepCell.h @@ -0,0 +1,94 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPCELL_CPP__ +# define ADSK_FUSION_BREPCELL_API XI_EXPORT +# else +# define ADSK_FUSION_BREPCELL_API +# endif +#else +# define ADSK_FUSION_BREPCELL_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing BRepCell. +class BRepCell : public core::Base { +public: + + /// Gets and sets whether the cell is selected. For a Trim feature a selected cell is removed, + /// whereas for a boundary fill feature, a selected cell is kept and used in the feature operation. + bool isSelected() const; + bool isSelected(bool value); + + /// Returns the tools that we're using in the definition of this cell. + core::Ptr sourceTools() const; + + /// Returns a BRepBody that represents this cell. This is a transient B-Rep body. + core::Ptr cellBody() const; + + ADSK_FUSION_BREPCELL_API static const char* classType(); + ADSK_FUSION_BREPCELL_API const char* objectType() const override; + ADSK_FUSION_BREPCELL_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPCELL_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isSelected_raw() const = 0; + virtual bool isSelected_raw(bool value) = 0; + virtual core::ObjectCollection* sourceTools_raw() const = 0; + virtual BRepBody* cellBody_raw() const = 0; +}; + +// Inline wrappers + +inline bool BRepCell::isSelected() const +{ + bool res = isSelected_raw(); + return res; +} + +inline bool BRepCell::isSelected(bool value) +{ + return isSelected_raw(value); +} + +inline core::Ptr BRepCell::sourceTools() const +{ + core::Ptr res = sourceTools_raw(); + return res; +} + +inline core::Ptr BRepCell::cellBody() const +{ + core::Ptr res = cellBody_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPCELL_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/BRepCells.h b/usr/autodesk/CPP/include/Fusion/Features/BRepCells.h new file mode 100644 index 0000000..f45cc11 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/BRepCells.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BREPCELLS_CPP__ +# define ADSK_FUSION_BREPCELLS_API XI_EXPORT +# else +# define ADSK_FUSION_BREPCELLS_API +# endif +#else +# define ADSK_FUSION_BREPCELLS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepCell; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing BRepCells defined by a BoundaryFillFeatureInput +class BRepCells : public core::Base { +public: + + /// Function that returns the specified BRepCell using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of BRepCells in the collection. + size_t count() const; + + typedef BRepCell iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BREPCELLS_API static const char* classType(); + ADSK_FUSION_BREPCELLS_API const char* objectType() const override; + ADSK_FUSION_BREPCELLS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BREPCELLS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepCell* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BRepCells::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BRepCells::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void BRepCells::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BREPCELLS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/BaseFeature.h b/usr/autodesk/CPP/include/Fusion/Features/BaseFeature.h new file mode 100644 index 0000000..a876b0a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/BaseFeature.h @@ -0,0 +1,214 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BASEFEATURE_CPP__ +# define ADSK_FUSION_BASEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_BASEFEATURE_API +# endif +#else +# define ADSK_FUSION_BASEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class ConstructionAxis; + class ConstructionPlane; + class ConstructionPoint; + class MeshBody; + class Occurrence; + class Sketch; +}} + +namespace adsk { namespace fusion { + +/// The BaseFeature class represents a direct edit feature within a parametric design. +class BaseFeature : public Feature { +public: + + /// Returns an array of the construction planes associated with this base feature. + std::vector> constructionPlanes() const; + + /// Returns an array of the construction axes associated with this base feature. + std::vector> constructionAxes() const; + + /// Returns an array of the construction points associated with this base feature. + std::vector> constructionPoints() const; + + /// Returns an array of the sketches associated with this base feature. + std::vector> sketches() const; + + /// Returns an array of the mesh bodies associated with this base feature. + std::vector> meshBodies() const; + + /// Set the user-interface so that the base body is in edit mode. + /// Returns true if successful. + bool startEdit(); + + /// Exits from edit mode in the user-interface. If this base feature in not + /// in edit mode, then nothing happens. + /// Returns true if successful. + bool finishEdit(); + + /// Update an existing source BRepBody created by this BaseFeature. + /// The input BRepBody definition will be copied into the existing BRepBody. + /// sourceBody : The source BRepBody to update. The source bodies of a BaseFeature are only available + /// from the bodies collection of the BaseFeature when the BaseFeature is in edit mode. + /// newBody : The BRepBody whose definition will be used to replace the existing source body's definition. + /// Returns true if the body was updated, or false if the update failed. + bool updateBody(const core::Ptr& sourceBody, const core::Ptr& newBody); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_BASEFEATURE_API static const char* classType(); + ADSK_FUSION_BASEFEATURE_API const char* objectType() const override; + ADSK_FUSION_BASEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BASEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ConstructionPlane** constructionPlanes_raw(size_t& return_size) const = 0; + virtual ConstructionAxis** constructionAxes_raw(size_t& return_size) const = 0; + virtual ConstructionPoint** constructionPoints_raw(size_t& return_size) const = 0; + virtual Sketch** sketches_raw(size_t& return_size) const = 0; + virtual MeshBody** meshBodies_raw(size_t& return_size) const = 0; + virtual bool startEdit_raw() = 0; + virtual bool finishEdit_raw() = 0; + virtual bool updateBody_raw(BRepBody* sourceBody, BRepBody* newBody) = 0; + virtual BaseFeature* nativeObject_raw() const = 0; + virtual BaseFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline std::vector> BaseFeature::constructionPlanes() const +{ + std::vector> res; + size_t s; + + ConstructionPlane** p= constructionPlanes_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> BaseFeature::constructionAxes() const +{ + std::vector> res; + size_t s; + + ConstructionAxis** p= constructionAxes_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> BaseFeature::constructionPoints() const +{ + std::vector> res; + size_t s; + + ConstructionPoint** p= constructionPoints_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> BaseFeature::sketches() const +{ + std::vector> res; + size_t s; + + Sketch** p= sketches_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> BaseFeature::meshBodies() const +{ + std::vector> res; + size_t s; + + MeshBody** p= meshBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool BaseFeature::startEdit() +{ + bool res = startEdit_raw(); + return res; +} + +inline bool BaseFeature::finishEdit() +{ + bool res = finishEdit_raw(); + return res; +} + +inline bool BaseFeature::updateBody(const core::Ptr& sourceBody, const core::Ptr& newBody) +{ + bool res = updateBody_raw(sourceBody.get(), newBody.get()); + return res; +} + +inline core::Ptr BaseFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BaseFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BASEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/BaseFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/BaseFeatures.h new file mode 100644 index 0000000..e23491c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/BaseFeatures.h @@ -0,0 +1,111 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BASEFEATURES_CPP__ +# define ADSK_FUSION_BASEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_BASEFEATURES_API +# endif +#else +# define ADSK_FUSION_BASEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} + +namespace adsk { namespace fusion { + +/// The BaseFeature class represents a direct edit feature within a parametric design. +class BaseFeatures : public core::Base { +public: + + /// Function that returns the specified base feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified base feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of base features in the collection. + size_t count() const; + + /// Creates a new empty base feature in the parent component. + /// Returns the new BaseFeature or null in the case of an error. + core::Ptr add(); + + typedef BaseFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BASEFEATURES_API static const char* classType(); + ADSK_FUSION_BASEFEATURES_API const char* objectType() const override; + ADSK_FUSION_BASEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BASEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BaseFeature* item_raw(size_t index) const = 0; + virtual BaseFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual BaseFeature* add_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr BaseFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr BaseFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t BaseFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr BaseFeatures::add() +{ + core::Ptr res = add_raw(); + return res; +} + +template inline void BaseFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BASEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/BoundaryFillFeature.h b/usr/autodesk/CPP/include/Fusion/Features/BoundaryFillFeature.h new file mode 100644 index 0000000..1240ca5 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/BoundaryFillFeature.h @@ -0,0 +1,149 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BOUNDARYFILLFEATURE_CPP__ +# define ADSK_FUSION_BOUNDARYFILLFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_BOUNDARYFILLFEATURE_API +# endif +#else +# define ADSK_FUSION_BOUNDARYFILLFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepCells; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing boundary fill feature in a design. +class BoundaryFillFeature : public Feature { +public: + + /// A collection of construction planes and open or closed BRepBody objects that define the + /// set of boundaries that have been used in the calculation of available closed boundaries. + /// Setting this property will clear all currently selected tools. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr tools() const; + bool tools(const core::Ptr& value); + + /// Gets the set of closed boundaries that have been calculated based on the current set of + /// tools. To get this collection the model must be in the state it was when the feature + /// was initially computed, which means the timeline marker must be positioned to immediately + /// before this feature. + /// After changing any selected cells you must call the applyCellChanges method to update + /// the feature with the changes. + core::Ptr bRepCells() const; + + /// Gets and sets the type of operation performed by the boundary fill feature. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// After making any changes to the set of selected cells you must call this method to + /// indicate all changes have been made and to apply those changes to the feature. + /// Returns true if the apply was successful. + bool applyCellChanges(); + + ADSK_FUSION_BOUNDARYFILLFEATURE_API static const char* classType(); + ADSK_FUSION_BOUNDARYFILLFEATURE_API const char* objectType() const override; + ADSK_FUSION_BOUNDARYFILLFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BOUNDARYFILLFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* tools_raw() const = 0; + virtual bool tools_raw(core::ObjectCollection* value) = 0; + virtual BRepCells* bRepCells_raw() const = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual BoundaryFillFeature* nativeObject_raw() const = 0; + virtual BoundaryFillFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual bool applyCellChanges_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr BoundaryFillFeature::tools() const +{ + core::Ptr res = tools_raw(); + return res; +} + +inline bool BoundaryFillFeature::tools(const core::Ptr& value) +{ + return tools_raw(value.get()); +} + +inline core::Ptr BoundaryFillFeature::bRepCells() const +{ + core::Ptr res = bRepCells_raw(); + return res; +} + +inline FeatureOperations BoundaryFillFeature::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool BoundaryFillFeature::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr BoundaryFillFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr BoundaryFillFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline bool BoundaryFillFeature::applyCellChanges() +{ + bool res = applyCellChanges_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BOUNDARYFILLFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/BoundaryFillFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/BoundaryFillFeatureInput.h new file mode 100644 index 0000000..323554c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/BoundaryFillFeatureInput.h @@ -0,0 +1,163 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BOUNDARYFILLFEATUREINPUT_CPP__ +# define ADSK_FUSION_BOUNDARYFILLFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_BOUNDARYFILLFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_BOUNDARYFILLFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepCells; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a BoundaryFillFeatureInput. +class BoundaryFillFeatureInput : public core::Base { +public: + + /// Returns the collection of the valid cells that have been calculated based on the set of input tools. + /// You use this collection to specify which cells you want included in the output. + core::Ptr bRepCells() const; + + /// Gets and sets the type of operation performed by the boundary fill feature. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs to be + /// specified when the Boundary Fill is created based on geometry (e.g. a profile and/or face(s)) + /// in another component AND (the Boundary Fill) is not in the root component. + /// The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// Gets and sets the collection of one or more construction planes and open or closed + /// BRepBody objects that are used in calculating the possible closed boundaries. + core::Ptr tools() const; + bool tools(const core::Ptr& value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// To determine the possible boundaries and allow you to choose which cells to keep, the boundary + /// fill feature does a partial compute when the input object is created. To do this it starts a boundary + /// fill feature transaction and completes the transaction when you call the add method. If you don't + /// call the add method to finish the transaction it leaves Fusion 360 in a bad state and there will be undo + /// problems and possibly a crash. If you have created a BoundFillFeatureInput object and don't want to finish + /// the feature creation, you need to call the cancel method on the BoundaryFillFeatureInput object to + /// safely abort the current boundary fill transaction. + bool cancel(); + + ADSK_FUSION_BOUNDARYFILLFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_BOUNDARYFILLFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_BOUNDARYFILLFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BOUNDARYFILLFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepCells* bRepCells_raw() const = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual core::ObjectCollection* tools_raw() const = 0; + virtual bool tools_raw(core::ObjectCollection* value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual bool cancel_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr BoundaryFillFeatureInput::bRepCells() const +{ + core::Ptr res = bRepCells_raw(); + return res; +} + +inline FeatureOperations BoundaryFillFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool BoundaryFillFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr BoundaryFillFeatureInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool BoundaryFillFeatureInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline core::Ptr BoundaryFillFeatureInput::tools() const +{ + core::Ptr res = tools_raw(); + return res; +} + +inline bool BoundaryFillFeatureInput::tools(const core::Ptr& value) +{ + return tools_raw(value.get()); +} + +inline core::Ptr BoundaryFillFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool BoundaryFillFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline bool BoundaryFillFeatureInput::cancel() +{ + bool res = cancel_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BOUNDARYFILLFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/BoundaryFillFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/BoundaryFillFeatures.h new file mode 100644 index 0000000..f9df2cc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/BoundaryFillFeatures.h @@ -0,0 +1,142 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BOUNDARYFILLFEATURES_CPP__ +# define ADSK_FUSION_BOUNDARYFILLFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_BOUNDARYFILLFEATURES_API +# endif +#else +# define ADSK_FUSION_BOUNDARYFILLFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BoundaryFillFeature; + class BoundaryFillFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing boundary fill features in a component +/// and supports the ability to create new boundary fill features. +class BoundaryFillFeatures : public core::Base { +public: + + /// Function that returns the specified boundary fill feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of boundary fill features in the collection. + size_t count() const; + + /// Creates a BoundaryFillFeatureInput object. Use properties and methods on this object + /// to define the boundary fill you want to create and then use the Add method, passing in + /// the BoundaryFillFeatureInput object. + /// To determine the possible boundaries and allow you to choose which cells to keep, the boundary + /// fill feature does a partial compute when the input object is created. To do this it starts a boundary + /// fill feature transaction and completes the transaction when you call the add method. If you don't + /// call the add method to finish the transaction it leaves Fusion 360 in a bad state and there will be undo + /// problems and possibly a crash. If you have created a BoundFillFeatureInput object and don't want to finish + /// the feature creation, you need to call the cancel method on the BoundaryFillFeatureInput object to + /// safely abort the current boundary fill transaction. + /// tools : A collection of one or more construction planes and open or closed BRepBody objects that will be + /// used in calculating the possible closed boundaries. + /// operation : The operation type to perform. + /// Returns the newly created BoundaryFillFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& tools, FeatureOperations operation) const; + + /// Creates a new boundary fill feature. + /// input : A BoundaryFillFeatureInput object that defines the desired boundary fill feature. Use the createInput + /// method to create a new BoundaryFillFeatureInput object and then use methods on it + /// (the BoundaryFillFeatureInput object) to define the boundary fill feature. + /// Returns the newly created BoundaryFillFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified boundary fill feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef BoundaryFillFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BOUNDARYFILLFEATURES_API static const char* classType(); + ADSK_FUSION_BOUNDARYFILLFEATURES_API const char* objectType() const override; + ADSK_FUSION_BOUNDARYFILLFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BOUNDARYFILLFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BoundaryFillFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual BoundaryFillFeatureInput* createInput_raw(core::ObjectCollection* tools, FeatureOperations operation) const = 0; + virtual BoundaryFillFeature* add_raw(BoundaryFillFeatureInput* input) = 0; + virtual BoundaryFillFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr BoundaryFillFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t BoundaryFillFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr BoundaryFillFeatures::createInput(const core::Ptr& tools, FeatureOperations operation) const +{ + core::Ptr res = createInput_raw(tools.get(), operation); + return res; +} + +inline core::Ptr BoundaryFillFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr BoundaryFillFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void BoundaryFillFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BOUNDARYFILLFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/BoxFeature.h b/usr/autodesk/CPP/include/Fusion/Features/BoxFeature.h new file mode 100644 index 0000000..4a1e630 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/BoxFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BOXFEATURE_CPP__ +# define ADSK_FUSION_BOXFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_BOXFEATURE_API +# endif +#else +# define ADSK_FUSION_BOXFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing box feature in a design. +class BoxFeature : public Feature { +public: + + ADSK_FUSION_BOXFEATURE_API static const char* classType(); + ADSK_FUSION_BOXFEATURE_API const char* objectType() const override; + ADSK_FUSION_BOXFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BOXFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BOXFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/BoxFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/BoxFeatures.h new file mode 100644 index 0000000..db70335 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/BoxFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BOXFEATURES_CPP__ +# define ADSK_FUSION_BOXFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_BOXFEATURES_API +# endif +#else +# define ADSK_FUSION_BOXFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BoxFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing box features in a design. +class BoxFeatures : public core::Base { +public: + + /// Function that returns the specified box feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified box feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of box features in the collection. + size_t count() const; + + typedef BoxFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_BOXFEATURES_API static const char* classType(); + ADSK_FUSION_BOXFEATURES_API const char* objectType() const override; + ADSK_FUSION_BOXFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BOXFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BoxFeature* item_raw(size_t index) const = 0; + virtual BoxFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr BoxFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr BoxFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t BoxFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void BoxFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BOXFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ChamferEdgeSet.h b/usr/autodesk/CPP/include/Fusion/Features/ChamferEdgeSet.h new file mode 100644 index 0000000..68da2dc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ChamferEdgeSet.h @@ -0,0 +1,108 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CHAMFEREDGESET_CPP__ +# define ADSK_FUSION_CHAMFEREDGESET_API XI_EXPORT +# else +# define ADSK_FUSION_CHAMFEREDGESET_API +# endif +#else +# define ADSK_FUSION_CHAMFEREDGESET_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The base class for the classes that define the different types of chamfer edge sets. +class ChamferEdgeSet : public core::Base { +public: + + /// Deletes the chamfer edge set from the chamfer. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// Returns true if the operation was successful. + bool deleteMe(); + + /// Gets and sets the Tangent chain for chamfer. This enables tangent chain option for chamfer. + bool isTangentChain() const; + bool isTangentChain(bool value); + + ADSK_FUSION_CHAMFEREDGESET_API static const char* classType(); + ADSK_FUSION_CHAMFEREDGESET_API const char* objectType() const override; + ADSK_FUSION_CHAMFEREDGESET_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CHAMFEREDGESET_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool deleteMe_raw() = 0; + virtual bool isTangentChain_raw() const = 0; + virtual bool isTangentChain_raw(bool value) = 0; + virtual void placeholderChamferEdgeSet0() {} + virtual void placeholderChamferEdgeSet1() {} + virtual void placeholderChamferEdgeSet2() {} + virtual void placeholderChamferEdgeSet3() {} + virtual void placeholderChamferEdgeSet4() {} + virtual void placeholderChamferEdgeSet5() {} + virtual void placeholderChamferEdgeSet6() {} + virtual void placeholderChamferEdgeSet7() {} + virtual void placeholderChamferEdgeSet8() {} + virtual void placeholderChamferEdgeSet9() {} + virtual void placeholderChamferEdgeSet10() {} + virtual void placeholderChamferEdgeSet11() {} + virtual void placeholderChamferEdgeSet12() {} + virtual void placeholderChamferEdgeSet13() {} + virtual void placeholderChamferEdgeSet14() {} + virtual void placeholderChamferEdgeSet15() {} + virtual void placeholderChamferEdgeSet16() {} + virtual void placeholderChamferEdgeSet17() {} + virtual void placeholderChamferEdgeSet18() {} + virtual void placeholderChamferEdgeSet19() {} + virtual void placeholderChamferEdgeSet20() {} + virtual void placeholderChamferEdgeSet21() {} + virtual void placeholderChamferEdgeSet22() {} + virtual void placeholderChamferEdgeSet23() {} + virtual void placeholderChamferEdgeSet24() {} + virtual void placeholderChamferEdgeSet25() {} + virtual void placeholderChamferEdgeSet26() {} + virtual void placeholderChamferEdgeSet27() {} + virtual void placeholderChamferEdgeSet28() {} +}; + +// Inline wrappers + +inline bool ChamferEdgeSet::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline bool ChamferEdgeSet::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline bool ChamferEdgeSet::isTangentChain(bool value) +{ + return isTangentChain_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CHAMFEREDGESET_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ChamferEdgeSets.h b/usr/autodesk/CPP/include/Fusion/Features/ChamferEdgeSets.h new file mode 100644 index 0000000..5c0cf43 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ChamferEdgeSets.h @@ -0,0 +1,170 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CHAMFEREDGESETS_CPP__ +# define ADSK_FUSION_CHAMFEREDGESETS_API XI_EXPORT +# else +# define ADSK_FUSION_CHAMFEREDGESETS_API +# endif +#else +# define ADSK_FUSION_CHAMFEREDGESETS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ChamferEdgeSet; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing chamfer edge sets associated with a chamfer feature. +class ChamferEdgeSets : public core::Base { +public: + + /// Function that returns the specified chamfer edge set using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of chamfer edge sets in the collection. + size_t count() const; + + /// Adds a set of edges an equal distance offset to this chamfer feature. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// edges : An ObjectCollection containing the edges to be chamfered. Edges can be defined by passing in BrepEdge, + /// BRepFace, or Feature objects. If BRepFace or Feature objects are passed in all of the edges associated + /// with those objects will be chamfered. If BRepEdge objects are provided and the isTangentChain argument is true + /// additional edges may also get chamfered if they are tangentially connected to any of the input edges. + /// distance : A ValueInput object that defines the distance offset of the chamfer. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "2 in") or if no units are specified + /// it is interpreted using the current default units for length. + /// isTangentChain : A boolean value for setting whether or not edges that are tangentially connected to + /// the input edges (if any) will also be chamfered. + /// Returns true if the set of edges was successfully added to the ChamferFeatureInput. + bool addEqualDistanceChamferEdgeSet(const core::Ptr& edges, const core::Ptr& distance, bool isTangentChain); + + /// Adds a set of edges an equal distance offset to this chamfer feature. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// edges : An ObjectCollection containing the edges to be chamfered. Edges can be defined by passing in BrepEdge, + /// BRepFace, or Feature objects. If BRepFace or Feature objects are passed in all of the edges associated + /// with those objects will be chamfered. If BRepEdge objects are provided and the isTangentChain argument is true + /// additional edges may also get chamfered if they are tangentially connected to any of the input edges. + /// distanceOne : A ValueInput object that defines the first distance offset of the chamfer. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "2 in") or if no units are specified + /// it is interpreted using the current default units for length. + /// distanceTwo : A ValueInput object that defines the second distance offset of the chamfer. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "2 in") or if no units are specified + /// it is interpreted using the current default units for length. + /// isFlipped : Swaps the directions for distance one and two. + /// isTangentChain : A boolean value for setting whether or not edges that are tangentially connected to + /// the input edges (if any) will also be chamfered. + /// Returns true if the set of edges was successfully added to the ChamferFeatureInput. + bool addTwoDistancesChamferEdgeSet(const core::Ptr& edges, const core::Ptr& distanceOne, const core::Ptr& distanceTwo, bool isFlipped, bool isTangentChain); + + /// Adds a set of edges an equal distance offset to this chamfer feature. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// edges : An ObjectCollection containing the edges to be chamfered. Edges can be defined by passing in BrepEdge, + /// BRepFace, or Feature objects. If BRepFace or Feature objects are passed in all of the edges associated + /// with those objects will be chamfered. If BRepEdge objects are provided and the isTangentChain argument is true + /// additional edges may also get chamfered if they are tangentially connected to any of the input edges. + /// distance : A ValueInput object that defines the distance offset of the chamfer. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "2 in") or if no units are specified + /// it is interpreted using the current default units for length. + /// angle : A ValueInput object that defines the angle of the chamfer. If the ValueInput uses + /// a real then it is interpreted as radians. If it is a string then the units + /// can be defined as part of the string (i.e. "2 rad") or if no units are specified + /// it is interpreted as degrees. + /// isFlipped : Swaps the directions for distance one and two. + /// isTangentChain : A boolean value for setting whether or not edges that are tangentially connected to + /// the input edges (if any) will also be chamfered. + /// Returns true if the set of edges was successfully added to the ChamferFeatureInput. + bool addDistanceAndAngleChamferEdgeSet(const core::Ptr& edges, const core::Ptr& distance, const core::Ptr& angle, bool isFlipped, bool isTangentChain); + + typedef ChamferEdgeSet iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_CHAMFEREDGESETS_API static const char* classType(); + ADSK_FUSION_CHAMFEREDGESETS_API const char* objectType() const override; + ADSK_FUSION_CHAMFEREDGESETS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CHAMFEREDGESETS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ChamferEdgeSet* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual bool addEqualDistanceChamferEdgeSet_raw(core::ObjectCollection* edges, core::ValueInput* distance, bool isTangentChain) = 0; + virtual bool addTwoDistancesChamferEdgeSet_raw(core::ObjectCollection* edges, core::ValueInput* distanceOne, core::ValueInput* distanceTwo, bool isFlipped, bool isTangentChain) = 0; + virtual bool addDistanceAndAngleChamferEdgeSet_raw(core::ObjectCollection* edges, core::ValueInput* distance, core::ValueInput* angle, bool isFlipped, bool isTangentChain) = 0; +}; + +// Inline wrappers + +inline core::Ptr ChamferEdgeSets::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ChamferEdgeSets::count() const +{ + size_t res = count_raw(); + return res; +} + +inline bool ChamferEdgeSets::addEqualDistanceChamferEdgeSet(const core::Ptr& edges, const core::Ptr& distance, bool isTangentChain) +{ + bool res = addEqualDistanceChamferEdgeSet_raw(edges.get(), distance.get(), isTangentChain); + return res; +} + +inline bool ChamferEdgeSets::addTwoDistancesChamferEdgeSet(const core::Ptr& edges, const core::Ptr& distanceOne, const core::Ptr& distanceTwo, bool isFlipped, bool isTangentChain) +{ + bool res = addTwoDistancesChamferEdgeSet_raw(edges.get(), distanceOne.get(), distanceTwo.get(), isFlipped, isTangentChain); + return res; +} + +inline bool ChamferEdgeSets::addDistanceAndAngleChamferEdgeSet(const core::Ptr& edges, const core::Ptr& distance, const core::Ptr& angle, bool isFlipped, bool isTangentChain) +{ + bool res = addDistanceAndAngleChamferEdgeSet_raw(edges.get(), distance.get(), angle.get(), isFlipped, isTangentChain); + return res; +} + +template inline void ChamferEdgeSets::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CHAMFEREDGESETS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ChamferFeature.h b/usr/autodesk/CPP/include/Fusion/Features/ChamferFeature.h new file mode 100644 index 0000000..b5fddf0 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ChamferFeature.h @@ -0,0 +1,241 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CHAMFERFEATURE_CPP__ +# define ADSK_FUSION_CHAMFERFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_CHAMFERFEATURE_API +# endif +#else +# define ADSK_FUSION_CHAMFERFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ChamferEdgeSets; + class ChamferTypeDefinition; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing chamfer feature in a design. +class ChamferFeature : public Feature { +public: + + /// Gets and sets the edges being chamfered. Specific edges can be defined using one or more BRepEdge + /// objects or BRepFace objects can be used to chamfer all edges of the face or Feature objects can + /// be used to chamfer all edges associated with the input features. If BRepEdge objects are provided + /// and the isTangentChain argument is true additional edges may also get chamfered if they are + /// tangentially connected to any of the input edges. When getting the property, your + /// code should check for the different types in the returned collection and handle it appropriately. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// This property returns nothing in the case where the feature is non-parametric. + core::Ptr edges() const; + bool edges(const core::Ptr& value); + + /// Gets and sets whether or not edges that are tangentially connected to + /// the input edges (if any) will also be chamfered. + bool isTangentChain() const; + bool isTangentChain(bool value); + + /// Gets an enum indicating how the chamfer was defined. The valid return values are + /// EqualDistanceType, TwoDistancesType and DistanceAndAngleType. + /// This property returns nothing in the case where the feature is non-parametric. + ChamferTypes chamferType() const; + + /// Gets the definition object that is defining the type of chamfer. Modifying the + /// definition object will cause the chamfer to recompute. Various types of definition objects can + /// be returned depending on how the chamfer is defined. The ChamferType property can + /// be used to determine which type of definition will be returned. + /// This property returns nothing in the case where the feature is non-parametric. + core::Ptr chamferTypeDefinition() const; + + /// Changes the type of chamfer to be an equal distance chamfer. + /// distance : A ValueInput object that defines the distance of the chamfer. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "2 in"). If no units are specified + /// it is interpreted using the current default units for length. + /// Returns true if the feature is successfully changed + bool setEqualDistance(const core::Ptr& distance); + + /// Changes the type of chamfer to be a two distances chamfer. + /// distanceOne : A ValueInput object that defines the distanceOne of the chamfer. This distance + /// is along the face which is on the left of the selected edge. + /// If the ValueInput uses a real then it is interpreted as centimeters. + /// If it is a string then the units can be defined as part of the string (i.e. "2 in"). + /// If no units are specified it is interpreted using the current default units for length. + /// distanceTwo : A ValueInput object that defines the distanceTwo of the chamfer. This distance + /// is along the face which is on the right of the selected edge. + /// If the ValueInput uses a real then it is interpreted as centimeters. + /// If it is a string then the units can be defined as part of the string (i.e. "2 in"). + /// If no units are specified it is interpreted using the current default units for length. + /// Returns true if the feature is successfully changed + bool setTwoDistances(const core::Ptr& distanceOne, const core::Ptr& distanceTwo); + + /// Changes the type of chamfer to be a distance and angle chamfer. + /// distance : A ValueInput object that defines the distance of the chamfer. This distance + /// is along the face which is on the right of the selected edge. + /// If the ValueInput uses a real then it is interpreted as centimeters. + /// If it is a string then the units can be defined as part of the string (i.e. "2 in"). + /// If no units are specified it is interpreted using the current default units for length. + /// angle : A valueInput object that defines the angle. The direction will be towards to the face + /// which is on the left of the selected edge. This can be a string or a value. + /// If it's a string it is interpreted using the current document units and can include + /// equations. For example all of the following are valid as long as they result in + /// angle units; "45", "45 deg", "a1 / 2". If a value is input it is interpreted + /// as radians. + /// It cannot be negative. + /// Returns true if the feature is successfully changed + bool setDistanceAndAngle(const core::Ptr& distance, const core::Ptr& angle); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Gets and sets the type of corner to be modeled when multiple edges connect at a vertex. + ChamferCornerTypes cornerType() const; + bool cornerType(ChamferCornerTypes value); + + /// Returns the edge sets associated with this chamfer. + core::Ptr edgeSets() const; + + ADSK_FUSION_CHAMFERFEATURE_API static const char* classType(); + ADSK_FUSION_CHAMFERFEATURE_API const char* objectType() const override; + ADSK_FUSION_CHAMFERFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CHAMFERFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* edges_raw() const = 0; + virtual bool edges_raw(core::ObjectCollection* value) = 0; + virtual bool isTangentChain_raw() const = 0; + virtual bool isTangentChain_raw(bool value) = 0; + virtual ChamferTypes chamferType_raw() const = 0; + virtual ChamferTypeDefinition* chamferTypeDefinition_raw() const = 0; + virtual bool setEqualDistance_raw(core::ValueInput* distance) = 0; + virtual bool setTwoDistances_raw(core::ValueInput* distanceOne, core::ValueInput* distanceTwo) = 0; + virtual bool setDistanceAndAngle_raw(core::ValueInput* distance, core::ValueInput* angle) = 0; + virtual ChamferFeature* nativeObject_raw() const = 0; + virtual ChamferFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual ChamferCornerTypes cornerType_raw() const = 0; + virtual bool cornerType_raw(ChamferCornerTypes value) = 0; + virtual ChamferEdgeSets* edgeSets_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ChamferFeature::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline bool ChamferFeature::edges(const core::Ptr& value) +{ + return edges_raw(value.get()); +} + +inline bool ChamferFeature::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline bool ChamferFeature::isTangentChain(bool value) +{ + return isTangentChain_raw(value); +} + +inline ChamferTypes ChamferFeature::chamferType() const +{ + ChamferTypes res = chamferType_raw(); + return res; +} + +inline core::Ptr ChamferFeature::chamferTypeDefinition() const +{ + core::Ptr res = chamferTypeDefinition_raw(); + return res; +} + +inline bool ChamferFeature::setEqualDistance(const core::Ptr& distance) +{ + bool res = setEqualDistance_raw(distance.get()); + return res; +} + +inline bool ChamferFeature::setTwoDistances(const core::Ptr& distanceOne, const core::Ptr& distanceTwo) +{ + bool res = setTwoDistances_raw(distanceOne.get(), distanceTwo.get()); + return res; +} + +inline bool ChamferFeature::setDistanceAndAngle(const core::Ptr& distance, const core::Ptr& angle) +{ + bool res = setDistanceAndAngle_raw(distance.get(), angle.get()); + return res; +} + +inline core::Ptr ChamferFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ChamferFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline ChamferCornerTypes ChamferFeature::cornerType() const +{ + ChamferCornerTypes res = cornerType_raw(); + return res; +} + +inline bool ChamferFeature::cornerType(ChamferCornerTypes value) +{ + return cornerType_raw(value); +} + +inline core::Ptr ChamferFeature::edgeSets() const +{ + core::Ptr res = edgeSets_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CHAMFERFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ChamferFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/ChamferFeatureInput.h new file mode 100644 index 0000000..1ec0564 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ChamferFeatureInput.h @@ -0,0 +1,204 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CHAMFERFEATUREINPUT_CPP__ +# define ADSK_FUSION_CHAMFERFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_CHAMFERFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_CHAMFERFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class ChamferEdgeSets; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a chamfer +/// feature. +class ChamferFeatureInput : public core::Base { +public: + + /// Gets and sets the collection of edges that will be chamfered. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr edges() const; + bool edges(const core::Ptr& value); + + /// Adds a set of edges to this input. + /// distance : A ValueInput object that defines the size of the chamfer. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "2 in"). If no units are specified + /// it is interpreted using the current default units for length. + /// Returns true if the set of edges was successfully added to the ChamferFeatureInput. + bool setToEqualDistance(const core::Ptr& distance); + + /// Adds a set of edges to this input. + /// distanceOne : A ValueInput object that defines the distanceOne of the chamfer. This distance + /// is along the face which is on the left of the selected edge. + /// If the ValueInput uses a real then it is interpreted as centimeters. + /// If it is a string then the units can be defined as part of the string (i.e. "2 in"). + /// If no units are specified it is interpreted using the current default units for length. + /// distanceTwo : A ValueInput object that defines the distanceTwo of the chamfer. This distance + /// is along the face which is on the right of the selected edge. + /// If the ValueInput uses a real then it is interpreted as centimeters. + /// If it is a string then the units can be defined as part of the string (i.e. "2 in"). + /// If no units are specified it is interpreted using the current default units for length. + /// Returns true if successful. + bool setToTwoDistances(const core::Ptr& distanceOne, const core::Ptr& distanceTwo); + + /// Adds a set of edges to this input. + /// distance : A ValueInput object that defines the distance of the chamfer. This distance + /// is along the face which is on the right of the selected edge. + /// If the ValueInput uses a real then it is interpreted as centimeters. + /// If it is a string then the units can be defined as part of the string (i.e. "2 in"). + /// If no units are specified it is interpreted using the current default units for length. + /// angle : A valueInput object that defines the angle. The direction will be towards to the face + /// which is on the left of the selected edge. This can be a string or a value. + /// If it's a string it is interpreted using the current document units and can include + /// equations. For example all of the following are valid as long as they result in + /// angle units; "45", "45 deg", "a1 / 2". If a value is input it is interpreted + /// as radians. It cannot be negative. + /// Returns true if successful. + bool setToDistanceAndAngle(const core::Ptr& distance, const core::Ptr& angle); + + /// Gets and sets if any edges that are tangentially connected to any of chamfered + /// edges will also be included in the chamfer. + bool isTangentChain() const; + bool isTangentChain(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// Gets and sets the type of corner to be modeled when multiple edges connect at a vertex. + ChamferCornerTypes cornerType() const; + bool cornerType(ChamferCornerTypes value); + + /// Returns the collection of edge sets for this chamfer feature input. + core::Ptr chamferEdgeSets() const; + + ADSK_FUSION_CHAMFERFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_CHAMFERFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_CHAMFERFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CHAMFERFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* edges_raw() const = 0; + virtual bool edges_raw(core::ObjectCollection* value) = 0; + virtual bool setToEqualDistance_raw(core::ValueInput* distance) = 0; + virtual bool setToTwoDistances_raw(core::ValueInput* distanceOne, core::ValueInput* distanceTwo) = 0; + virtual bool setToDistanceAndAngle_raw(core::ValueInput* distance, core::ValueInput* angle) = 0; + virtual bool isTangentChain_raw() const = 0; + virtual bool isTangentChain_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual ChamferCornerTypes cornerType_raw() const = 0; + virtual bool cornerType_raw(ChamferCornerTypes value) = 0; + virtual ChamferEdgeSets* chamferEdgeSets_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ChamferFeatureInput::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline bool ChamferFeatureInput::edges(const core::Ptr& value) +{ + return edges_raw(value.get()); +} + +inline bool ChamferFeatureInput::setToEqualDistance(const core::Ptr& distance) +{ + bool res = setToEqualDistance_raw(distance.get()); + return res; +} + +inline bool ChamferFeatureInput::setToTwoDistances(const core::Ptr& distanceOne, const core::Ptr& distanceTwo) +{ + bool res = setToTwoDistances_raw(distanceOne.get(), distanceTwo.get()); + return res; +} + +inline bool ChamferFeatureInput::setToDistanceAndAngle(const core::Ptr& distance, const core::Ptr& angle) +{ + bool res = setToDistanceAndAngle_raw(distance.get(), angle.get()); + return res; +} + +inline bool ChamferFeatureInput::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline bool ChamferFeatureInput::isTangentChain(bool value) +{ + return isTangentChain_raw(value); +} + +inline core::Ptr ChamferFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool ChamferFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline ChamferCornerTypes ChamferFeatureInput::cornerType() const +{ + ChamferCornerTypes res = cornerType_raw(); + return res; +} + +inline bool ChamferFeatureInput::cornerType(ChamferCornerTypes value) +{ + return cornerType_raw(value); +} + +inline core::Ptr ChamferFeatureInput::chamferEdgeSets() const +{ + core::Ptr res = chamferEdgeSets_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CHAMFERFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ChamferFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/ChamferFeatures.h new file mode 100644 index 0000000..2ffec20 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ChamferFeatures.h @@ -0,0 +1,147 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CHAMFERFEATURES_CPP__ +# define ADSK_FUSION_CHAMFERFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_CHAMFERFEATURES_API +# endif +#else +# define ADSK_FUSION_CHAMFERFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ChamferFeature; + class ChamferFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing chamfer features in a component +/// and supports the ability to create new chamfer features. +class ChamferFeatures : public core::Base { +public: + + /// Function that returns the specified chamfer feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of chamfer features in the collection. + size_t count() const; + + /// Creates a ChamferFeatureInput object. Use properties and methods on this object + /// to define the chamfer you want to create and then use the Add method, passing in + /// the ChamferFeatureInput object. + /// edges : The collection of edges that will be chamfered. + /// isTangentChain : Boolean indicating if all edges that are tangentially connected to any of the input edges should be included in the chamfer or not. + /// Returns the newly created ChamferFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& edges, bool isTangentChain) const; + + /// Creates a new chamfer feature. + /// input : A ChamferFeatureInput object that defines the desired chamfer. Use the createInput + /// method to create a new ChamferFeatureInput object and then use methods on it + /// (the ChamferFeatureInput object) to define the chamfer. + /// Returns the newly created ChamferFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified chamfer feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// Creates a ChamferFeatureInput object. Use properties and methods on this object + /// to define the chamfer you want to create and then use the Add method, passing in + /// the ChamferFeatureInput object. + /// Returns the newly created ChamferFeatureInput object or null if the creation failed. + core::Ptr createInput2() const; + + typedef ChamferFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_CHAMFERFEATURES_API static const char* classType(); + ADSK_FUSION_CHAMFERFEATURES_API const char* objectType() const override; + ADSK_FUSION_CHAMFERFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CHAMFERFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ChamferFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual ChamferFeatureInput* createInput_raw(core::ObjectCollection* edges, bool isTangentChain) const = 0; + virtual ChamferFeature* add_raw(ChamferFeatureInput* input) = 0; + virtual ChamferFeature* itemByName_raw(const char * name) const = 0; + virtual ChamferFeatureInput* createInput2_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ChamferFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ChamferFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ChamferFeatures::createInput(const core::Ptr& edges, bool isTangentChain) const +{ + core::Ptr res = createInput_raw(edges.get(), isTangentChain); + return res; +} + +inline core::Ptr ChamferFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ChamferFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline core::Ptr ChamferFeatures::createInput2() const +{ + core::Ptr res = createInput2_raw(); + return res; +} + +template inline void ChamferFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CHAMFERFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ChamferTypeDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/ChamferTypeDefinition.h new file mode 100644 index 0000000..8d4c7dc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ChamferTypeDefinition.h @@ -0,0 +1,94 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CHAMFERTYPEDEFINITION_CPP__ +# define ADSK_FUSION_CHAMFERTYPEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CHAMFERTYPEDEFINITION_API +# endif +#else +# define ADSK_FUSION_CHAMFERTYPEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ChamferFeature; +}} + +namespace adsk { namespace fusion { + +/// The base class for the classes that define how a chamfer can be defined. +class ChamferTypeDefinition : public core::Base { +public: + + /// Returns the feature that owns this chamfer type definition + core::Ptr parentFeature() const; + + ADSK_FUSION_CHAMFERTYPEDEFINITION_API static const char* classType(); + ADSK_FUSION_CHAMFERTYPEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CHAMFERTYPEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CHAMFERTYPEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ChamferFeature* parentFeature_raw() const = 0; + virtual void placeholderChamferTypeDefinition0() {} + virtual void placeholderChamferTypeDefinition1() {} + virtual void placeholderChamferTypeDefinition2() {} + virtual void placeholderChamferTypeDefinition3() {} + virtual void placeholderChamferTypeDefinition4() {} + virtual void placeholderChamferTypeDefinition5() {} + virtual void placeholderChamferTypeDefinition6() {} + virtual void placeholderChamferTypeDefinition7() {} + virtual void placeholderChamferTypeDefinition8() {} + virtual void placeholderChamferTypeDefinition9() {} + virtual void placeholderChamferTypeDefinition10() {} + virtual void placeholderChamferTypeDefinition11() {} + virtual void placeholderChamferTypeDefinition12() {} + virtual void placeholderChamferTypeDefinition13() {} + virtual void placeholderChamferTypeDefinition14() {} + virtual void placeholderChamferTypeDefinition15() {} + virtual void placeholderChamferTypeDefinition16() {} + virtual void placeholderChamferTypeDefinition17() {} + virtual void placeholderChamferTypeDefinition18() {} + virtual void placeholderChamferTypeDefinition19() {} + virtual void placeholderChamferTypeDefinition20() {} + virtual void placeholderChamferTypeDefinition21() {} + virtual void placeholderChamferTypeDefinition22() {} + virtual void placeholderChamferTypeDefinition23() {} + virtual void placeholderChamferTypeDefinition24() {} + virtual void placeholderChamferTypeDefinition25() {} + virtual void placeholderChamferTypeDefinition26() {} + virtual void placeholderChamferTypeDefinition27() {} + virtual void placeholderChamferTypeDefinition28() {} + virtual void placeholderChamferTypeDefinition29() {} + virtual void placeholderChamferTypeDefinition30() {} +}; + +// Inline wrappers + +inline core::Ptr ChamferTypeDefinition::parentFeature() const +{ + core::Ptr res = parentFeature_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CHAMFERTYPEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ChordLengthFilletEdgeSet.h b/usr/autodesk/CPP/include/Fusion/Features/ChordLengthFilletEdgeSet.h new file mode 100644 index 0000000..64f2f61 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ChordLengthFilletEdgeSet.h @@ -0,0 +1,85 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "FilletEdgeSet.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CHORDLENGTHFILLETEDGESET_CPP__ +# define ADSK_FUSION_CHORDLENGTHFILLETEDGESET_API XI_EXPORT +# else +# define ADSK_FUSION_CHORDLENGTHFILLETEDGESET_API +# endif +#else +# define ADSK_FUSION_CHORDLENGTHFILLETEDGESET_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the edges and the parameter associated with a chord length fillet. +class ChordLengthFilletEdgeSet : public FilletEdgeSet { +public: + + /// Gets and sets the edges that will be filleted. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr edges() const; + bool edges(const core::Ptr& value); + + /// Returns the model parameter that controls the chord length of the fillet. You can edit + /// the chord length by using the properties on the returned ModelParameter object. + core::Ptr chordLength() const; + + ADSK_FUSION_CHORDLENGTHFILLETEDGESET_API static const char* classType(); + ADSK_FUSION_CHORDLENGTHFILLETEDGESET_API const char* objectType() const override; + ADSK_FUSION_CHORDLENGTHFILLETEDGESET_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CHORDLENGTHFILLETEDGESET_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* edges_raw() const = 0; + virtual bool edges_raw(core::ObjectCollection* value) = 0; + virtual ModelParameter* chordLength_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ChordLengthFilletEdgeSet::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline bool ChordLengthFilletEdgeSet::edges(const core::Ptr& value) +{ + return edges_raw(value.get()); +} + +inline core::Ptr ChordLengthFilletEdgeSet::chordLength() const +{ + core::Ptr res = chordLength_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CHORDLENGTHFILLETEDGESET_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CircularPatternFeature.h b/usr/autodesk/CPP/include/Fusion/Features/CircularPatternFeature.h new file mode 100644 index 0000000..b2c4e77 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CircularPatternFeature.h @@ -0,0 +1,251 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CIRCULARPATTERNFEATURE_CPP__ +# define ADSK_FUSION_CIRCULARPATTERNFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_CIRCULARPATTERNFEATURE_API +# endif +#else +# define ADSK_FUSION_CIRCULARPATTERNFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; + class PatternElements; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing circular pattern feature in a design. +class CircularPatternFeature : public Feature { +public: + + /// Gets and sets the input entities. The collection can contain faces, features, bodies or occurrences. + /// All of the entities must be of a single type. For example, it can't contain features and occurrences + /// but only features or occurrences. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the axis of circular pattern. This can be a sketch line, linear edge, + /// construction axis, an edge/sketch curve that defines an axis (circle, etc.) or a face that defines an axis (cylinder, cone, torus, etc.). + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr axis() const; + bool axis(const core::Ptr& value); + + /// Returns the parameter controlling the total angle. + /// To edit the angle use properties on the parameter to edit its value. + /// This property returns null in the case where the feature is non-parametric. + /// A negative value can be used to change the direction of the pattern. + core::Ptr totalAngle() const; + + /// Gets and sets if the angle extent is in one direction or symmetric. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isSymmetric() const; + bool isSymmetric(bool value); + + /// Returns the parameter controlling the number of pattern elements, including any suppressed elements. + /// To edit the quantity use properties on the parameter to edit its value. + /// This property returns null in the case where the feature is non-parametric. + core::Ptr quantity() const; + + /// Gets and sets the id's of the elements to suppress. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + std::vector suppressedElementsIds() const; + bool suppressedElementsIds(const std::vector& value); + + /// Gets the PatternElements collection that contains the elements created by this pattern. + core::Ptr patternElements() const; + + /// Returns the features that were created as a result of this pattern. + /// This is only valid for a direct edit model and this returns null + /// in the case where the feature is parametric. + core::Ptr resultFeatures() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the type of entities the pattern consists of. This can be used to help + /// determine the type of results that will be found in the pattern elements. + PatternEntityTypes patternEntityType() const; + + /// Gets and sets the compute option for this pattern feature. + /// This property only applies when patterning features and is ignored in the direct modeling environment. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + PatternComputeOptions patternComputeOption() const; + bool patternComputeOption(PatternComputeOptions value); + + ADSK_FUSION_CIRCULARPATTERNFEATURE_API static const char* classType(); + ADSK_FUSION_CIRCULARPATTERNFEATURE_API const char* objectType() const override; + ADSK_FUSION_CIRCULARPATTERNFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CIRCULARPATTERNFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual core::Base* axis_raw() const = 0; + virtual bool axis_raw(core::Base* value) = 0; + virtual ModelParameter* totalAngle_raw() const = 0; + virtual bool isSymmetric_raw() const = 0; + virtual bool isSymmetric_raw(bool value) = 0; + virtual ModelParameter* quantity_raw() const = 0; + virtual size_t* suppressedElementsIds_raw(size_t& return_size) const = 0; + virtual bool suppressedElementsIds_raw(const size_t* value, size_t value_size) = 0; + virtual PatternElements* patternElements_raw() const = 0; + virtual core::ObjectCollection* resultFeatures_raw() const = 0; + virtual CircularPatternFeature* nativeObject_raw() const = 0; + virtual CircularPatternFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual PatternEntityTypes patternEntityType_raw() const = 0; + virtual PatternComputeOptions patternComputeOption_raw() const = 0; + virtual bool patternComputeOption_raw(PatternComputeOptions value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CircularPatternFeature::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool CircularPatternFeature::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr CircularPatternFeature::axis() const +{ + core::Ptr res = axis_raw(); + return res; +} + +inline bool CircularPatternFeature::axis(const core::Ptr& value) +{ + return axis_raw(value.get()); +} + +inline core::Ptr CircularPatternFeature::totalAngle() const +{ + core::Ptr res = totalAngle_raw(); + return res; +} + +inline bool CircularPatternFeature::isSymmetric() const +{ + bool res = isSymmetric_raw(); + return res; +} + +inline bool CircularPatternFeature::isSymmetric(bool value) +{ + return isSymmetric_raw(value); +} + +inline core::Ptr CircularPatternFeature::quantity() const +{ + core::Ptr res = quantity_raw(); + return res; +} + +inline std::vector CircularPatternFeature::suppressedElementsIds() const +{ + std::vector res; + size_t s; + + size_t* p= suppressedElementsIds_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CircularPatternFeature::suppressedElementsIds(const std::vector& value) +{ + return suppressedElementsIds_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline core::Ptr CircularPatternFeature::patternElements() const +{ + core::Ptr res = patternElements_raw(); + return res; +} + +inline core::Ptr CircularPatternFeature::resultFeatures() const +{ + core::Ptr res = resultFeatures_raw(); + return res; +} + +inline core::Ptr CircularPatternFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr CircularPatternFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline PatternEntityTypes CircularPatternFeature::patternEntityType() const +{ + PatternEntityTypes res = patternEntityType_raw(); + return res; +} + +inline PatternComputeOptions CircularPatternFeature::patternComputeOption() const +{ + PatternComputeOptions res = patternComputeOption_raw(); + return res; +} + +inline bool CircularPatternFeature::patternComputeOption(PatternComputeOptions value) +{ + return patternComputeOption_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CIRCULARPATTERNFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CircularPatternFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/CircularPatternFeatureInput.h new file mode 100644 index 0000000..a13febc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CircularPatternFeatureInput.h @@ -0,0 +1,188 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CIRCULARPATTERNFEATUREINPUT_CPP__ +# define ADSK_FUSION_CIRCULARPATTERNFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_CIRCULARPATTERNFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_CIRCULARPATTERNFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a circular pattern +/// feature. +class CircularPatternFeatureInput : public core::Base { +public: + + /// Gets and sets the input entities. The collection can contain faces, features, bodies or occurrences. + /// All of the entities must be of a single type. For example, it can't contain features and occurrences + /// but only features or occurrences. + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the axis of circular pattern. This can be a sketch line, linear edge, + /// construction axis, an edge/sketch curve that defines an axis (circle, etc.) or a face that defines an axis (cylinder, cone, torus, etc.). + core::Ptr axis() const; + bool axis(const core::Ptr& value); + + /// Gets and sets quantity of the elements. + core::Ptr quantity() const; + bool quantity(const core::Ptr& value); + + /// Gets and sets total angle. A negative angle can be used to reverse the direction. + /// An angle of 360 degrees or 2 pi radians will create a full circular pattern. + core::Ptr totalAngle() const; + bool totalAngle(const core::Ptr& value); + + /// Gets and sets if the angle extent is in one direction or symmetric. + bool isSymmetric() const; + bool isSymmetric(bool value); + + /// Gets and sets the compute option when patterning features. The default value for this is AdjustPatternCompute. + /// This property only applies when patterning features and is ignored in the direct modeling environment. + PatternComputeOptions patternComputeOption() const; + bool patternComputeOption(PatternComputeOptions value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_CIRCULARPATTERNFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_CIRCULARPATTERNFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_CIRCULARPATTERNFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CIRCULARPATTERNFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual core::Base* axis_raw() const = 0; + virtual bool axis_raw(core::Base* value) = 0; + virtual core::ValueInput* quantity_raw() const = 0; + virtual bool quantity_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* totalAngle_raw() const = 0; + virtual bool totalAngle_raw(core::ValueInput* value) = 0; + virtual bool isSymmetric_raw() const = 0; + virtual bool isSymmetric_raw(bool value) = 0; + virtual PatternComputeOptions patternComputeOption_raw() const = 0; + virtual bool patternComputeOption_raw(PatternComputeOptions value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CircularPatternFeatureInput::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool CircularPatternFeatureInput::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr CircularPatternFeatureInput::axis() const +{ + core::Ptr res = axis_raw(); + return res; +} + +inline bool CircularPatternFeatureInput::axis(const core::Ptr& value) +{ + return axis_raw(value.get()); +} + +inline core::Ptr CircularPatternFeatureInput::quantity() const +{ + core::Ptr res = quantity_raw(); + return res; +} + +inline bool CircularPatternFeatureInput::quantity(const core::Ptr& value) +{ + return quantity_raw(value.get()); +} + +inline core::Ptr CircularPatternFeatureInput::totalAngle() const +{ + core::Ptr res = totalAngle_raw(); + return res; +} + +inline bool CircularPatternFeatureInput::totalAngle(const core::Ptr& value) +{ + return totalAngle_raw(value.get()); +} + +inline bool CircularPatternFeatureInput::isSymmetric() const +{ + bool res = isSymmetric_raw(); + return res; +} + +inline bool CircularPatternFeatureInput::isSymmetric(bool value) +{ + return isSymmetric_raw(value); +} + +inline PatternComputeOptions CircularPatternFeatureInput::patternComputeOption() const +{ + PatternComputeOptions res = patternComputeOption_raw(); + return res; +} + +inline bool CircularPatternFeatureInput::patternComputeOption(PatternComputeOptions value) +{ + return patternComputeOption_raw(value); +} + +inline core::Ptr CircularPatternFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool CircularPatternFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CIRCULARPATTERNFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CircularPatternFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/CircularPatternFeatures.h new file mode 100644 index 0000000..41f782f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CircularPatternFeatures.h @@ -0,0 +1,137 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CIRCULARPATTERNFEATURES_CPP__ +# define ADSK_FUSION_CIRCULARPATTERNFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_CIRCULARPATTERNFEATURES_API +# endif +#else +# define ADSK_FUSION_CIRCULARPATTERNFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CircularPatternFeature; + class CircularPatternFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing circular pattern features in a component +/// and supports the ability to create new circular pattern features. +class CircularPatternFeatures : public core::Base { +public: + + /// Function that returns the specified circular pattern feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of circular pattern features in the collection. + size_t count() const; + + /// Creates a CircularPatternFeatureInput object. Use properties and methods on this object + /// to define the circular pattern you want to create and then use the Add method, passing in + /// the CircularPatternFeatureInput object. + /// inputEntities : The collection can contain faces, features, bodies or occurrences. + /// All of the entities must be of a single type. For example, it can't contain features and occurrences + /// but only features or occurrences. + /// axis : Input linear entity or the entity has axis that defines axis of circular pattern. This can be a sketch line, linear edge, + /// construction axis, an edge/sketch curve that defines an axis (circle, etc.) or a face that defines an axis (cylinder, cone, torus, etc.). + /// Returns the newly created CircularPatternFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& inputEntities, const core::Ptr& axis) const; + + /// Creates a new circular pattern feature. + /// input : A CircularPatternFeatureInput object that defines the desired circular pattern. Use the createInput + /// method to create a new CircularPatternFeatureInput object and then use methods on it + /// (the CircularPatternFeatureInput object) to define the circular pattern. + /// Returns the newly created CircularPatternFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified circular pattern feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef CircularPatternFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_CIRCULARPATTERNFEATURES_API static const char* classType(); + ADSK_FUSION_CIRCULARPATTERNFEATURES_API const char* objectType() const override; + ADSK_FUSION_CIRCULARPATTERNFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CIRCULARPATTERNFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CircularPatternFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual CircularPatternFeatureInput* createInput_raw(core::ObjectCollection* inputEntities, core::Base* axis) const = 0; + virtual CircularPatternFeature* add_raw(CircularPatternFeatureInput* input) = 0; + virtual CircularPatternFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr CircularPatternFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t CircularPatternFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CircularPatternFeatures::createInput(const core::Ptr& inputEntities, const core::Ptr& axis) const +{ + core::Ptr res = createInput_raw(inputEntities.get(), axis.get()); + return res; +} + +inline core::Ptr CircularPatternFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr CircularPatternFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void CircularPatternFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CIRCULARPATTERNFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CoilFeature.h b/usr/autodesk/CPP/include/Fusion/Features/CoilFeature.h new file mode 100644 index 0000000..e719bda --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CoilFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COILFEATURE_CPP__ +# define ADSK_FUSION_COILFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_COILFEATURE_API +# endif +#else +# define ADSK_FUSION_COILFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing coil primitive feature in a design. +class CoilFeature : public Feature { +public: + + ADSK_FUSION_COILFEATURE_API static const char* classType(); + ADSK_FUSION_COILFEATURE_API const char* objectType() const override; + ADSK_FUSION_COILFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COILFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COILFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CoilFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/CoilFeatureInput.h new file mode 100644 index 0000000..76d900d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CoilFeatureInput.h @@ -0,0 +1,325 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COILFEATUREINPUT_CPP__ +# define ADSK_FUSION_COILFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_COILFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_COILFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a coil feature. +class CoilFeatureInput : public core::Base { +public: + + /// Sets the coil type to RevolutionsAndHeightCoilType. + /// revolutions : A ValueInput object that defines the number of revolutions. + /// height : A ValueInput object that defines the height. + /// angle : A ValueInput object that defines angle. + /// Returns true if successful. + bool setToRevolutionAndHeight(const core::Ptr& revolutions, const core::Ptr& height, const core::Ptr& angle); + + /// Sets the coil type to RevolutionsAndPitchCoilType. + /// revolutions : A ValueInput object that defines the number of revolutions. + /// pitch : A ValueInput object that defines the pitch. + /// angle : A ValueInput object that defines angle. + /// Returns true if successful. + bool setToRevolutionsAndPitch(const core::Ptr& revolutions, const core::Ptr& pitch, const core::Ptr& angle); + + /// Sets the coil type to HeightAndPitchCoilType. + /// height : A ValueInput object that defines the height. + /// pitch : A ValueInput object that defines the pitch. + /// angle : A ValueInput object that defines angle. + /// Returns true if successful. + bool setToHeightAndPitchCoil(const core::Ptr& height, const core::Ptr& pitch, const core::Ptr& angle); + + /// Sets the coil type to SpiralCoilType. + /// revolutions : A ValueInput object that defines the number of revolutions. + /// pitch : A ValueInput object that defines the pitch. + /// Returns true if successful. + bool setToSpiral(const core::Ptr& revolutions, const core::Ptr& pitch); + + /// Specifies if the coil should be created as a solid or surface. This is + /// initialized to true so a solid will be created if it's not changed. + /// It only can be set to false in non-parametric modeling. + bool isSolid() const; + bool isSolid(bool value); + + /// Gets the revolutions number. Returns null in the case where the coilType property returns HeightAndPitchCoilType. + core::Ptr revolutions() const; + + /// Gets the height. Returns null in the case where the coilType property returns RevolutionsAndPitchCoilType. + core::Ptr height() const; + + /// Gets the pitch. Returns null in the case where the coilType property returns RevolutionsAndHeightCoilType or SpiralCoilType. + core::Ptr pitch() const; + + /// Gets the angle. Returns null in the case where the coilType property returns SpiralCoilType. + core::Ptr angle() const; + + /// Gets the type of the coil. + CoilFeatureTypes coilType() const; + + /// Gets and sets the type of operation performed by the coil. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets and sets the base plane. + core::Ptr basePlane() const; + bool basePlane(const core::Ptr& value); + + /// Gets and sets whether the rotation is clockwise or counter-clockwise. A value of true indicates clockwise rotation. + /// It defaults to true. + bool isClockwiseRotation() const; + bool isClockwiseRotation(bool value); + + /// Gets and sets the diameter. + core::Ptr diameter() const; + bool diameter(const core::Ptr& value); + + /// Gets the section type of the coil. + /// It defaults to CircularCoilSectionType. + CoilFeatureSectionTypes coilSectionType() const; + bool coilSectionType(CoilFeatureSectionTypes value); + + /// Gets the section position of the coil. + /// It defaults to InsideCoilSectionPosition. + CoilFeatureSectionPositions coilSectionPosition() const; + bool coilSectionPosition(CoilFeatureSectionPositions value); + + /// Gets and sets the section size. + core::Ptr sectionSize() const; + bool sectionSize(const core::Ptr& value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_COILFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_COILFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_COILFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COILFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setToRevolutionAndHeight_raw(core::ValueInput* revolutions, core::ValueInput* height, core::ValueInput* angle) = 0; + virtual bool setToRevolutionsAndPitch_raw(core::ValueInput* revolutions, core::ValueInput* pitch, core::ValueInput* angle) = 0; + virtual bool setToHeightAndPitchCoil_raw(core::ValueInput* height, core::ValueInput* pitch, core::ValueInput* angle) = 0; + virtual bool setToSpiral_raw(core::ValueInput* revolutions, core::ValueInput* pitch) = 0; + virtual bool isSolid_raw() const = 0; + virtual bool isSolid_raw(bool value) = 0; + virtual core::ValueInput* revolutions_raw() const = 0; + virtual core::ValueInput* height_raw() const = 0; + virtual core::ValueInput* pitch_raw() const = 0; + virtual core::ValueInput* angle_raw() const = 0; + virtual CoilFeatureTypes coilType_raw() const = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual core::Base* basePlane_raw() const = 0; + virtual bool basePlane_raw(core::Base* value) = 0; + virtual bool isClockwiseRotation_raw() const = 0; + virtual bool isClockwiseRotation_raw(bool value) = 0; + virtual core::ValueInput* diameter_raw() const = 0; + virtual bool diameter_raw(core::ValueInput* value) = 0; + virtual CoilFeatureSectionTypes coilSectionType_raw() const = 0; + virtual bool coilSectionType_raw(CoilFeatureSectionTypes value) = 0; + virtual CoilFeatureSectionPositions coilSectionPosition_raw() const = 0; + virtual bool coilSectionPosition_raw(CoilFeatureSectionPositions value) = 0; + virtual core::ValueInput* sectionSize_raw() const = 0; + virtual bool sectionSize_raw(core::ValueInput* value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline bool CoilFeatureInput::setToRevolutionAndHeight(const core::Ptr& revolutions, const core::Ptr& height, const core::Ptr& angle) +{ + bool res = setToRevolutionAndHeight_raw(revolutions.get(), height.get(), angle.get()); + return res; +} + +inline bool CoilFeatureInput::setToRevolutionsAndPitch(const core::Ptr& revolutions, const core::Ptr& pitch, const core::Ptr& angle) +{ + bool res = setToRevolutionsAndPitch_raw(revolutions.get(), pitch.get(), angle.get()); + return res; +} + +inline bool CoilFeatureInput::setToHeightAndPitchCoil(const core::Ptr& height, const core::Ptr& pitch, const core::Ptr& angle) +{ + bool res = setToHeightAndPitchCoil_raw(height.get(), pitch.get(), angle.get()); + return res; +} + +inline bool CoilFeatureInput::setToSpiral(const core::Ptr& revolutions, const core::Ptr& pitch) +{ + bool res = setToSpiral_raw(revolutions.get(), pitch.get()); + return res; +} + +inline bool CoilFeatureInput::isSolid() const +{ + bool res = isSolid_raw(); + return res; +} + +inline bool CoilFeatureInput::isSolid(bool value) +{ + return isSolid_raw(value); +} + +inline core::Ptr CoilFeatureInput::revolutions() const +{ + core::Ptr res = revolutions_raw(); + return res; +} + +inline core::Ptr CoilFeatureInput::height() const +{ + core::Ptr res = height_raw(); + return res; +} + +inline core::Ptr CoilFeatureInput::pitch() const +{ + core::Ptr res = pitch_raw(); + return res; +} + +inline core::Ptr CoilFeatureInput::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline CoilFeatureTypes CoilFeatureInput::coilType() const +{ + CoilFeatureTypes res = coilType_raw(); + return res; +} + +inline FeatureOperations CoilFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool CoilFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr CoilFeatureInput::basePlane() const +{ + core::Ptr res = basePlane_raw(); + return res; +} + +inline bool CoilFeatureInput::basePlane(const core::Ptr& value) +{ + return basePlane_raw(value.get()); +} + +inline bool CoilFeatureInput::isClockwiseRotation() const +{ + bool res = isClockwiseRotation_raw(); + return res; +} + +inline bool CoilFeatureInput::isClockwiseRotation(bool value) +{ + return isClockwiseRotation_raw(value); +} + +inline core::Ptr CoilFeatureInput::diameter() const +{ + core::Ptr res = diameter_raw(); + return res; +} + +inline bool CoilFeatureInput::diameter(const core::Ptr& value) +{ + return diameter_raw(value.get()); +} + +inline CoilFeatureSectionTypes CoilFeatureInput::coilSectionType() const +{ + CoilFeatureSectionTypes res = coilSectionType_raw(); + return res; +} + +inline bool CoilFeatureInput::coilSectionType(CoilFeatureSectionTypes value) +{ + return coilSectionType_raw(value); +} + +inline CoilFeatureSectionPositions CoilFeatureInput::coilSectionPosition() const +{ + CoilFeatureSectionPositions res = coilSectionPosition_raw(); + return res; +} + +inline bool CoilFeatureInput::coilSectionPosition(CoilFeatureSectionPositions value) +{ + return coilSectionPosition_raw(value); +} + +inline core::Ptr CoilFeatureInput::sectionSize() const +{ + core::Ptr res = sectionSize_raw(); + return res; +} + +inline bool CoilFeatureInput::sectionSize(const core::Ptr& value) +{ + return sectionSize_raw(value.get()); +} + +inline core::Ptr CoilFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool CoilFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COILFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CoilFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/CoilFeatures.h new file mode 100644 index 0000000..97285f3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CoilFeatures.h @@ -0,0 +1,101 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COILFEATURES_CPP__ +# define ADSK_FUSION_COILFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_COILFEATURES_API +# endif +#else +# define ADSK_FUSION_COILFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CoilFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing coil features in a design +/// and supports the ability to create new coil features. +class CoilFeatures : public core::Base { +public: + + /// Function that returns the specified coil feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified coil feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of coil features in the collection. + size_t count() const; + + typedef CoilFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_COILFEATURES_API static const char* classType(); + ADSK_FUSION_COILFEATURES_API const char* objectType() const override; + ADSK_FUSION_COILFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COILFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CoilFeature* item_raw(size_t index) const = 0; + virtual CoilFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr CoilFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr CoilFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t CoilFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void CoilFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COILFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CombineFeature.h b/usr/autodesk/CPP/include/Fusion/Features/CombineFeature.h new file mode 100644 index 0000000..284c400 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CombineFeature.h @@ -0,0 +1,172 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COMBINEFEATURE_CPP__ +# define ADSK_FUSION_COMBINEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_COMBINEFEATURE_API +# endif +#else +# define ADSK_FUSION_COMBINEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing Combine feature in a design. +/// In non-parametric environment this object does not exist. +class CombineFeature : public Feature { +public: + + /// Gets and sets the BRep Body object that represents the blank body. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr targetBody() const; + bool targetBody(const core::Ptr& value); + + /// Gets and sets the BRep Body objects that represent the tool bodies. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr toolBodies() const; + bool toolBodies(const core::Ptr& value); + + /// Gets and sets the type of operation performed by the combine. + /// The valid values are JoinFeatureOperation, CutFeatureOperation and IntersectFeatureOperation. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets a boolean value for whether or not a new component was created when this feature was created. + bool isNewComponent() const; + + /// Gets and sets a boolean value for whether or not the tool bodies are retrained after the combine results. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isKeepToolBodies() const; + bool isKeepToolBodies(bool value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_COMBINEFEATURE_API static const char* classType(); + ADSK_FUSION_COMBINEFEATURE_API const char* objectType() const override; + ADSK_FUSION_COMBINEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COMBINEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepBody* targetBody_raw() const = 0; + virtual bool targetBody_raw(BRepBody* value) = 0; + virtual core::ObjectCollection* toolBodies_raw() const = 0; + virtual bool toolBodies_raw(core::ObjectCollection* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual bool isNewComponent_raw() const = 0; + virtual bool isKeepToolBodies_raw() const = 0; + virtual bool isKeepToolBodies_raw(bool value) = 0; + virtual CombineFeature* nativeObject_raw() const = 0; + virtual CombineFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr CombineFeature::targetBody() const +{ + core::Ptr res = targetBody_raw(); + return res; +} + +inline bool CombineFeature::targetBody(const core::Ptr& value) +{ + return targetBody_raw(value.get()); +} + +inline core::Ptr CombineFeature::toolBodies() const +{ + core::Ptr res = toolBodies_raw(); + return res; +} + +inline bool CombineFeature::toolBodies(const core::Ptr& value) +{ + return toolBodies_raw(value.get()); +} + +inline FeatureOperations CombineFeature::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool CombineFeature::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline bool CombineFeature::isNewComponent() const +{ + bool res = isNewComponent_raw(); + return res; +} + +inline bool CombineFeature::isKeepToolBodies() const +{ + bool res = isKeepToolBodies_raw(); + return res; +} + +inline bool CombineFeature::isKeepToolBodies(bool value) +{ + return isKeepToolBodies_raw(value); +} + +inline core::Ptr CombineFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr CombineFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COMBINEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CombineFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/CombineFeatureInput.h new file mode 100644 index 0000000..3482bc4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CombineFeatureInput.h @@ -0,0 +1,169 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COMBINEFEATUREINPUT_CPP__ +# define ADSK_FUSION_COMBINEFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_COMBINEFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_COMBINEFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepBody; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a combine +/// feature. +class CombineFeatureInput : public core::Base { +public: + + /// Gets and sets the BRep Body object that represents the blank body. + core::Ptr targetBody() const; + bool targetBody(const core::Ptr& value); + + /// Gets and sets the BRep Body objects that represent the tool bodies. + core::Ptr toolBodies() const; + bool toolBodies(const core::Ptr& value); + + /// Gets and sets the type of operation performed by the combine. + /// The valid values are JoinFeatureOperation, CutFeatureOperation and IntersectFeatureOperation. + /// The default value is JoinFeatureOperation. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets and sets a boolean value for whether or not a new component will be created with the results. The default value is false. + /// In Base feature environment NewComponent does not work. + bool isNewComponent() const; + bool isNewComponent(bool value); + + /// Gets and sets a boolean value for whether or not the tool bodies are retrained after the combine results. The default value is false. + bool isKeepToolBodies() const; + bool isKeepToolBodies(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_COMBINEFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_COMBINEFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_COMBINEFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COMBINEFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepBody* targetBody_raw() const = 0; + virtual bool targetBody_raw(BRepBody* value) = 0; + virtual core::ObjectCollection* toolBodies_raw() const = 0; + virtual bool toolBodies_raw(core::ObjectCollection* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual bool isNewComponent_raw() const = 0; + virtual bool isNewComponent_raw(bool value) = 0; + virtual bool isKeepToolBodies_raw() const = 0; + virtual bool isKeepToolBodies_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CombineFeatureInput::targetBody() const +{ + core::Ptr res = targetBody_raw(); + return res; +} + +inline bool CombineFeatureInput::targetBody(const core::Ptr& value) +{ + return targetBody_raw(value.get()); +} + +inline core::Ptr CombineFeatureInput::toolBodies() const +{ + core::Ptr res = toolBodies_raw(); + return res; +} + +inline bool CombineFeatureInput::toolBodies(const core::Ptr& value) +{ + return toolBodies_raw(value.get()); +} + +inline FeatureOperations CombineFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool CombineFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline bool CombineFeatureInput::isNewComponent() const +{ + bool res = isNewComponent_raw(); + return res; +} + +inline bool CombineFeatureInput::isNewComponent(bool value) +{ + return isNewComponent_raw(value); +} + +inline bool CombineFeatureInput::isKeepToolBodies() const +{ + bool res = isKeepToolBodies_raw(); + return res; +} + +inline bool CombineFeatureInput::isKeepToolBodies(bool value) +{ + return isKeepToolBodies_raw(value); +} + +inline core::Ptr CombineFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool CombineFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COMBINEFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CombineFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/CombineFeatures.h new file mode 100644 index 0000000..c817637 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CombineFeatures.h @@ -0,0 +1,138 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COMBINEFEATURES_CPP__ +# define ADSK_FUSION_COMBINEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_COMBINEFEATURES_API +# endif +#else +# define ADSK_FUSION_COMBINEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class CombineFeature; + class CombineFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Combine features in a component +/// and supports the ability to create new Combine features. +class CombineFeatures : public core::Base { +public: + + /// Function that returns the specified combine feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + /// This property returns nothing in the case where the feature is non-parametric. + core::Ptr item(size_t index) const; + + /// The number of combine features in the collection. + /// This property returns nothing in the case where the feature is non-parametric. + size_t count() const; + + /// Creates a CombineFeatureInput object. Use properties and methods on this object + /// to define the combine you want to create and then use the Add method, passing in + /// the CombineFeatureInput object. + /// targetBody : A BRep body that represents the blank body. + /// toolBodies : An ObjectCollection containing one or more BRep bodies that represent tool bodies. + /// Returns the newly created CombineFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& targetBody, const core::Ptr& toolBodies) const; + + /// Creates a new combine feature. + /// input : A CombineFeatureInput object that defines the desired combine. Use the createInput + /// method to create a new CombineFeatureInput object and then use methods on it + /// (the CombineFeatureInput object) to define the combine. + /// Returns the newly created CombineFeature object or null if the creation failed. + /// This function returns nothing in the case where the feature is non-parametric. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified combine feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef CombineFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_COMBINEFEATURES_API static const char* classType(); + ADSK_FUSION_COMBINEFEATURES_API const char* objectType() const override; + ADSK_FUSION_COMBINEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COMBINEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CombineFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual CombineFeatureInput* createInput_raw(BRepBody* targetBody, core::ObjectCollection* toolBodies) const = 0; + virtual CombineFeature* add_raw(CombineFeatureInput* input) = 0; + virtual CombineFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr CombineFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t CombineFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CombineFeatures::createInput(const core::Ptr& targetBody, const core::Ptr& toolBodies) const +{ + core::Ptr res = createInput_raw(targetBody.get(), toolBodies.get()); + return res; +} + +inline core::Ptr CombineFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr CombineFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void CombineFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COMBINEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ConstantRadiusFilletEdgeSet.h b/usr/autodesk/CPP/include/Fusion/Features/ConstantRadiusFilletEdgeSet.h new file mode 100644 index 0000000..814900a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ConstantRadiusFilletEdgeSet.h @@ -0,0 +1,85 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "FilletEdgeSet.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONSTANTRADIUSFILLETEDGESET_CPP__ +# define ADSK_FUSION_CONSTANTRADIUSFILLETEDGESET_API XI_EXPORT +# else +# define ADSK_FUSION_CONSTANTRADIUSFILLETEDGESET_API +# endif +#else +# define ADSK_FUSION_CONSTANTRADIUSFILLETEDGESET_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the edges and the parameter associated with a constant radius fillet. +class ConstantRadiusFilletEdgeSet : public FilletEdgeSet { +public: + + /// Gets and sets the edges that will be filleted. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr edges() const; + bool edges(const core::Ptr& value); + + /// Returns the model parameter that controls the radius of the fillet. You can edit + /// the radius by using the properties on the returned ModelParameter object. + core::Ptr radius() const; + + ADSK_FUSION_CONSTANTRADIUSFILLETEDGESET_API static const char* classType(); + ADSK_FUSION_CONSTANTRADIUSFILLETEDGESET_API const char* objectType() const override; + ADSK_FUSION_CONSTANTRADIUSFILLETEDGESET_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONSTANTRADIUSFILLETEDGESET_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* edges_raw() const = 0; + virtual bool edges_raw(core::ObjectCollection* value) = 0; + virtual ModelParameter* radius_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ConstantRadiusFilletEdgeSet::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline bool ConstantRadiusFilletEdgeSet::edges(const core::Ptr& value) +{ + return edges_raw(value.get()); +} + +inline core::Ptr ConstantRadiusFilletEdgeSet::radius() const +{ + core::Ptr res = radius_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONSTANTRADIUSFILLETEDGESET_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CopyPasteBodies.h b/usr/autodesk/CPP/include/Fusion/Features/CopyPasteBodies.h new file mode 100644 index 0000000..6b32c08 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CopyPasteBodies.h @@ -0,0 +1,113 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COPYPASTEBODIES_CPP__ +# define ADSK_FUSION_COPYPASTEBODIES_API XI_EXPORT +# else +# define ADSK_FUSION_COPYPASTEBODIES_API +# endif +#else +# define ADSK_FUSION_COPYPASTEBODIES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CopyPasteBody; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing copy-paste features in a design. +/// These are created in the UI by copying and then pasting a B-Rep body. +class CopyPasteBodies : public core::Base { +public: + + /// Function that returns the specified Copy/Paste Body feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified Copy/Paste Body feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of Copy/Paste Body features in the collection. + size_t count() const; + + /// Copies the specified body into the component that owns this CopyPasteBodies collection. + /// sourceBody : Either an ObjectCollection of BRepBodies or a single BRepBody object to copy. + /// Returns the newly created BRepBody object or null in the case of failure. + core::Ptr add(const core::Ptr& sourceBody); + + typedef CopyPasteBody iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_COPYPASTEBODIES_API static const char* classType(); + ADSK_FUSION_COPYPASTEBODIES_API const char* objectType() const override; + ADSK_FUSION_COPYPASTEBODIES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COPYPASTEBODIES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CopyPasteBody* item_raw(size_t index) const = 0; + virtual CopyPasteBody* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual CopyPasteBody* add_raw(core::Base* sourceBody) = 0; +}; + +// Inline wrappers + +inline core::Ptr CopyPasteBodies::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr CopyPasteBodies::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t CopyPasteBodies::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CopyPasteBodies::add(const core::Ptr& sourceBody) +{ + core::Ptr res = add_raw(sourceBody.get()); + return res; +} + +template inline void CopyPasteBodies::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COPYPASTEBODIES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CopyPasteBody.h b/usr/autodesk/CPP/include/Fusion/Features/CopyPasteBody.h new file mode 100644 index 0000000..c5301e9 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CopyPasteBody.h @@ -0,0 +1,67 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COPYPASTEBODY_CPP__ +# define ADSK_FUSION_COPYPASTEBODY_API XI_EXPORT +# else +# define ADSK_FUSION_COPYPASTEBODY_API +# endif +#else +# define ADSK_FUSION_COPYPASTEBODY_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing Copy/Paste Body feature in a design. +class CopyPasteBody : public Feature { +public: + + /// Returns the bodies that were copied to create the result bodies of this feature. An ObjectCollection + /// is returned that will contain the original bodies. It's possible that the collection can be empty + /// or contain less than the number of bodies originally copied. This happens in the case where a body + /// has been deleted or consumed by some other operation. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr sourceBody() const; + + ADSK_FUSION_COPYPASTEBODY_API static const char* classType(); + ADSK_FUSION_COPYPASTEBODY_API const char* objectType() const override; + ADSK_FUSION_COPYPASTEBODY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COPYPASTEBODY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* sourceBody_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr CopyPasteBody::sourceBody() const +{ + core::Ptr res = sourceBody_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COPYPASTEBODY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CustomFeature.h b/usr/autodesk/CPP/include/Fusion/Features/CustomFeature.h new file mode 100644 index 0000000..0762feb --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CustomFeature.h @@ -0,0 +1,177 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMFEATURE_CPP__ +# define ADSK_FUSION_CUSTOMFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMFEATURE_API +# endif +#else +# define ADSK_FUSION_CUSTOMFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomFeatureDefinition; + class CustomFeatureDependencies; + class CustomFeatureParameters; + class CustomNamedValues; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing CustomFeature feature in a design. +class CustomFeature : public Feature { +public: + + /// Gets the CustomFeatureDefinition object associated with this custom feature. + /// null/None is returned in the case where the definition does not exist, which is + /// typically a result of the owning add-in not being loaded. + core::Ptr definition() const; + + /// Returns the collection of dependencies for this custom feature. You can + /// use the collection to query, add, and remove dependencies. + core::Ptr dependencies() const; + + /// Returns the list of parameters associated with this custom feature. + core::Ptr parameters() const; + + /// Returns the features combined by this custom feature. The start and end features and all of + /// the features between them in the timeline are returned. + std::vector> features() const; + + /// Sets the start and end features that will be grouped by the custom feature. + /// The "features" in this case can be any object that is visible in the timeline, + /// such as modeling features, sketches, and construction geometry. The input features + /// and all features between them in the timeline will be grouped by the custom feature. + /// The current start and end features can be determined by using the CustomFeature.features property + /// and getting the first and last feature from the returned array. + /// startFeature : The first feature in the timeline to be grouped by the custom feature. The start and the end features + /// can be null which will result in moving all of the features out of the custom feature. This is useful + /// in cases where you need to modify the inputs to a feature contained within a custom feature. You can + /// move the features out of the custom feature, move the timeline marker as needed to edit the features, + /// and then use this method again to add them back into the custom feature. + /// endFeature : The last feature in the timeline that will be grouped by the custom feature. This can be the same + /// feature that is provided as the startFeature argument for the case where the custom feature contains + /// a single feature. + /// + bool setStartAndEndFeatures(const core::Ptr& startFeature, const core::Ptr& endFeature); + + /// Returns the set of custom named values associated with this custom feature. These are + /// a set of named values that are saved with this feature that you can use to save + /// any additional information that is useful for you in managing the custom feature. + /// For example, you might have a setting like an option for different shapes that + /// the user chooses when creating the feature that are not represented as a parameter. + /// You can use this to save the chosen value so when the feature is computed or edited + /// you can use the value originally chosen. During an edit, you might allow the user + /// to edit this setting and you can update the saved custom value. + core::Ptr customNamedValues() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_CUSTOMFEATURE_API static const char* classType(); + ADSK_FUSION_CUSTOMFEATURE_API const char* objectType() const override; + ADSK_FUSION_CUSTOMFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomFeatureDefinition* definition_raw() const = 0; + virtual CustomFeatureDependencies* dependencies_raw() const = 0; + virtual CustomFeatureParameters* parameters_raw() const = 0; + virtual core::Base** features_raw(size_t& return_size) const = 0; + virtual bool setStartAndEndFeatures_raw(core::Base* startFeature, core::Base* endFeature) = 0; + virtual CustomNamedValues* customNamedValues_raw() const = 0; + virtual CustomFeature* nativeObject_raw() const = 0; + virtual CustomFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomFeature::definition() const +{ + core::Ptr res = definition_raw(); + return res; +} + +inline core::Ptr CustomFeature::dependencies() const +{ + core::Ptr res = dependencies_raw(); + return res; +} + +inline core::Ptr CustomFeature::parameters() const +{ + core::Ptr res = parameters_raw(); + return res; +} + +inline std::vector> CustomFeature::features() const +{ + std::vector> res; + size_t s; + + core::Base** p= features_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomFeature::setStartAndEndFeatures(const core::Ptr& startFeature, const core::Ptr& endFeature) +{ + bool res = setStartAndEndFeatures_raw(startFeature.get(), endFeature.get()); + return res; +} + +inline core::Ptr CustomFeature::customNamedValues() const +{ + core::Ptr res = customNamedValues_raw(); + return res; +} + +inline core::Ptr CustomFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr CustomFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureDefinition.h new file mode 100644 index 0000000..e1a2ba1 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureDefinition.h @@ -0,0 +1,196 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMFEATUREDEFINITION_CPP__ +# define ADSK_FUSION_CUSTOMFEATUREDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMFEATUREDEFINITION_API +# endif +#else +# define ADSK_FUSION_CUSTOMFEATUREDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomFeatureEvent; +}} + +namespace adsk { namespace fusion { + +/// The CustomFeatureDefinition object defines a specific type of custom feature. It contains +/// the settings that apply to all custom features of that type and is used when creating new +/// custom features of that type. It also supports the events used to handle changes to custom +/// features of that type. +class CustomFeatureDefinition : public core::Base { +public: + + /// A static function that creates a new CustomFeatureDefinition object. The creation of a + /// CustomFeatureDefinition object is required to be able to create new custom features and + /// for existing custom features to behave correctly. The CustomFeatureDefinition object defines + /// all of the information that is common for all custom features of a particular type. For example, + /// it defines the icon and the default name. The CustomFeatureDefinition object also supports the + /// events that used to react to an existing feature being edited or re-computed. + /// The custom feature definition should be created when your add-in is initially loaded to notify + /// Fusion that the add-in that supports that custom feature type is available. + /// id : The unique ID for custom features of a particular type. Care must be taken to ensure that this + /// is unique and you must be consistent in its use once you've chosen an ID. A good practice to + /// help ensure unique naming is to use the name of your company in combination with the name of + /// the feature, such as "CompanyName.FeatureName". For example, "WoodTools4U.Dovetail". + /// defaultName : The default name of the feature. Fusion will use this name and append a number to each feature + /// instance as it's created. For example, if this is "Dovetail" the first custom feature created + /// will be named "Dovetail1" and the second will be "Dovetail2". + /// If you want to localize this name you can use the Application.Preferences.generalPreferences.userLanguage + /// property to determine what language the user has chosen and use the corresponding name for that language. + /// iconFolder : The folder that contains the image files that will be used for the icon for this feature in + /// the timeline. This can be a full path or a relative path where it will be relative to the add-in + /// file. The folder should contain the image files named 16x16.png and 32x32.png which should be + /// images that are 16 and 32 pixels square. + /// Returns the newly created CustomFeatureDefinition or null in the case of failure. + static core::Ptr create(const std::string& id, const std::string& defaultName, const std::string& iconFolder); + + /// Gets the unique ID used for this type of custom feature. + std::string id() const; + + /// Gets and sets the folder that contains the images that are used for the icon in the timeline for + /// this custom feature. The folder should contain the image files named 16x16.png and 32x32.png + /// which should be images that are 16 and 32 pixels square. + std::string iconFolder() const; + bool iconFolder(const std::string& value); + + /// Gets and sets the default name of the feature. Fusion will use this name and append a number + /// to each feature instance as it's created. For example, if this is "Dovetail" the first + /// custom feature created will be named "Dovetail1" and the second will be "Dovetail2". + /// If you want to localize this name you can use the Application.Preferences.generalPreferences.userLanguage + /// property to determine what language the user has chosen and use the corresponding name for that language. + std::string defaultName() const; + bool defaultName(const std::string& value); + + /// Gets and sets which command will be invoked when the feature is edited. This is the id of the + /// CommandDefinition object that you have created to do the edit of the feature. + std::string editCommandId() const; + bool editCommandId(const std::string& value); + + /// The customFeatureCompute event fires when Fusion is computing the timeline and reaches + /// the custom feature. The event is fired if any of the dependencies of the custom feature + /// have changed. You can modify the results of your custom feature based on the dependencies. + core::Ptr customFeatureCompute() const; + + ADSK_FUSION_CUSTOMFEATUREDEFINITION_API static const char* classType(); + ADSK_FUSION_CUSTOMFEATUREDEFINITION_API const char* objectType() const override; + ADSK_FUSION_CUSTOMFEATUREDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMFEATUREDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_CUSTOMFEATUREDEFINITION_API static CustomFeatureDefinition* create_raw(const char * id, const char * defaultName, const char * iconFolder); + virtual char* id_raw() const = 0; + virtual char* iconFolder_raw() const = 0; + virtual bool iconFolder_raw(const char * value) = 0; + virtual char* defaultName_raw() const = 0; + virtual bool defaultName_raw(const char * value) = 0; + virtual char* editCommandId_raw() const = 0; + virtual bool editCommandId_raw(const char * value) = 0; + virtual CustomFeatureEvent* customFeatureCompute_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomFeatureDefinition::create(const std::string& id, const std::string& defaultName, const std::string& iconFolder) +{ + core::Ptr res = create_raw(id.c_str(), defaultName.c_str(), iconFolder.c_str()); + return res; +} + +inline std::string CustomFeatureDefinition::id() const +{ + std::string res; + + char* p= id_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CustomFeatureDefinition::iconFolder() const +{ + std::string res; + + char* p= iconFolder_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomFeatureDefinition::iconFolder(const std::string& value) +{ + return iconFolder_raw(value.c_str()); +} + +inline std::string CustomFeatureDefinition::defaultName() const +{ + std::string res; + + char* p= defaultName_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomFeatureDefinition::defaultName(const std::string& value) +{ + return defaultName_raw(value.c_str()); +} + +inline std::string CustomFeatureDefinition::editCommandId() const +{ + std::string res; + + char* p= editCommandId_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomFeatureDefinition::editCommandId(const std::string& value) +{ + return editCommandId_raw(value.c_str()); +} + +inline core::Ptr CustomFeatureDefinition::customFeatureCompute() const +{ + core::Ptr res = customFeatureCompute_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMFEATUREDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureDependencies.h b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureDependencies.h new file mode 100644 index 0000000..71aba1e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureDependencies.h @@ -0,0 +1,120 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMFEATUREDEPENDENCIES_CPP__ +# define ADSK_FUSION_CUSTOMFEATUREDEPENDENCIES_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMFEATUREDEPENDENCIES_API +# endif +#else +# define ADSK_FUSION_CUSTOMFEATUREDEPENDENCIES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomFeatureDependency; +}} + +namespace adsk { namespace fusion { + +/// A collection of dependencies associated with a particular custom feature. These +/// are the entities that the custom feature is dependent on. If these entities are +/// modified, it will cause the custom feature to recompute so it can be up to date. +/// These dependencies are saved with the custom feature and can be accessed at a +/// later time, typically during the compute, to access and use the entities. +class CustomFeatureDependencies : public core::Base { +public: + + /// Function that returns the specified custom dependency using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified custom dependency given its ID. + /// id : The ID of the dependency, which was assigned when the dependency was defined. + /// Returns the specified item or null if the specified ID was not found. + core::Ptr itemById(const std::string& id) const; + + /// The number of CustomFeatureParameter objects in the collection. + size_t count() const; + + /// Adds an entity or parameter that this feature is dependent on. This is used by Fusion to know + /// when to recompute this feature and to control the behavior of the feature's node in the timeline. + /// id : An ID for this dependency. This is used to allow you to identify which dependency is which in the future. + /// The ID must be unique with respect to the other dependencies of this custom feature. + /// entity : The entity or parameter you want to add as a dependency. This can be a BRepBody, BRepFace, BrepEdge, + /// BRepVertex, a sketch, any sketch entities, a profile, any construction geometry, or any parameter. + /// Returns the created CustomFeatureDependency object and asserts if it failed. + core::Ptr add(const std::string& id, const core::Ptr& entity); + + /// Deletes all of the current dependencies. This method is for convenience and + /// is equivalent to iterating through the collection and deleting them one at a time. + /// Returns true if the operation was successful. + bool deleteAll(); + + ADSK_FUSION_CUSTOMFEATUREDEPENDENCIES_API static const char* classType(); + ADSK_FUSION_CUSTOMFEATUREDEPENDENCIES_API const char* objectType() const override; + ADSK_FUSION_CUSTOMFEATUREDEPENDENCIES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMFEATUREDEPENDENCIES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomFeatureDependency* item_raw(size_t index) const = 0; + virtual CustomFeatureDependency* itemById_raw(const char * id) const = 0; + virtual size_t count_raw() const = 0; + virtual CustomFeatureDependency* add_raw(const char * id, core::Base* entity) = 0; + virtual bool deleteAll_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomFeatureDependencies::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr CustomFeatureDependencies::itemById(const std::string& id) const +{ + core::Ptr res = itemById_raw(id.c_str()); + return res; +} + +inline size_t CustomFeatureDependencies::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CustomFeatureDependencies::add(const std::string& id, const core::Ptr& entity) +{ + core::Ptr res = add_raw(id.c_str(), entity.get()); + return res; +} + +inline bool CustomFeatureDependencies::deleteAll() +{ + bool res = deleteAll_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMFEATUREDEPENDENCIES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureDependency.h b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureDependency.h new file mode 100644 index 0000000..7a8871e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureDependency.h @@ -0,0 +1,112 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMFEATUREDEPENDENCY_CPP__ +# define ADSK_FUSION_CUSTOMFEATUREDEPENDENCY_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMFEATUREDEPENDENCY_API +# endif +#else +# define ADSK_FUSION_CUSTOMFEATUREDEPENDENCY_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomFeature; +}} + +namespace adsk { namespace fusion { + +/// A custom feature dependency defines a dependency the custom feature has on an entity +/// outside the custom feature. For example, a feature might be dependent on a face or a +/// point and if those entities are modified the custom feature needs to recompute to be +/// up to date. +class CustomFeatureDependency : public core::Base { +public: + + /// Returns the ID of this custom feature dependency. + std::string id() const; + + /// Gets and sets the entity associated with this dependency. + core::Ptr entity() const; + bool entity(const core::Ptr& value); + + /// Deletes this dependency from the custom feature. + /// Returns true if the delete was successful. + bool deleteMe(); + + /// Returns the custom feature this dependency is associated with. + core::Ptr parentCustomFeature() const; + + ADSK_FUSION_CUSTOMFEATUREDEPENDENCY_API static const char* classType(); + ADSK_FUSION_CUSTOMFEATUREDEPENDENCY_API const char* objectType() const override; + ADSK_FUSION_CUSTOMFEATUREDEPENDENCY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMFEATUREDEPENDENCY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* id_raw() const = 0; + virtual core::Base* entity_raw() const = 0; + virtual bool entity_raw(core::Base* value) = 0; + virtual bool deleteMe_raw() = 0; + virtual CustomFeature* parentCustomFeature_raw() const = 0; +}; + +// Inline wrappers + +inline std::string CustomFeatureDependency::id() const +{ + std::string res; + + char* p= id_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr CustomFeatureDependency::entity() const +{ + core::Ptr res = entity_raw(); + return res; +} + +inline bool CustomFeatureDependency::entity(const core::Ptr& value) +{ + return entity_raw(value.get()); +} + +inline bool CustomFeatureDependency::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline core::Ptr CustomFeatureDependency::parentCustomFeature() const +{ + core::Ptr res = parentCustomFeature_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMFEATUREDEPENDENCY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureEvents.h b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureEvents.h new file mode 100644 index 0000000..bf9d731 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureEvents.h @@ -0,0 +1,131 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Application/Events.h" +#include "../../Core/Application/EventHandler.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_CUSTOMFEATUREEVENTS_CPP__ +# define CUSTOMFEATUREEVENTS_API XI_EXPORT +# else +# define CUSTOMFEATUREEVENTS_API +# endif +#else +# define CUSTOMFEATUREEVENTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomFeature; + class CustomFeatureEventArgs; + class CustomFeatureEventHandler; +}} +namespace adsk { namespace core { + class Status; +}} + +namespace adsk { namespace fusion { + +/// A CustomFeature event is an event associated with handling changes to a custom feature. +class CustomFeatureEvent : public core::Event { +public: + + /// Add a handler to be notified when the file event occurs. + /// handler : The handler object to be called when this event is fired. + /// Returns true if the addition of the handler was successful. + bool add(CustomFeatureEventHandler* handler); + + /// Removes a handler from the event. + /// handler : The handler object to be removed from the event. + /// Returns true if removal of the handler was successful. + bool remove(CustomFeatureEventHandler* handler); + + CUSTOMFEATUREEVENTS_API static const char* classType(); + CUSTOMFEATUREEVENTS_API const char* objectType() const override; + CUSTOMFEATUREEVENTS_API void* queryInterface(const char* id) const override; + CUSTOMFEATUREEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool add_raw(CustomFeatureEventHandler* handler) = 0; + virtual bool remove_raw(CustomFeatureEventHandler* handler) = 0; +}; + +// Inline wrappers + +inline bool CustomFeatureEvent::add(CustomFeatureEventHandler* handler) +{ + bool res = add_raw(handler); + return res; +} + +inline bool CustomFeatureEvent::remove(CustomFeatureEventHandler* handler) +{ + bool res = remove_raw(handler); + return res; +} + +/// The CustomFeatureEventHandler is a client implemented class that can be added as +/// a handler to a CustomFeatureEvent. +class CustomFeatureEventHandler : public core::EventHandler { +public: + + /// The function called by Fusion 360 when the associated event is fired. + /// eventArgs : Returns an object that provides access to additional information associated with the event. + CUSTOMFEATUREEVENTS_API virtual void notify(const core::Ptr& eventArgs) = 0; +}; + +/// The CustomFeatureEventArgs provides information associated with a custom feature event. +class CustomFeatureEventArgs : public core::EventArgs { +public: + + /// Provides access to the custom feature that is being recomputed. + core::Ptr customFeature() const; + + /// Provides access to the Status object associated with this compute. If the compute is successful + /// you shouldn't do anything with this property. If the compute is not fully successful, you can + /// use this returned Status object to define any errors or warnings that occurred during the compute. + /// These warnings and errors will be shown to the user in the Alerts dialog. + core::Ptr computeStatus() const; + + CUSTOMFEATUREEVENTS_API static const char* classType(); + CUSTOMFEATUREEVENTS_API const char* objectType() const override; + CUSTOMFEATUREEVENTS_API void* queryInterface(const char* id) const override; + CUSTOMFEATUREEVENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomFeature* customFeature_raw() const = 0; + virtual core::Status* computeStatus_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomFeatureEventArgs::customFeature() const +{ + core::Ptr res = customFeature_raw(); + return res; +} + +inline core::Ptr CustomFeatureEventArgs::computeStatus() const +{ + core::Ptr res = computeStatus_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef CUSTOMFEATUREEVENTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureInput.h new file mode 100644 index 0000000..e42fae2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureInput.h @@ -0,0 +1,161 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMFEATUREINPUT_CPP__ +# define ADSK_FUSION_CUSTOMFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_CUSTOMFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a Ruled Surface feature. +class CustomFeatureInput : public core::Base { +public: + + /// Adds an entity or parameter this feature is dependent on. This is used by Fusion to know + /// when to recompute this feature and to control the behavior of the feature's node in the timeline. + /// id : An ID for this dependency. This is used to allow you to identify which dependency is which in the future. + /// The ID must be unique with respect to the other dependencies of this custom feature. + /// entity : The entity or parameter you want to add as a dependency. This can be a BRepBody, BRepFace, BrepEdge, + /// BRepVertex, a sketch, any sketch entities, a profile, any construction geometry, or any parameter. + /// Returns true if the dependency was successfully added. + bool addDependency(const std::string& id, const core::Ptr& entity); + + /// Defines the information needed to create a new custom parameter that will be associated with + /// this feature. A custom parameter appears as a model parameter and will be listed as a child of the + /// custom feature in the parameter dialog. The custom feature will automatically have a dependency + /// on this parameter. + /// id : An id for this parameter. This is used to allow you to identify the parameter in the future. This + /// must be unique with respect to all other parameters associated with this custom feature. It's needed + /// because the label does not need to be unique and the Fusion auto-generated name can be edited by + /// the user. + /// label : The label for this parameter as seen in the parameters dialog. This identifies to the user the purpose + /// of this parameter. For example, when you create an extrusion with a specific distance, there are two + /// parameters displayed in the parameters dialog with the labels "AlongDistance" and "TaperAngle". This does + /// not have to be unique because in the case of a fillet feature there can be multiple parameters all labeled "Radius". + /// value : ValueInput object that specifies the value of the parameter. If the ValueInput was created using a real, + /// the value will be interpreted using the internal unit for the unit type specified by the "units" argument. + /// For example, if the ValueInput was created using the real value 5 and the input to the "units" argument is + /// any valid length unit, the value will be interpreted as 5 centimeters since centimeters is the internal unit + /// for lengths. If the "units" argument is a valid angle unit the value will be interpreted as 5 radians. + /// If the ValueInput was created using a string, the string is used as-is for the expression of the parameter. + /// This means if there are units as part of the string it must evaluate to the same unit type as that specified + /// by the "units" argument and if no units are specified it will use the current default units specified for + /// the current document. For example, if the ValueInput was created with the string "5 in", then the "units" + /// argument must define any valid length so it is compatible. If the ValueInput was created with the string "5", + /// any unit type can be used and the result will be 5 of that unit. + /// When using a ValueInput created using a string, it's the same as creating a parameter in the user-interface. + /// You can specify any valid expression, i.e. "5", "5 in", "5 in / 2", "5 + Length", etc. and you can choose + /// from many different types of units. The only requirement is that the units must match in type. For example, + /// they must both be lengths, or they must both be angles. + /// units : The units to use for the value of the parameter. Units specified must match the units specified (if any) + /// in the ValueInput object. + /// To create a parameter with no units (unitless) you can specify either an empty string. + /// isVisible : Optional argument that specifies if the parameter will be visible in the parameters dialog or not. By + /// default the parameter will be visible. + /// This can be useful in cases where the feature can be edited to be in different states where a parameter + /// is only valid in a certain state. You can change the visibility based on the current state of the feature + /// and if that parameter should be available for edit. This implies that you create all the parameters that + /// might be needed and then change their visibility based on the current state of the feature. The parameters + /// that are not visible will not be returned by the ModelParameters collection and are only available through + /// the custom feature they're associated with. + /// Returns true if the definition of the model parameter was successfully added. + bool addCustomParameter(const std::string& id, const std::string& label, const core::Ptr& value, const std::string& units, bool isVisible = true); + + /// Sets the start and end features that the custom feature will group. A "feature" in this + /// case is an object that is visible in the timeline, such as modeling features, sketches, + /// and construction geometry. The custom feature will group the input start and end features + /// and all features between them in the timeline. + /// You can determine the current start and end features using the features property and use + /// the first and last features returned. If the custom feature contains a single feature, + /// you can use the same feature for both the start and end feature arguments. You can also + /// use null for both arguments to remove all features from a custom feature. The custom feature + /// still exists but will be empty, and the features will be displayed individually within the timeline. + /// startFeature : The first feature in the timeline that the custom feature will group. + /// endFeature : The last feature in the timeline that the custom feature will group. When creating a custom feature + /// that contains a single feature, this can be the same feature as the startFeature argument. + /// Returns true if setting the start and end features was successful. + bool setStartAndEndFeatures(const core::Ptr& startFeature, const core::Ptr& endFeature); + + /// Returns the features that are grouped by this custom feature. The start and end features and all of + /// the features between them in the timeline are returned. This includes all entities represented in + /// the timeline including modeling features, construction geometry, sketches, etc. + std::vector> features() const; + + ADSK_FUSION_CUSTOMFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_CUSTOMFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_CUSTOMFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool addDependency_raw(const char * id, core::Base* entity) = 0; + virtual bool addCustomParameter_raw(const char * id, const char * label, core::ValueInput* value, const char * units, bool isVisible) = 0; + virtual bool setStartAndEndFeatures_raw(core::Base* startFeature, core::Base* endFeature) = 0; + virtual core::Base** features_raw(size_t& return_size) const = 0; +}; + +// Inline wrappers + +inline bool CustomFeatureInput::addDependency(const std::string& id, const core::Ptr& entity) +{ + bool res = addDependency_raw(id.c_str(), entity.get()); + return res; +} + +inline bool CustomFeatureInput::addCustomParameter(const std::string& id, const std::string& label, const core::Ptr& value, const std::string& units, bool isVisible) +{ + bool res = addCustomParameter_raw(id.c_str(), label.c_str(), value.get(), units.c_str(), isVisible); + return res; +} + +inline bool CustomFeatureInput::setStartAndEndFeatures(const core::Ptr& startFeature, const core::Ptr& endFeature) +{ + bool res = setStartAndEndFeatures_raw(startFeature.get(), endFeature.get()); + return res; +} + +inline std::vector> CustomFeatureInput::features() const +{ + std::vector> res; + size_t s; + + core::Base** p= features_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureParameter.h b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureParameter.h new file mode 100644 index 0000000..2385e11 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureParameter.h @@ -0,0 +1,105 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../Fusion/ModelParameter.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMFEATUREPARAMETER_CPP__ +# define ADSK_FUSION_CUSTOMFEATUREPARAMETER_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMFEATUREPARAMETER_API +# endif +#else +# define ADSK_FUSION_CUSTOMFEATUREPARAMETER_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomFeature; +}} + +namespace adsk { namespace fusion { + +/// A custom parameter is a parameter that was created as the result of a custom feature +/// being created. It is associated with the custom feature and it's lifetime is the same +/// as the custom feature that owns it. +class CustomFeatureParameter : public ModelParameter { +public: + + /// Returns the ID of this custom feature parameter. + std::string id() const; + + /// Gets and sets if this parameter is visible in the parameters dialog. By default, all new parameters are visible. + /// This can be useful in cases where the feature can be edited to be in different states where a parameter + /// is only valid in a certain state. You can change the visibility based on the current state of the feature + /// and if that parameter should be available for edit. This implies that you create all the parameters that + /// might be needed and then change their visibility based on the current state of the feature. The parameters + /// that are not visible will not be returned by the ModelParameters collection and are only available through + /// the custom feature they're associated with. + bool isVisible() const; + bool isVisible(bool value); + + /// Returns the custom feature this parameter is associated with. + core::Ptr parentCustomFeature() const; + + ADSK_FUSION_CUSTOMFEATUREPARAMETER_API static const char* classType(); + ADSK_FUSION_CUSTOMFEATUREPARAMETER_API const char* objectType() const override; + ADSK_FUSION_CUSTOMFEATUREPARAMETER_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMFEATUREPARAMETER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* id_raw() const = 0; + virtual bool isVisible_raw() const = 0; + virtual bool isVisible_raw(bool value) = 0; + virtual CustomFeature* parentCustomFeature_raw() const = 0; +}; + +// Inline wrappers + +inline std::string CustomFeatureParameter::id() const +{ + std::string res; + + char* p= id_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomFeatureParameter::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline bool CustomFeatureParameter::isVisible(bool value) +{ + return isVisible_raw(value); +} + +inline core::Ptr CustomFeatureParameter::parentCustomFeature() const +{ + core::Ptr res = parentCustomFeature_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMFEATUREPARAMETER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureParameters.h b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureParameters.h new file mode 100644 index 0000000..134b7b1 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatureParameters.h @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMFEATUREPARAMETERS_CPP__ +# define ADSK_FUSION_CUSTOMFEATUREPARAMETERS_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMFEATUREPARAMETERS_API +# endif +#else +# define ADSK_FUSION_CUSTOMFEATUREPARAMETERS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomFeatureParameter; +}} + +namespace adsk { namespace fusion { + +/// A collection of custom parameters associated with a particular custom feature. +class CustomFeatureParameters : public core::Base { +public: + + /// Function that returns the specified custom parameter feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of CustomFeatureParameter objects in the collection. + size_t count() const; + + /// Function that returns the specified CustomParameter object given its ID. + /// id : The ID of the custom parameter, which was assigned when the parameter was defined and the custom feature was created. + /// Returns the specified item or null if the specified ID was not found. + core::Ptr itemById(const std::string& id) const; + + ADSK_FUSION_CUSTOMFEATUREPARAMETERS_API static const char* classType(); + ADSK_FUSION_CUSTOMFEATUREPARAMETERS_API const char* objectType() const override; + ADSK_FUSION_CUSTOMFEATUREPARAMETERS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMFEATUREPARAMETERS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomFeatureParameter* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual CustomFeatureParameter* itemById_raw(const char * id) const = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomFeatureParameters::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t CustomFeatureParameters::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CustomFeatureParameters::itemById(const std::string& id) const +{ + core::Ptr res = itemById_raw(id.c_str()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMFEATUREPARAMETERS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CustomFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatures.h new file mode 100644 index 0000000..b3c49bf --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CustomFeatures.h @@ -0,0 +1,129 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMFEATURES_CPP__ +# define ADSK_FUSION_CUSTOMFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMFEATURES_API +# endif +#else +# define ADSK_FUSION_CUSTOMFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomFeature; + class CustomFeatureDefinition; + class CustomFeatureInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing custom features in a component +/// and supports the ability to create new custom features. +class CustomFeatures : public core::Base { +public: + + /// Function that returns the specified ruled surface feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of CustomFeature objects in the collection. + size_t count() const; + + /// Function that returns the specified CustomFeature feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// Creates a new input object that you use to define a custom feature. Creating an input object doesn't + /// create the feature but provides a way to gather all of the input needed to create a custom feature. + /// To create the custom feature, the fully defined input object is passed to the add method. + /// definition : The CustomFeatureDefinition for the type of custom feature being created. + /// Returns the newly created CustomFeatureInput object or null in the case of invalid input. + core::Ptr createInput(const core::Ptr& definition) const; + + /// Creates a new custom feature. + /// input : The CustomFeatureInput object that defines the information needed to create a custom feature. + /// Returns the newly created CustomFeature. + core::Ptr add(const core::Ptr& input); + + typedef CustomFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_CUSTOMFEATURES_API static const char* classType(); + ADSK_FUSION_CUSTOMFEATURES_API const char* objectType() const override; + ADSK_FUSION_CUSTOMFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual CustomFeature* itemByName_raw(const char * name) const = 0; + virtual CustomFeatureInput* createInput_raw(CustomFeatureDefinition* definition) const = 0; + virtual CustomFeature* add_raw(CustomFeatureInput* input) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t CustomFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CustomFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline core::Ptr CustomFeatures::createInput(const core::Ptr& definition) const +{ + core::Ptr res = createInput_raw(definition.get()); + return res; +} + +inline core::Ptr CustomFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +template inline void CustomFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CustomNamedValues.h b/usr/autodesk/CPP/include/Fusion/Features/CustomNamedValues.h new file mode 100644 index 0000000..3eba916 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CustomNamedValues.h @@ -0,0 +1,142 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMNAMEDVALUES_CPP__ +# define ADSK_FUSION_CUSTOMNAMEDVALUES_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMNAMEDVALUES_API +# endif +#else +# define ADSK_FUSION_CUSTOMNAMEDVALUES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A collection of named values. The values are strings that Fusion stores but can be +/// anything you choose. If you have several things you need to save you can choose to +/// combine the data into a JSON or XML representation and save it as a single custom value +/// or create a new custom value or each unique value you want to store. Fusion doesn't care +/// what the value is or what it represents but only saves and provides access to it. +class CustomNamedValues : public core::Base { +public: + + /// Adds or updates a value. If the specified ID does not exist, a new named value is + /// added. If the ID does exist, the named value is updated with the specified value. + /// id : The ID of the value to create or change. + /// value : The string to assign to the value. + /// Returns true is successful and false if it failed. + bool addOrSetValue(const std::string& id, const std::string& value); + + /// Function that returns if a value with the specified ID exists or not. + /// id : The ID of the value to check if it exists. + /// Returns true if a value with the ID exists. + bool isExistingValue(const std::string& id); + + /// Function that returns the specified value given its ID. + /// id : The ID of the value, which was assigned when the value was created. + /// Returns the value or an empty string if the specified ID was not found. + std::string value(const std::string& id); + + /// Function that returns the name of a value specified by its index. + /// index : The index of the item within the collection to return the name of. The first item in the collection has an index of 0 + /// and the last item is the count of this collection minus 1. + /// Returns the ID of the specified item or asserts if an out of bounds index is used. + std::string idByIndex(size_t index); + + /// The number of values in the collection. + size_t count() const; + + /// Removes the specified value from the collection. + /// id : The ID of the value to remove. + /// Returns true if the value was successfully removed and false if it failed. + /// Failure is typically because the specified ID does not exist within the collection. + bool remove(const std::string& id); + + ADSK_FUSION_CUSTOMNAMEDVALUES_API static const char* classType(); + ADSK_FUSION_CUSTOMNAMEDVALUES_API const char* objectType() const override; + ADSK_FUSION_CUSTOMNAMEDVALUES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMNAMEDVALUES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool addOrSetValue_raw(const char * id, const char * value) = 0; + virtual bool isExistingValue_raw(const char * id) = 0; + virtual char* value_raw(const char * id) = 0; + virtual char* idByIndex_raw(size_t index) = 0; + virtual size_t count_raw() const = 0; + virtual bool remove_raw(const char * id) = 0; +}; + +// Inline wrappers + +inline bool CustomNamedValues::addOrSetValue(const std::string& id, const std::string& value) +{ + bool res = addOrSetValue_raw(id.c_str(), value.c_str()); + return res; +} + +inline bool CustomNamedValues::isExistingValue(const std::string& id) +{ + bool res = isExistingValue_raw(id.c_str()); + return res; +} + +inline std::string CustomNamedValues::value(const std::string& id) +{ + std::string res; + + char* p= value_raw(id.c_str()); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string CustomNamedValues::idByIndex(size_t index) +{ + std::string res; + + char* p= idByIndex_raw(index); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline size_t CustomNamedValues::count() const +{ + size_t res = count_raw(); + return res; +} + +inline bool CustomNamedValues::remove(const std::string& id) +{ + bool res = remove_raw(id.c_str()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMNAMEDVALUES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CutPasteBodies.h b/usr/autodesk/CPP/include/Fusion/Features/CutPasteBodies.h new file mode 100644 index 0000000..08e39cb --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CutPasteBodies.h @@ -0,0 +1,114 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUTPASTEBODIES_CPP__ +# define ADSK_FUSION_CUTPASTEBODIES_API XI_EXPORT +# else +# define ADSK_FUSION_CUTPASTEBODIES_API +# endif +#else +# define ADSK_FUSION_CUTPASTEBODIES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CutPasteBody; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing cut-paste features in a design. +/// These are created in the UI by cutting and then pasting a B-Rep body. +class CutPasteBodies : public core::Base { +public: + + /// Function that returns the specified Cut/Paste Body feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified Cut/Paste Body feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of Cut/Paste Body features in the collection. + size_t count() const; + + /// Cuts and copies the specified body into the component that owns this CutPasteBodies collection. + /// This is effectively the equivalent of moving a body. + /// sourceBody : Either an ObjectCollection of BRepBodies or a single BRepBody object to cut. + /// Returns the newly created BRepBody object or null in the case of failure. + core::Ptr add(const core::Ptr& sourceBody); + + typedef CutPasteBody iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_CUTPASTEBODIES_API static const char* classType(); + ADSK_FUSION_CUTPASTEBODIES_API const char* objectType() const override; + ADSK_FUSION_CUTPASTEBODIES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUTPASTEBODIES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CutPasteBody* item_raw(size_t index) const = 0; + virtual CutPasteBody* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual CutPasteBody* add_raw(core::Base* sourceBody) = 0; +}; + +// Inline wrappers + +inline core::Ptr CutPasteBodies::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr CutPasteBodies::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t CutPasteBodies::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CutPasteBodies::add(const core::Ptr& sourceBody) +{ + core::Ptr res = add_raw(sourceBody.get()); + return res; +} + +template inline void CutPasteBodies::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUTPASTEBODIES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CutPasteBody.h b/usr/autodesk/CPP/include/Fusion/Features/CutPasteBody.h new file mode 100644 index 0000000..9ef672d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CutPasteBody.h @@ -0,0 +1,67 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUTPASTEBODY_CPP__ +# define ADSK_FUSION_CUTPASTEBODY_API XI_EXPORT +# else +# define ADSK_FUSION_CUTPASTEBODY_API +# endif +#else +# define ADSK_FUSION_CUTPASTEBODY_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing Cut/Paste Body feature in a design. +class CutPasteBody : public Feature { +public: + + /// Returns the bodies that were cut to create the result bodies of this feature. An ObjectCollection + /// is returned that will contain the original bodies. It's possible that the collection can be empty + /// or contain less than the number of bodies originally copied. This happens in the case where a body + /// has been deleted or consumed by some other operation. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr sourceBody() const; + + ADSK_FUSION_CUTPASTEBODY_API static const char* classType(); + ADSK_FUSION_CUTPASTEBODY_API const char* objectType() const override; + ADSK_FUSION_CUTPASTEBODY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUTPASTEBODY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* sourceBody_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr CutPasteBody::sourceBody() const +{ + core::Ptr res = sourceBody_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUTPASTEBODY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CylinderFeature.h b/usr/autodesk/CPP/include/Fusion/Features/CylinderFeature.h new file mode 100644 index 0000000..bd063ca --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CylinderFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CYLINDERFEATURE_CPP__ +# define ADSK_FUSION_CYLINDERFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_CYLINDERFEATURE_API +# endif +#else +# define ADSK_FUSION_CYLINDERFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing cylinder feature in a design. +class CylinderFeature : public Feature { +public: + + ADSK_FUSION_CYLINDERFEATURE_API static const char* classType(); + ADSK_FUSION_CYLINDERFEATURE_API const char* objectType() const override; + ADSK_FUSION_CYLINDERFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CYLINDERFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CYLINDERFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/CylinderFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/CylinderFeatures.h new file mode 100644 index 0000000..d10f0c1 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/CylinderFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CYLINDERFEATURES_CPP__ +# define ADSK_FUSION_CYLINDERFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_CYLINDERFEATURES_API +# endif +#else +# define ADSK_FUSION_CYLINDERFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CylinderFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing cylinder features in a design. +class CylinderFeatures : public core::Base { +public: + + /// Function that returns the specified cylinder feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified cylinder feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of cylinder features in the collection. + size_t count() const; + + typedef CylinderFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_CYLINDERFEATURES_API static const char* classType(); + ADSK_FUSION_CYLINDERFEATURES_API const char* objectType() const override; + ADSK_FUSION_CYLINDERFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CYLINDERFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CylinderFeature* item_raw(size_t index) const = 0; + virtual CylinderFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr CylinderFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr CylinderFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t CylinderFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void CylinderFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CYLINDERFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/DeleteFaceFeature.h b/usr/autodesk/CPP/include/Fusion/Features/DeleteFaceFeature.h new file mode 100644 index 0000000..ed313e5 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/DeleteFaceFeature.h @@ -0,0 +1,122 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_DELETEFACEFEATURE_CPP__ +# define ADSK_FUSION_DELETEFACEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_DELETEFACEFEATURE_API +# endif +#else +# define ADSK_FUSION_DELETEFACEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing DeleteFaceFeature object in a design. +/// The SurfaceDeleteFaceFeature and DeleteFaceFeature differ in that the SurfaceDeleteFaceFeature +/// can delete any face without any restrictions. If the body is a solid, it will become a surface +/// when the first face is deleted. The specified face is deleted without any other changes being +/// made to the body. The DeleteFaceFeature deletes the specified face and also modifies the other faces +/// in the body to heal or fill in the area of the deleted face. This means that a solid body will +/// remain solid. +class DeleteFaceFeature : public Feature { +public: + + /// Gets and sets the set of faces that are deleted by this feature. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// Setting this property can fail if Fusion 360 is unable to heal the body after + /// deleting the specified faces. + std::vector> deletedFaces() const; + bool deletedFaces(const std::vector>& value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_DELETEFACEFEATURE_API static const char* classType(); + ADSK_FUSION_DELETEFACEFEATURE_API const char* objectType() const override; + ADSK_FUSION_DELETEFACEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_DELETEFACEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace** deletedFaces_raw(size_t& return_size) const = 0; + virtual bool deletedFaces_raw(BRepFace** value, size_t value_size) = 0; + virtual DeleteFaceFeature* nativeObject_raw() const = 0; + virtual DeleteFaceFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline std::vector> DeleteFaceFeature::deletedFaces() const +{ + std::vector> res; + size_t s; + + BRepFace** p= deletedFaces_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool DeleteFaceFeature::deletedFaces(const std::vector>& value) +{ + BRepFace** value_ = new BRepFace*[value.size()]; + for(size_t i=0; i DeleteFaceFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr DeleteFaceFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_DELETEFACEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/DeleteFaceFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/DeleteFaceFeatures.h new file mode 100644 index 0000000..8b8ee66 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/DeleteFaceFeatures.h @@ -0,0 +1,122 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_DELETEFACEFEATURES_CPP__ +# define ADSK_FUSION_DELETEFACEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_DELETEFACEFEATURES_API +# endif +#else +# define ADSK_FUSION_DELETEFACEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class DeleteFaceFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing DeleteFaceFeature features in a component +/// and supports the ability to create new DeleteFaceFeature features. +/// The SurfaceDeleteFaceFeature and DeleteFaceFeature differ in that the SurfaceDeleteFaceFeature +/// can delete any face without any restrictions. If the body is a solid, it will become a surface +/// when the first face is deleted. The specified face is deleted without any other changes being +/// made to the body. The DeleteFaceFeature deletes the specified face and also modifies the other faces +/// in the body to heal or fill in the area of the deleted face. This means that a solid body will +/// remain solid. +class DeleteFaceFeatures : public core::Base { +public: + + /// Function that returns the specified DeleteFaceFeature object using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified DeleteFaceFeature object using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of DeleteFaceFeature objects in the collection. + size_t count() const; + + /// Creates a new SurfaceDeleteFace feature. This deletes the specified faces + /// from their bodies and attempts to heal the body. The method will fail if + /// the body cannot be healed. This is equivalent to selecting and deleting + /// faces when in the Patch workspace. + /// facesToDelete : A single BRepFace or an ObjectCollection containing multiple BRepFace objects. + /// Returns the newly created DeleteFaceFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& facesToDelete); + + typedef DeleteFaceFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_DELETEFACEFEATURES_API static const char* classType(); + ADSK_FUSION_DELETEFACEFEATURES_API const char* objectType() const override; + ADSK_FUSION_DELETEFACEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_DELETEFACEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual DeleteFaceFeature* item_raw(size_t index) const = 0; + virtual DeleteFaceFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual DeleteFaceFeature* add_raw(core::Base* facesToDelete) = 0; +}; + +// Inline wrappers + +inline core::Ptr DeleteFaceFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr DeleteFaceFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t DeleteFaceFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr DeleteFaceFeatures::add(const core::Ptr& facesToDelete) +{ + core::Ptr res = add_raw(facesToDelete.get()); + return res; +} + +template inline void DeleteFaceFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_DELETEFACEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/DistanceAndAngleChamferEdgeSet.h b/usr/autodesk/CPP/include/Fusion/Features/DistanceAndAngleChamferEdgeSet.h new file mode 100644 index 0000000..6d159b3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/DistanceAndAngleChamferEdgeSet.h @@ -0,0 +1,117 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ChamferEdgeSet.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_DISTANCEANDANGLECHAMFEREDGESET_CPP__ +# define ADSK_FUSION_DISTANCEANDANGLECHAMFEREDGESET_API XI_EXPORT +# else +# define ADSK_FUSION_DISTANCEANDANGLECHAMFEREDGESET_API +# endif +#else +# define ADSK_FUSION_DISTANCEANDANGLECHAMFEREDGESET_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the edges and the parameter associated with a chord length fillet. +class DistanceAndAngleChamferEdgeSet : public ChamferEdgeSet { +public: + + /// Gets and sets the edges that will be chamfered. This collection can contain BRepEdge, BRepFace, + /// and Feature objects. If BRepFace or Feature are objects are provided, all of the edges associated + /// with those objects will be chamfered. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr edges() const; + bool edges(const core::Ptr& value); + + /// Returns the model parameter that controls the offset distance of the chamfer. + /// You can edit the distance by using the properties on the returned ModelParameter object. + core::Ptr distance() const; + + /// Returns the model parameter that controls the angle of the chamfer. + /// You can edit the distance by using the properties on the returned ModelParameter object. + core::Ptr angle() const; + + /// Gets and sets if the chamfer is flipped. This swaps the directions for distance one and two. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isFlipped() const; + bool isFlipped(bool value); + + ADSK_FUSION_DISTANCEANDANGLECHAMFEREDGESET_API static const char* classType(); + ADSK_FUSION_DISTANCEANDANGLECHAMFEREDGESET_API const char* objectType() const override; + ADSK_FUSION_DISTANCEANDANGLECHAMFEREDGESET_API void* queryInterface(const char* id) const override; + ADSK_FUSION_DISTANCEANDANGLECHAMFEREDGESET_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* edges_raw() const = 0; + virtual bool edges_raw(core::ObjectCollection* value) = 0; + virtual ModelParameter* distance_raw() const = 0; + virtual ModelParameter* angle_raw() const = 0; + virtual bool isFlipped_raw() const = 0; + virtual bool isFlipped_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr DistanceAndAngleChamferEdgeSet::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline bool DistanceAndAngleChamferEdgeSet::edges(const core::Ptr& value) +{ + return edges_raw(value.get()); +} + +inline core::Ptr DistanceAndAngleChamferEdgeSet::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline core::Ptr DistanceAndAngleChamferEdgeSet::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline bool DistanceAndAngleChamferEdgeSet::isFlipped() const +{ + bool res = isFlipped_raw(); + return res; +} + +inline bool DistanceAndAngleChamferEdgeSet::isFlipped(bool value) +{ + return isFlipped_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_DISTANCEANDANGLECHAMFEREDGESET_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/DistanceAndAngleChamferTypeDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/DistanceAndAngleChamferTypeDefinition.h new file mode 100644 index 0000000..1750764 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/DistanceAndAngleChamferTypeDefinition.h @@ -0,0 +1,74 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ChamferTypeDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_DISTANCEANDANGLECHAMFERTYPEDEFINITION_CPP__ +# define ADSK_FUSION_DISTANCEANDANGLECHAMFERTYPEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_DISTANCEANDANGLECHAMFERTYPEDEFINITION_API +# endif +#else +# define ADSK_FUSION_DISTANCEANDANGLECHAMFERTYPEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} + +namespace adsk { namespace fusion { + +/// Provides information to create a chamfer that is defined by a distance from the edge and an angle. +class DistanceAndAngleChamferTypeDefinition : public ChamferTypeDefinition { +public: + + /// Returns the parameter controlling the distance. You can edit the distance + /// by editing the value of the parameter object. + core::Ptr distance() const; + + /// Returns the parameter controlling the angle. You can edit the angle + /// by editing the value of the parameter object. + core::Ptr angle() const; + + ADSK_FUSION_DISTANCEANDANGLECHAMFERTYPEDEFINITION_API static const char* classType(); + ADSK_FUSION_DISTANCEANDANGLECHAMFERTYPEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_DISTANCEANDANGLECHAMFERTYPEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_DISTANCEANDANGLECHAMFERTYPEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ModelParameter* distance_raw() const = 0; + virtual ModelParameter* angle_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr DistanceAndAngleChamferTypeDefinition::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline core::Ptr DistanceAndAngleChamferTypeDefinition::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_DISTANCEANDANGLECHAMFERTYPEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/DistanceExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/DistanceExtentDefinition.h new file mode 100644 index 0000000..408ee24 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/DistanceExtentDefinition.h @@ -0,0 +1,101 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_DISTANCEEXTENTDEFINITION_CPP__ +# define ADSK_FUSION_DISTANCEEXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_DISTANCEEXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_DISTANCEEXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Defines the inputs for a distance ExtentDefinition object. +/// This feature extent type defines the distance as well as whether the extent is symmetric +/// or in only one direction. If the extent is not symmetric, a positive or negative distance +/// can be used to control the direction. +/// For a hole, the IsSymmetric property value will always be false. +class DistanceExtentDefinition : public ExtentDefinition { +public: + + /// Gets and sets if the distance extent is symmetric or not + /// For a hole this property will always return false and setting it is ignored. + bool isSymmetric() const; + bool isSymmetric(bool value); + + /// Returns the parameter controlling the distance. You can edit the distance + /// by editing the value of the parameter object. + core::Ptr distance() const; + + /// Statically creates a new DistanceExtentDefinition object. This is used as input when + /// defining the extents of a feature to be a specified distance. + /// distance : A ValueInput that defines the distance of the extrusion. + /// Returns the newly created DistanceExtentDefinition or null in the case of failure. + static core::Ptr create(const core::Ptr& distance); + + ADSK_FUSION_DISTANCEEXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_DISTANCEEXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_DISTANCEEXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_DISTANCEEXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isSymmetric_raw() const = 0; + virtual bool isSymmetric_raw(bool value) = 0; + virtual ModelParameter* distance_raw() const = 0; + ADSK_FUSION_DISTANCEEXTENTDEFINITION_API static DistanceExtentDefinition* create_raw(core::ValueInput* distance); +}; + +// Inline wrappers + +inline bool DistanceExtentDefinition::isSymmetric() const +{ + bool res = isSymmetric_raw(); + return res; +} + +inline bool DistanceExtentDefinition::isSymmetric(bool value) +{ + return isSymmetric_raw(value); +} + +inline core::Ptr DistanceExtentDefinition::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline core::Ptr DistanceExtentDefinition::create(const core::Ptr& distance) +{ + core::Ptr res = create_raw(distance.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_DISTANCEEXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/DraftFeature.h b/usr/autodesk/CPP/include/Fusion/Features/DraftFeature.h new file mode 100644 index 0000000..bf87355 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/DraftFeature.h @@ -0,0 +1,226 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_DRAFTFEATURE_CPP__ +# define ADSK_FUSION_DRAFTFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_DRAFTFEATURE_API +# endif +#else +# define ADSK_FUSION_DRAFTFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; + class ExtentDefinition; + class Occurrence; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing draft feature in a design. +class DraftFeature : public Feature { +public: + + /// Gets and sets the input faces. + /// If isTangentChain is true, all the faces that are tangentially connected to the input faces (if any) will also be included. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + std::vector> inputFaces() const; + bool inputFaces(const std::vector>& value); + + /// Gets and sets the plane that defines the direction in which the draft is applied. This can be a planar BrepFace, or a ConstructionPlane. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr plane() const; + bool plane(const core::Ptr& value); + + /// Gets and sets if any faces that are tangentially connected to any of + /// the input faces will also be included in setting InputEntities. It defaults to true. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isTangentChain() const; + bool isTangentChain(bool value); + + /// Gets and sets if the direction of the draft is flipped. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isDirectionFlipped() const; + bool isDirectionFlipped(bool value); + + /// Gets the definition object that specifies how the draft is defined. Modifying the + /// definition object will cause the draft to recompute. This can return either an + /// AngleExtentDefinition or TwoSidesAngleExtentDefinition object. This property + /// returns nothing in the case where the feature is non-parametric. Use this property + /// to access the parameters controlling the draft and whether the draft is symmetric or not. + core::Ptr draftDefinition() const; + + /// Changes the definition of the feature so that a single angle is used for all drafts. + /// If the isSymmetric is true then the faces are split along the parting plane and drafted + /// independently using the same angle. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// isSymmetric : Set to 'true' if the faces are to be split along the plane and drafted symmetrically. This + /// will have the side effect of setting the isSymmetric property to the same value. + /// angle : The ValueInput object that defines the angle of the draft. This can be a positive or negative + /// value which will affect the direction of the draft along with the isDirectionFlipped property. + /// Returns true if successful + bool setSingleAngle(bool isSymmetric, const core::Ptr& angle); + + /// Changes the definition of the feature so that the surfaces are split along the draft plane and + /// the faces on each side of the plane are drafted independently from the other side. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// angleOne : The ValueInput object that defines the angle for the faces on the first side of the draft plane. + /// angleTwo : The ValueInput object that defines the angle for the faces on the second side of the draft plane. + /// Returns true if successful + bool setTwoAngles(const core::Ptr& angleOne, const core::Ptr& angleTwo); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_DRAFTFEATURE_API static const char* classType(); + ADSK_FUSION_DRAFTFEATURE_API const char* objectType() const override; + ADSK_FUSION_DRAFTFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_DRAFTFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace** inputFaces_raw(size_t& return_size) const = 0; + virtual bool inputFaces_raw(BRepFace** value, size_t value_size) = 0; + virtual core::Base* plane_raw() const = 0; + virtual bool plane_raw(core::Base* value) = 0; + virtual bool isTangentChain_raw() const = 0; + virtual bool isTangentChain_raw(bool value) = 0; + virtual bool isDirectionFlipped_raw() const = 0; + virtual bool isDirectionFlipped_raw(bool value) = 0; + virtual ExtentDefinition* draftDefinition_raw() const = 0; + virtual bool setSingleAngle_raw(bool isSymmetric, core::ValueInput* angle) = 0; + virtual bool setTwoAngles_raw(core::ValueInput* angleOne, core::ValueInput* angleTwo) = 0; + virtual DraftFeature* nativeObject_raw() const = 0; + virtual DraftFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline std::vector> DraftFeature::inputFaces() const +{ + std::vector> res; + size_t s; + + BRepFace** p= inputFaces_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool DraftFeature::inputFaces(const std::vector>& value) +{ + BRepFace** value_ = new BRepFace*[value.size()]; + for(size_t i=0; i DraftFeature::plane() const +{ + core::Ptr res = plane_raw(); + return res; +} + +inline bool DraftFeature::plane(const core::Ptr& value) +{ + return plane_raw(value.get()); +} + +inline bool DraftFeature::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline bool DraftFeature::isTangentChain(bool value) +{ + return isTangentChain_raw(value); +} + +inline bool DraftFeature::isDirectionFlipped() const +{ + bool res = isDirectionFlipped_raw(); + return res; +} + +inline bool DraftFeature::isDirectionFlipped(bool value) +{ + return isDirectionFlipped_raw(value); +} + +inline core::Ptr DraftFeature::draftDefinition() const +{ + core::Ptr res = draftDefinition_raw(); + return res; +} + +inline bool DraftFeature::setSingleAngle(bool isSymmetric, const core::Ptr& angle) +{ + bool res = setSingleAngle_raw(isSymmetric, angle.get()); + return res; +} + +inline bool DraftFeature::setTwoAngles(const core::Ptr& angleOne, const core::Ptr& angleTwo) +{ + bool res = setTwoAngles_raw(angleOne.get(), angleTwo.get()); + return res; +} + +inline core::Ptr DraftFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr DraftFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_DRAFTFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/DraftFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/DraftFeatureInput.h new file mode 100644 index 0000000..58419dc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/DraftFeatureInput.h @@ -0,0 +1,228 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_DRAFTFEATUREINPUT_CPP__ +# define ADSK_FUSION_DRAFTFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_DRAFTFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_DRAFTFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepFace; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a draft +/// feature. +class DraftFeatureInput : public core::Base { +public: + + /// Gets and sets the input faces. + /// If IsTangentChain is true, all the faces that are tangentially connected to the input faces (if any) will also be included. + std::vector> inputFaces() const; + bool inputFaces(const std::vector>& value); + + /// Gets and sets the plane that defines the direction in which the draft is applied. This can be a planar BrepFace, or a ConstructionPlane. + core::Ptr plane() const; + bool plane(const core::Ptr& value); + + /// Gets and sets if any faces that are tangentially connected to any of + /// the input faces will also be included in setting InputEntities. It defaults to true. + bool isTangentChain() const; + bool isTangentChain(bool value); + + /// Gets and sets if the direction of the draft is flipped. + bool isDirectionFlipped() const; + bool isDirectionFlipped(bool value); + + /// Defines the draft to be defined so that a single angle is used for all drafts. + /// If the isSymmetric is true then the faces are split along the parting plane and drafted + /// independently using the same angle. + /// isSymmetric : Set to 'true' if the faces are to be split along the plane and drafted symmetrically. This + /// will have the side effect of setting the isSymmetric property to the same value. + /// angle : The ValueInput object that defines the angle of the draft. This can be a positive or negative + /// value which will affect the direction of the draft along with the isDirectionFlipped property. + /// Returns true if successful + bool setSingleAngle(bool isSymmetric, const core::Ptr& angle); + + /// Defines both angles to use when the surfaces are split along the draft plane and + /// the faces on each side of the plane are drafted independently from the other side. + /// angleOne : The ValueInput object that defines the angle for the faces on the first side of the draft plane. + /// angleTwo : The ValueInput object that defines the angle for the faces on the second side of the draft plane. + /// Returns true if successful + bool setTwoAngles(const core::Ptr& angleOne, const core::Ptr& angleTwo); + + /// Gets the first, or the only angle in the case of a single angle definition. + core::Ptr angleOne() const; + + /// Gets the second angle. This can be null in the case where a single angle definition is used. + core::Ptr angleTwo() const; + + /// Gets if the draft is symmetric from the draft plane. This only applies in the case where two + /// angles have been specified and should be ignored otherwise. + bool isSymmetric() const; + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_DRAFTFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_DRAFTFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_DRAFTFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_DRAFTFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace** inputFaces_raw(size_t& return_size) const = 0; + virtual bool inputFaces_raw(BRepFace** value, size_t value_size) = 0; + virtual core::Base* plane_raw() const = 0; + virtual bool plane_raw(core::Base* value) = 0; + virtual bool isTangentChain_raw() const = 0; + virtual bool isTangentChain_raw(bool value) = 0; + virtual bool isDirectionFlipped_raw() const = 0; + virtual bool isDirectionFlipped_raw(bool value) = 0; + virtual bool setSingleAngle_raw(bool isSymmetric, core::ValueInput* angle) = 0; + virtual bool setTwoAngles_raw(core::ValueInput* angleOne, core::ValueInput* angleTwo) = 0; + virtual core::ValueInput* angleOne_raw() const = 0; + virtual core::ValueInput* angleTwo_raw() const = 0; + virtual bool isSymmetric_raw() const = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline std::vector> DraftFeatureInput::inputFaces() const +{ + std::vector> res; + size_t s; + + BRepFace** p= inputFaces_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool DraftFeatureInput::inputFaces(const std::vector>& value) +{ + BRepFace** value_ = new BRepFace*[value.size()]; + for(size_t i=0; i DraftFeatureInput::plane() const +{ + core::Ptr res = plane_raw(); + return res; +} + +inline bool DraftFeatureInput::plane(const core::Ptr& value) +{ + return plane_raw(value.get()); +} + +inline bool DraftFeatureInput::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline bool DraftFeatureInput::isTangentChain(bool value) +{ + return isTangentChain_raw(value); +} + +inline bool DraftFeatureInput::isDirectionFlipped() const +{ + bool res = isDirectionFlipped_raw(); + return res; +} + +inline bool DraftFeatureInput::isDirectionFlipped(bool value) +{ + return isDirectionFlipped_raw(value); +} + +inline bool DraftFeatureInput::setSingleAngle(bool isSymmetric, const core::Ptr& angle) +{ + bool res = setSingleAngle_raw(isSymmetric, angle.get()); + return res; +} + +inline bool DraftFeatureInput::setTwoAngles(const core::Ptr& angleOne, const core::Ptr& angleTwo) +{ + bool res = setTwoAngles_raw(angleOne.get(), angleTwo.get()); + return res; +} + +inline core::Ptr DraftFeatureInput::angleOne() const +{ + core::Ptr res = angleOne_raw(); + return res; +} + +inline core::Ptr DraftFeatureInput::angleTwo() const +{ + core::Ptr res = angleTwo_raw(); + return res; +} + +inline bool DraftFeatureInput::isSymmetric() const +{ + bool res = isSymmetric_raw(); + return res; +} + +inline core::Ptr DraftFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool DraftFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_DRAFTFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/DraftFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/DraftFeatures.h new file mode 100644 index 0000000..7496954 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/DraftFeatures.h @@ -0,0 +1,141 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_DRAFTFEATURES_CPP__ +# define ADSK_FUSION_DRAFTFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_DRAFTFEATURES_API +# endif +#else +# define ADSK_FUSION_DRAFTFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; + class DraftFeature; + class DraftFeatureInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing draft features in a component +/// and supports the ability to create new draft features. +class DraftFeatures : public core::Base { +public: + + /// Function that returns the specified draft feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of draft features in the collection. + size_t count() const; + + /// Creates a DraftFeatureInput object. Use properties and methods on this object + /// to define the draft you want to create and then use the Add method, passing in + /// the DraftFeatureInput object. + /// inputFaces : BRepFace array that contains the faces to which draft will be applied. + /// The picked point on face is always the point returned from pointOnFace property of the first BRepFace in this collection. + /// plane : Input object that defines the direction in which the draft is applied. This can be a planar BrepFace, or a ConstructionPlane. + /// isTangentChain : A boolean value for setting whether or not faces that are tangentially connected to + /// any of the input faces (if any) will also be included. It defaults to true. + /// Returns the newly created DraftFeatureInput object or null if the creation failed. + core::Ptr createInput(const std::vector>& inputFaces, const core::Ptr& plane, bool isTangentChain = true) const; + + /// Creates a new draft feature. + /// input : A DraftFeatureInput object that defines the desired draft. Use the createInput + /// method to create a new DraftFeatureInput object and then use methods on it + /// (the DraftFeatureInput object) to define the draft. + /// Returns the newly created DraftFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified draft feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef DraftFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_DRAFTFEATURES_API static const char* classType(); + ADSK_FUSION_DRAFTFEATURES_API const char* objectType() const override; + ADSK_FUSION_DRAFTFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_DRAFTFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual DraftFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual DraftFeatureInput* createInput_raw(BRepFace** inputFaces, size_t inputFaces_size, core::Base* plane, bool isTangentChain) const = 0; + virtual DraftFeature* add_raw(DraftFeatureInput* input) = 0; + virtual DraftFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr DraftFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t DraftFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr DraftFeatures::createInput(const std::vector>& inputFaces, const core::Ptr& plane, bool isTangentChain) const +{ + BRepFace** inputFaces_ = new BRepFace*[inputFaces.size()]; + for(size_t i=0; i res = createInput_raw(inputFaces_, inputFaces.size(), plane.get(), isTangentChain); + delete[] inputFaces_; + return res; +} + +inline core::Ptr DraftFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr DraftFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void DraftFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_DRAFTFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/EqualDistanceChamferEdgeSet.h b/usr/autodesk/CPP/include/Fusion/Features/EqualDistanceChamferEdgeSet.h new file mode 100644 index 0000000..72e5df4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/EqualDistanceChamferEdgeSet.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ChamferEdgeSet.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EQUALDISTANCECHAMFEREDGESET_CPP__ +# define ADSK_FUSION_EQUALDISTANCECHAMFEREDGESET_API XI_EXPORT +# else +# define ADSK_FUSION_EQUALDISTANCECHAMFEREDGESET_API +# endif +#else +# define ADSK_FUSION_EQUALDISTANCECHAMFEREDGESET_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the edges and the parameter associated with a equal distance offset chamfer. +class EqualDistanceChamferEdgeSet : public ChamferEdgeSet { +public: + + /// Gets and sets the edges that will be chamfered. This collection can contain BRepEdge, BRepFace, + /// and Feature objects. If BRepFace or Feature are objects are provided, all of the edges associated + /// with those objects will be chamfered. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr edges() const; + bool edges(const core::Ptr& value); + + /// Returns the model parameter that controls the offset distance of the chamfer. You can edit + /// the distance by using the properties on the returned ModelParameter object. + core::Ptr distance() const; + + ADSK_FUSION_EQUALDISTANCECHAMFEREDGESET_API static const char* classType(); + ADSK_FUSION_EQUALDISTANCECHAMFEREDGESET_API const char* objectType() const override; + ADSK_FUSION_EQUALDISTANCECHAMFEREDGESET_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EQUALDISTANCECHAMFEREDGESET_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* edges_raw() const = 0; + virtual bool edges_raw(core::ObjectCollection* value) = 0; + virtual ModelParameter* distance_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr EqualDistanceChamferEdgeSet::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline bool EqualDistanceChamferEdgeSet::edges(const core::Ptr& value) +{ + return edges_raw(value.get()); +} + +inline core::Ptr EqualDistanceChamferEdgeSet::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EQUALDISTANCECHAMFEREDGESET_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/EqualDistanceChamferTypeDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/EqualDistanceChamferTypeDefinition.h new file mode 100644 index 0000000..12b13c6 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/EqualDistanceChamferTypeDefinition.h @@ -0,0 +1,63 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ChamferTypeDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EQUALDISTANCECHAMFERTYPEDEFINITION_CPP__ +# define ADSK_FUSION_EQUALDISTANCECHAMFERTYPEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_EQUALDISTANCECHAMFERTYPEDEFINITION_API +# endif +#else +# define ADSK_FUSION_EQUALDISTANCECHAMFERTYPEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} + +namespace adsk { namespace fusion { + +/// Provides information to create a chamfer that is defined by a single distance and has an equal offset from the edge. +class EqualDistanceChamferTypeDefinition : public ChamferTypeDefinition { +public: + + /// Returns the parameter controlling the distance. You can edit the distance + /// by editing the value of the parameter object. + core::Ptr distance() const; + + ADSK_FUSION_EQUALDISTANCECHAMFERTYPEDEFINITION_API static const char* classType(); + ADSK_FUSION_EQUALDISTANCECHAMFERTYPEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_EQUALDISTANCECHAMFERTYPEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EQUALDISTANCECHAMFERTYPEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ModelParameter* distance_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr EqualDistanceChamferTypeDefinition::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EQUALDISTANCECHAMFERTYPEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ExtendFeature.h b/usr/autodesk/CPP/include/Fusion/Features/ExtendFeature.h new file mode 100644 index 0000000..aeafc6f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ExtendFeature.h @@ -0,0 +1,177 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EXTENDFEATURE_CPP__ +# define ADSK_FUSION_EXTENDFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_EXTENDFEATURE_API +# endif +#else +# define ADSK_FUSION_EXTENDFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing extend feature in a design. +class ExtendFeature : public Feature { +public: + + /// Sets the edges for the extend feature. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// edges : The surface edges to extend. + /// Only the surface edges from an open body can be extended. + /// The edges must all be from the same open body. + /// isChainingEnabled : An optional boolean argument whose default is true. If this argument is set to true, all edges that are + /// tangent or curvature continuous, and end point connected, will be found automatically and extended. + /// Returns true if successful + bool setInputEntities(const core::Ptr& edges, bool isChainingEnabled = true); + + /// Gets the edges that were extended. In many cases the extend operation results in + /// the edges being consumed so they're no longer available after the feature is created. + /// in this case you need to reposition the timeline marker to just before this feature + /// when the edges do exist. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr edges() const; + + /// Returns the parameter controlling the extend distance. You can edit the distance + /// by editing the value of the parameter object. + core::Ptr distance() const; + + /// Gets and sets surface extend type to use. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + SurfaceExtendTypes extendType() const; + bool extendType(SurfaceExtendTypes value); + + /// Gets if all edges that are tangent or curvature continuous, and end point connected, will be found + /// automatically and extended. + bool isChainingEnabled() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Gets and sets surface extend alignment to use. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + SurfaceExtendAlignment extendAlignment() const; + bool extendAlignment(SurfaceExtendAlignment value); + + ADSK_FUSION_EXTENDFEATURE_API static const char* classType(); + ADSK_FUSION_EXTENDFEATURE_API const char* objectType() const override; + ADSK_FUSION_EXTENDFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EXTENDFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setInputEntities_raw(core::ObjectCollection* edges, bool isChainingEnabled) = 0; + virtual core::ObjectCollection* edges_raw() const = 0; + virtual ModelParameter* distance_raw() const = 0; + virtual SurfaceExtendTypes extendType_raw() const = 0; + virtual bool extendType_raw(SurfaceExtendTypes value) = 0; + virtual bool isChainingEnabled_raw() const = 0; + virtual ExtendFeature* nativeObject_raw() const = 0; + virtual ExtendFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual SurfaceExtendAlignment extendAlignment_raw() const = 0; + virtual bool extendAlignment_raw(SurfaceExtendAlignment value) = 0; +}; + +// Inline wrappers + +inline bool ExtendFeature::setInputEntities(const core::Ptr& edges, bool isChainingEnabled) +{ + bool res = setInputEntities_raw(edges.get(), isChainingEnabled); + return res; +} + +inline core::Ptr ExtendFeature::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline core::Ptr ExtendFeature::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline SurfaceExtendTypes ExtendFeature::extendType() const +{ + SurfaceExtendTypes res = extendType_raw(); + return res; +} + +inline bool ExtendFeature::extendType(SurfaceExtendTypes value) +{ + return extendType_raw(value); +} + +inline bool ExtendFeature::isChainingEnabled() const +{ + bool res = isChainingEnabled_raw(); + return res; +} + +inline core::Ptr ExtendFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ExtendFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline SurfaceExtendAlignment ExtendFeature::extendAlignment() const +{ + SurfaceExtendAlignment res = extendAlignment_raw(); + return res; +} + +inline bool ExtendFeature::extendAlignment(SurfaceExtendAlignment value) +{ + return extendAlignment_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EXTENDFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ExtendFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/ExtendFeatureInput.h new file mode 100644 index 0000000..501f08f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ExtendFeatureInput.h @@ -0,0 +1,166 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EXTENDFEATUREINPUT_CPP__ +# define ADSK_FUSION_EXTENDFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_EXTENDFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_EXTENDFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a extend feature. +class ExtendFeatureInput : public core::Base { +public: + + /// Gets and sets the edges to extend + core::Ptr edges() const; + bool edges(const core::Ptr& value); + + /// Gets and sets the ValueInput object that defines the extend distance + core::Ptr distance() const; + bool distance(const core::Ptr& value); + + /// Gets and sets surface extend type to use + SurfaceExtendTypes extendType() const; + bool extendType(SurfaceExtendTypes value); + + /// Gets and sets if all edges that are tangent or curvature continuous, and end point connected, will be found + /// automatically and extended. + bool isChainingEnabled() const; + bool isChainingEnabled(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// Gets and sets surface extend alignment to use. + SurfaceExtendAlignment extendAlignment() const; + bool extendAlignment(SurfaceExtendAlignment value); + + ADSK_FUSION_EXTENDFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_EXTENDFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_EXTENDFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EXTENDFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* edges_raw() const = 0; + virtual bool edges_raw(core::ObjectCollection* value) = 0; + virtual core::ValueInput* distance_raw() const = 0; + virtual bool distance_raw(core::ValueInput* value) = 0; + virtual SurfaceExtendTypes extendType_raw() const = 0; + virtual bool extendType_raw(SurfaceExtendTypes value) = 0; + virtual bool isChainingEnabled_raw() const = 0; + virtual bool isChainingEnabled_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual SurfaceExtendAlignment extendAlignment_raw() const = 0; + virtual bool extendAlignment_raw(SurfaceExtendAlignment value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ExtendFeatureInput::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline bool ExtendFeatureInput::edges(const core::Ptr& value) +{ + return edges_raw(value.get()); +} + +inline core::Ptr ExtendFeatureInput::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline bool ExtendFeatureInput::distance(const core::Ptr& value) +{ + return distance_raw(value.get()); +} + +inline SurfaceExtendTypes ExtendFeatureInput::extendType() const +{ + SurfaceExtendTypes res = extendType_raw(); + return res; +} + +inline bool ExtendFeatureInput::extendType(SurfaceExtendTypes value) +{ + return extendType_raw(value); +} + +inline bool ExtendFeatureInput::isChainingEnabled() const +{ + bool res = isChainingEnabled_raw(); + return res; +} + +inline bool ExtendFeatureInput::isChainingEnabled(bool value) +{ + return isChainingEnabled_raw(value); +} + +inline core::Ptr ExtendFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool ExtendFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline SurfaceExtendAlignment ExtendFeatureInput::extendAlignment() const +{ + SurfaceExtendAlignment res = extendAlignment_raw(); + return res; +} + +inline bool ExtendFeatureInput::extendAlignment(SurfaceExtendAlignment value) +{ + return extendAlignment_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EXTENDFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ExtendFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/ExtendFeatures.h new file mode 100644 index 0000000..ed45147 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ExtendFeatures.h @@ -0,0 +1,149 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EXTENDFEATURES_CPP__ +# define ADSK_FUSION_EXTENDFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_EXTENDFEATURES_API +# endif +#else +# define ADSK_FUSION_EXTENDFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ExtendFeature; + class ExtendFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Extend features in a component +/// and supports the ability to create new Extend features. +class ExtendFeatures : public core::Base { +public: + + /// Function that returns the specified extend feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of Extend features in the collection. + size_t count() const; + + /// Creates a ExtendFeatureInput object. Use properties and methods on this object + /// to define the extend feature you want to create and then use the Add method, passing in + /// the ExtendFeatureInput object. + /// edges : The surface edges to extend. + /// Only the outer edges from an open body can be extended. The edges must all be from the same body. + /// Depending on the extend type there can also be some limitations on the edges being input as described below + /// for the extendType argument. + /// distance : ValueInput object that defines the distance to extend the face/s. + /// Natural and Tangent Extend types require a positive distance value. + /// Perpendicular Extend Type supports either a positive or negative value to + /// control the direction of the extend. A positive number results in the + /// perpendicular extension being in the same direction as the positive normal + /// of the connected faces. + /// extendType : The extension type to use when extending the face(s). + /// Input edges must be connected at endpoints when Tangent or Perpendicular Extend Types are used. + /// Input edges need not be connected when Natural Extend type is used. + /// isChainingEnabled : An optional boolean argument whose default is true. If this argument is true, all edges that are + /// tangent or curvature continuous, and end point connected, will be found automatically and include + /// in the set of edges to extend. + /// Returns the newly created ExtendFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& edges, const core::Ptr& distance, SurfaceExtendTypes extendType, bool isChainingEnabled = true) const; + + /// Creates a new extend feature. + /// input : An ExtendFeatureInput object that defines the desired extend feature. Use the createInput + /// method to create a new ExtendFeatureInput object and then use methods on it + /// (the ExtendFeatureInput object) to define the desired options for the extent feature. + /// Returns the newly created ExtendFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified extend feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef ExtendFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_EXTENDFEATURES_API static const char* classType(); + ADSK_FUSION_EXTENDFEATURES_API const char* objectType() const override; + ADSK_FUSION_EXTENDFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EXTENDFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ExtendFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual ExtendFeatureInput* createInput_raw(core::ObjectCollection* edges, core::ValueInput* distance, SurfaceExtendTypes extendType, bool isChainingEnabled) const = 0; + virtual ExtendFeature* add_raw(ExtendFeatureInput* input) = 0; + virtual ExtendFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ExtendFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ExtendFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ExtendFeatures::createInput(const core::Ptr& edges, const core::Ptr& distance, SurfaceExtendTypes extendType, bool isChainingEnabled) const +{ + core::Ptr res = createInput_raw(edges.get(), distance.get(), extendType, isChainingEnabled); + return res; +} + +inline core::Ptr ExtendFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ExtendFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void ExtendFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EXTENDFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/ExtentDefinition.h new file mode 100644 index 0000000..d55f5e4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ExtentDefinition.h @@ -0,0 +1,95 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EXTENTDEFINITION_CPP__ +# define ADSK_FUSION_EXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_EXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_EXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Feature; +}} + +namespace adsk { namespace fusion { + +/// The base class for the various definition objects used to define the extent of a feature. +class ExtentDefinition : public core::Base { +public: + + /// Returns the parent feature that this definition is associated with. If this definition has been created + /// statically and is not associated with a feature this property will return null. + core::Ptr parentFeature() const; + + ADSK_FUSION_EXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_EXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_EXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Feature* parentFeature_raw() const = 0; + virtual void placeholderExtentDefinition0() {} + virtual void placeholderExtentDefinition1() {} + virtual void placeholderExtentDefinition2() {} + virtual void placeholderExtentDefinition3() {} + virtual void placeholderExtentDefinition4() {} + virtual void placeholderExtentDefinition5() {} + virtual void placeholderExtentDefinition6() {} + virtual void placeholderExtentDefinition7() {} + virtual void placeholderExtentDefinition8() {} + virtual void placeholderExtentDefinition9() {} + virtual void placeholderExtentDefinition10() {} + virtual void placeholderExtentDefinition11() {} + virtual void placeholderExtentDefinition12() {} + virtual void placeholderExtentDefinition13() {} + virtual void placeholderExtentDefinition14() {} + virtual void placeholderExtentDefinition15() {} + virtual void placeholderExtentDefinition16() {} + virtual void placeholderExtentDefinition17() {} + virtual void placeholderExtentDefinition18() {} + virtual void placeholderExtentDefinition19() {} + virtual void placeholderExtentDefinition20() {} + virtual void placeholderExtentDefinition21() {} + virtual void placeholderExtentDefinition22() {} + virtual void placeholderExtentDefinition23() {} + virtual void placeholderExtentDefinition24() {} + virtual void placeholderExtentDefinition25() {} + virtual void placeholderExtentDefinition26() {} + virtual void placeholderExtentDefinition27() {} + virtual void placeholderExtentDefinition28() {} + virtual void placeholderExtentDefinition29() {} + virtual void placeholderExtentDefinition30() {} +}; + +// Inline wrappers + +inline core::Ptr ExtentDefinition::parentFeature() const +{ + core::Ptr res = parentFeature_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ExtrudeFeature.h b/usr/autodesk/CPP/include/Fusion/Features/ExtrudeFeature.h new file mode 100644 index 0000000..6d9231b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ExtrudeFeature.h @@ -0,0 +1,592 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EXTRUDEFEATURE_CPP__ +# define ADSK_FUSION_EXTRUDEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_EXTRUDEFEATURE_API +# endif +#else +# define ADSK_FUSION_EXTRUDEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepFaces; + class ExtentDefinition; + class ModelParameter; + class Occurrence; + class SymmetricExtentDefinition; +}} +namespace adsk { namespace core { + class ValueInput; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing extrude feature in a design. +class ExtrudeFeature : public Feature { +public: + + /// Gets and sets the profiles or planar faces used to define the shape of the extrude. + /// This property can return or be set with a single Profile, a single planar face, or + /// an ObjectCollection consisting of multiple profiles and planar faces. When an + /// ObjectCollection is used all of the profiles and faces must be co-planar. + /// When setting this property of a surface (non-solid) extrusion, you can use the + /// createOpenProfile and createBRepEdgeProfile methods of the Component object to create + /// an open profile. + /// This property returns null in the case where the feature is non-parametric. + core::Ptr profile() const; + bool profile(const core::Ptr& value); + + /// Returns the parameter controlling the taper angle of the extrusion. To + /// edit the taper angle use properties on the parameter to edit its value. + /// This property returns nothing in the case where the feature is non-parametric. + core::Ptr taperAngle() const; + + /// Gets and sets the type of operation performed by the extrusion. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets the ExtentDefinition object that defines the extent of the extrude. Modifying the + /// properties of the returned extent definition object will cause the extrude to recompute. + /// Various types of objects can be returned depending on the type of extent currently defined for + /// the extrusion. This property returns nothing in the case where the feature is non-parametric. + core::Ptr extentDefinition() const; + + /// Sets the extrusion extents option to 'Distance'. + /// isSymmetric : Set to 'true' for an extrusion symmetrical about the profile plane + /// distance : ValueInput object that defines the extrude distance. + /// If the isSymmetric argument is 'false', a positive or negative distance can be used to control the direction. + /// Returns true if successful + bool setDistanceExtent(bool isSymmetric, const core::Ptr& distance); + + /// Sets the extrusion extents option to 'Two Side'. + /// This method will fail in the case of a non-parametric extrusion. + /// distanceOne : ValueInput object that defines the extrude distance for the first side. + /// distanceTwo : ValueInput object that defines the extrude distance for the second side. + /// Returns true if successful + bool setTwoSidesDistanceExtent(const core::Ptr& distanceOne, const core::Ptr& distanceTwo); + + /// Sets the extrusion extents option to 'All' (i.e. the extrusion is through-all, in both directions.) + /// This method will fail in the case of a non-parametric extrusion. + /// direction : The direction can be either positive, negative, or symmetric. + /// Returns true if successful + bool setAllExtent(ExtentDirections direction); + + /// Sets the extrusion Direction option to 'One Side' and the Extents option to 'To' (a specified face) + /// toEntity : The entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For an extrude it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// matchShape : If the matchShape argument is 'true', the toEntity is extended to fully intersect the extrusion. + /// directionHint : Specifies the direction of the extrusion. This is only used in the case where there are two possible solutions and the extrusion can + /// hit the toEntity in either direction. An example is if the profile of the extrusion is within a hole. + /// The extrusion will intersect the cylinder of the hole in either direction. + /// Typically there is only a single solution and the direction is determined automatically. + /// Returns true if successful. + bool setOneSideToExtent(const core::Ptr& toEntity, bool matchShape, const core::Ptr& directionHint = NULL); + + /// Set the extrusion Direction option to 'Two Side' + /// This method will fail in the case of a non-parametric extrusion. + /// toEntityOne : The first entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For an extrude it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// toEntityTwo : The second entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For an extrude it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// matchShape : If the matchShape argument is 'true', the toEntity is extended to fully intersect the extrusion. + /// Returns true if successful. + bool setTwoSidesToExtent(const core::Ptr& toEntityOne, const core::Ptr& toEntityTwo, bool matchShape); + + /// Property that returns the set of faces that cap the end of the extrusion and are coincident + /// with the sketch plane. In the case of a symmetric extrusion, these faces are the ones on the + /// positive normal side of the sketch plane. In the case where there are no start faces, + /// this property will return null. + core::Ptr startFaces() const; + + /// Property that returns the set of faces that cap the end of the extrusion, opposite the + /// start faces. In the case where there are no end faces, this property will return null. + core::Ptr endFaces() const; + + /// Property that returns all of the side faces (i.e. those running perpendicular to the extrude direction) + /// of the feature. + core::Ptr sideFaces() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Indicates if this feature was initially created as a solid or a surface. + bool isSolid() const; + + /// Gets and sets the extent used to define the start of the extrusion. You can set this property + /// with either a ProfilePlaneStartDefinition, ProfilePlaneWithOffsetStartDefinition or a + /// EntityStartDefinition object. You can get any of those objects by using the static create method on the class. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr startExtent() const; + bool startExtent(const core::Ptr& value); + + /// Redefines the extrusion to go in one direction from the profile. The extent of the extrusion is + /// defined by the extent argument. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// extent : An ExtentDefinition object that defines how the extent of the extrusion is defined. This can be + /// a specified distance (DistanceExtentDefinition), to an entity (ToEntityExtent), or through-all (AllExtentDefinition). + /// These objects can be obtained by using the static create method on the appropriate class. + /// direction : Specifies the direction of the extrusion. PositiveExtentDirection and NegativeExtentDirection + /// are valid values. PositiveExtentDirection is in the same direction as the normal of the profile's + /// parent sketch plane. + /// taperAngle : Optional argument that specifies the taper angle. If omitted a taper angle of 0 is used. + /// Returns true is setting the input to a one sided extent was successful. + bool setOneSideExtent(const core::Ptr& extent, ExtentDirections direction, const core::Ptr& taperAngle = NULL); + + /// Redefines the extrusion to go in both directions from the profile. The extent is defined independently + /// for each direction using the input arguments. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// sideOneExtent : An ExtentDefinition object that defines how the extent of the extrusion towards side one is defined. This can be + /// a specified distance (DistanceExtentDefinition), to an entity (ToEntityExtent), or through-all (AllExtentDefinition). + /// These objects can be obtained by using the static create method on the appropriate class. + /// sideTwoExtent : An ExtentDefinition object that defines how the extent of the extrusion towards side two is defined. This can be + /// a specified distance (DistanceExtentDefinition), to an entity (ToEntityExtent), or through-all (AllExtentDefinition). + /// These objects can be obtained by using the static create method on the appropriate class. + /// sideOneTaperAngle : Optional argument that specifies the taper angle for side one. If omitted a taper angle of 0 is used. + /// sideTwoTaperAngle : Optional argument that specifies the taper angle for side two. If omitted a taper angle of 0 is used. + /// Returns true, if the call was successful. + bool setTwoSidesExtent(const core::Ptr& sideOneExtent, const core::Ptr& sideTwoExtent, const core::Ptr& sideOneTaperAngle = NULL, const core::Ptr& sideTwoTaperAngle = NULL); + + /// Redefines the extrusion to go symmetrically in both directions from the profile. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// distance : The distance of the extrusions. This is either the full length of half of the length of the final extrusion + /// depending on the value of the isFullLength property. + /// isFullLength : Defines if the value defines the full length of the extrusion or half of the length. A value of true indicates + /// it defines the full length. + /// taperAngle : Optional argument that specifies the taper angle. The same taper angle is used for both sides for a symmetric + /// extrusion. If omitted a taper angle of 0 is used. + /// Returns true, if the call was successful. + bool setSymmetricExtent(const core::Ptr& distance, bool isFullLength, const core::Ptr& taperAngle = NULL); + + /// Gets and sets the extent used for a single sided extrude or side one of a two-sided extrusion. Valid + /// inputs are DistanceExtentDefinition, ToEntityExtentDefinition, and ThroughAllExtentDefinition object, + /// which can be created statically using the create method on the classes. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr extentOne() const; + bool extentOne(const core::Ptr& value); + + /// Gets and sets the extent used for side two of the extrusion. If the extrude is a single sided extrude this + /// property will return null and will fail if set. The hasTwoExtents property can be used to determine if + /// there are two sides or not. When setting this property, valid inputs are DistanceExtentDefinition, + /// ToEntityExtentDefinition, and ThroughAllExtentDefinition object, which can be created + /// statically using the create method on the classes. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr extentTwo() const; + bool extentTwo(const core::Ptr& value); + + /// Gets the parameter controlling the taper angle for a single sided extrusion or side one of a two-sided + /// extrusion. To edit the angle, use properties on the parameter to change the value of the parameter. + core::Ptr taperAngleOne() const; + + /// Gets the parameter controlling the taper angle for side two of a two-sided extrusion. if the extrusion is + /// single-sided, this property will return null. The hasTwoExtents property can be used to determine if there + /// are two sides or not. To edit the angle, use properties on the parameter to change the value of the parameter. + core::Ptr taperAngleTwo() const; + + /// Property that indicates if the extrusion is a single or two-sided extrusion. If false, the extentTwo + /// and taperAngleTwo properties should not be used. + bool hasTwoExtents() const; + + /// Gets and sets the list of bodies that will participate in the feature when the operation is a cut or intersection. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + std::vector> participantBodies() const; + bool participantBodies(const std::vector>& value); + + /// Returns a value indicating how the extent is defined for this extrude. + FeatureExtentTypes extentType() const; + + /// If the current extent of the feature is defined as a symmetric extent, this property + /// returns the SymmericExtentDefinition object that provides access to the information + /// defining the symmetric extent. If the current extent is not symmetric, this property + /// returns null. You can determine the type of extent by using the extentType property. + /// To change the extent of a feature to symmetric extent you can use the setSymmetricExtent + /// method. + core::Ptr symmetricExtent() const; + + /// Sets or returns whether the extrude is a thin extrude. + /// Setting it as false will make it a regular extrude. + bool isThinExtrude() const; + bool isThinExtrude(bool value); + + /// Changes the extrude feature to be a thin extrude. This is only valid if the isThinExtrude property + /// is False. If the extrusion is already a thin extrude, you can use the properties on the ExtrudeFeature + /// to modify the thin extrude specific values. + /// thinExtrudeWallLocationOne : Specifies the position of the thin wall extrude with respect to the profile being extruded. This defines + /// the direction for a single sided thin extrude or side one of a two-sided extrusion. + /// thinExtrudeWallThicknessOne : A ValueInput object that defines the thickness for a single sided thin extrude or side one of a two-sided + /// extrusion . + /// thinExtrudeWallLocationTwo : Optional argument that specifies the position of side two of a two-sided extrusion. This argument is ignored + /// for a single sided thin extrude. + /// thinExtrudeWallThicknessTwo : Optional argument that is a ValueInput object that defines the thickness for side two of a + /// two-sided extrusion. This argument is ignored for a single sided thin extrude. + /// Returns true if successful. + bool setThinExtrude(ThinExtrudeWallLocation thinExtrudeWallLocationOne, const core::Ptr& thinExtrudeWallThicknessOne, ThinExtrudeWallLocation thinExtrudeWallLocationTwo = adsk::fusion::Side1, const core::Ptr& thinExtrudeWallThicknessTwo = NULL); + + /// Gets and sets the wall location for a one sided thin extrude or side one of a two sided thin extrude + ThinExtrudeWallLocation thinExtrudeWallLocationOne() const; + bool thinExtrudeWallLocationOne(ThinExtrudeWallLocation value); + + /// Gets and sets the wall location for side two of a two sided thin extrude + ThinExtrudeWallLocation thinExtrudeWallLocationTwo() const; + bool thinExtrudeWallLocationTwo(ThinExtrudeWallLocation value); + + /// Gets and sets the wall thickness for a one sided thin extrude or side one of a two sided thin extrude + core::Ptr thinExtrudeWallThicknessOne() const; + + /// Gets and sets the wall thickness for side two of a two sided thin extrude + core::Ptr thinExtrudeWallThicknessTwo() const; + + ADSK_FUSION_EXTRUDEFEATURE_API static const char* classType(); + ADSK_FUSION_EXTRUDEFEATURE_API const char* objectType() const override; + ADSK_FUSION_EXTRUDEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EXTRUDEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* profile_raw() const = 0; + virtual bool profile_raw(core::Base* value) = 0; + virtual ModelParameter* taperAngle_raw() const = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual ExtentDefinition* extentDefinition_raw() const = 0; + virtual bool setDistanceExtent_raw(bool isSymmetric, core::ValueInput* distance) = 0; + virtual bool setTwoSidesDistanceExtent_raw(core::ValueInput* distanceOne, core::ValueInput* distanceTwo) = 0; + virtual bool setAllExtent_raw(ExtentDirections direction) = 0; + virtual bool setOneSideToExtent_raw(core::Base* toEntity, bool matchShape, core::Vector3D* directionHint) = 0; + virtual bool setTwoSidesToExtent_raw(core::Base* toEntityOne, core::Base* toEntityTwo, bool matchShape) = 0; + virtual BRepFaces* startFaces_raw() const = 0; + virtual BRepFaces* endFaces_raw() const = 0; + virtual BRepFaces* sideFaces_raw() const = 0; + virtual ExtrudeFeature* nativeObject_raw() const = 0; + virtual ExtrudeFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual bool isSolid_raw() const = 0; + virtual ExtentDefinition* startExtent_raw() const = 0; + virtual bool startExtent_raw(ExtentDefinition* value) = 0; + virtual bool setOneSideExtent_raw(ExtentDefinition* extent, ExtentDirections direction, core::ValueInput* taperAngle) = 0; + virtual bool setTwoSidesExtent_raw(ExtentDefinition* sideOneExtent, ExtentDefinition* sideTwoExtent, core::ValueInput* sideOneTaperAngle, core::ValueInput* sideTwoTaperAngle) = 0; + virtual bool setSymmetricExtent_raw(core::ValueInput* distance, bool isFullLength, core::ValueInput* taperAngle) = 0; + virtual ExtentDefinition* extentOne_raw() const = 0; + virtual bool extentOne_raw(ExtentDefinition* value) = 0; + virtual ExtentDefinition* extentTwo_raw() const = 0; + virtual bool extentTwo_raw(ExtentDefinition* value) = 0; + virtual ModelParameter* taperAngleOne_raw() const = 0; + virtual ModelParameter* taperAngleTwo_raw() const = 0; + virtual bool hasTwoExtents_raw() const = 0; + virtual BRepBody** participantBodies_raw(size_t& return_size) const = 0; + virtual bool participantBodies_raw(BRepBody** value, size_t value_size) = 0; + virtual FeatureExtentTypes extentType_raw() const = 0; + virtual SymmetricExtentDefinition* symmetricExtent_raw() const = 0; + virtual bool isThinExtrude_raw() const = 0; + virtual bool isThinExtrude_raw(bool value) = 0; + virtual bool setThinExtrude_raw(ThinExtrudeWallLocation thinExtrudeWallLocationOne, core::ValueInput* thinExtrudeWallThicknessOne, ThinExtrudeWallLocation thinExtrudeWallLocationTwo, core::ValueInput* thinExtrudeWallThicknessTwo) = 0; + virtual ThinExtrudeWallLocation thinExtrudeWallLocationOne_raw() const = 0; + virtual bool thinExtrudeWallLocationOne_raw(ThinExtrudeWallLocation value) = 0; + virtual ThinExtrudeWallLocation thinExtrudeWallLocationTwo_raw() const = 0; + virtual bool thinExtrudeWallLocationTwo_raw(ThinExtrudeWallLocation value) = 0; + virtual ModelParameter* thinExtrudeWallThicknessOne_raw() const = 0; + virtual ModelParameter* thinExtrudeWallThicknessTwo_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ExtrudeFeature::profile() const +{ + core::Ptr res = profile_raw(); + return res; +} + +inline bool ExtrudeFeature::profile(const core::Ptr& value) +{ + return profile_raw(value.get()); +} + +inline core::Ptr ExtrudeFeature::taperAngle() const +{ + core::Ptr res = taperAngle_raw(); + return res; +} + +inline FeatureOperations ExtrudeFeature::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool ExtrudeFeature::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr ExtrudeFeature::extentDefinition() const +{ + core::Ptr res = extentDefinition_raw(); + return res; +} + +inline bool ExtrudeFeature::setDistanceExtent(bool isSymmetric, const core::Ptr& distance) +{ + bool res = setDistanceExtent_raw(isSymmetric, distance.get()); + return res; +} + +inline bool ExtrudeFeature::setTwoSidesDistanceExtent(const core::Ptr& distanceOne, const core::Ptr& distanceTwo) +{ + bool res = setTwoSidesDistanceExtent_raw(distanceOne.get(), distanceTwo.get()); + return res; +} + +inline bool ExtrudeFeature::setAllExtent(ExtentDirections direction) +{ + bool res = setAllExtent_raw(direction); + return res; +} + +inline bool ExtrudeFeature::setOneSideToExtent(const core::Ptr& toEntity, bool matchShape, const core::Ptr& directionHint) +{ + bool res = setOneSideToExtent_raw(toEntity.get(), matchShape, directionHint.get()); + return res; +} + +inline bool ExtrudeFeature::setTwoSidesToExtent(const core::Ptr& toEntityOne, const core::Ptr& toEntityTwo, bool matchShape) +{ + bool res = setTwoSidesToExtent_raw(toEntityOne.get(), toEntityTwo.get(), matchShape); + return res; +} + +inline core::Ptr ExtrudeFeature::startFaces() const +{ + core::Ptr res = startFaces_raw(); + return res; +} + +inline core::Ptr ExtrudeFeature::endFaces() const +{ + core::Ptr res = endFaces_raw(); + return res; +} + +inline core::Ptr ExtrudeFeature::sideFaces() const +{ + core::Ptr res = sideFaces_raw(); + return res; +} + +inline core::Ptr ExtrudeFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ExtrudeFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline bool ExtrudeFeature::isSolid() const +{ + bool res = isSolid_raw(); + return res; +} + +inline core::Ptr ExtrudeFeature::startExtent() const +{ + core::Ptr res = startExtent_raw(); + return res; +} + +inline bool ExtrudeFeature::startExtent(const core::Ptr& value) +{ + return startExtent_raw(value.get()); +} + +inline bool ExtrudeFeature::setOneSideExtent(const core::Ptr& extent, ExtentDirections direction, const core::Ptr& taperAngle) +{ + bool res = setOneSideExtent_raw(extent.get(), direction, taperAngle.get()); + return res; +} + +inline bool ExtrudeFeature::setTwoSidesExtent(const core::Ptr& sideOneExtent, const core::Ptr& sideTwoExtent, const core::Ptr& sideOneTaperAngle, const core::Ptr& sideTwoTaperAngle) +{ + bool res = setTwoSidesExtent_raw(sideOneExtent.get(), sideTwoExtent.get(), sideOneTaperAngle.get(), sideTwoTaperAngle.get()); + return res; +} + +inline bool ExtrudeFeature::setSymmetricExtent(const core::Ptr& distance, bool isFullLength, const core::Ptr& taperAngle) +{ + bool res = setSymmetricExtent_raw(distance.get(), isFullLength, taperAngle.get()); + return res; +} + +inline core::Ptr ExtrudeFeature::extentOne() const +{ + core::Ptr res = extentOne_raw(); + return res; +} + +inline bool ExtrudeFeature::extentOne(const core::Ptr& value) +{ + return extentOne_raw(value.get()); +} + +inline core::Ptr ExtrudeFeature::extentTwo() const +{ + core::Ptr res = extentTwo_raw(); + return res; +} + +inline bool ExtrudeFeature::extentTwo(const core::Ptr& value) +{ + return extentTwo_raw(value.get()); +} + +inline core::Ptr ExtrudeFeature::taperAngleOne() const +{ + core::Ptr res = taperAngleOne_raw(); + return res; +} + +inline core::Ptr ExtrudeFeature::taperAngleTwo() const +{ + core::Ptr res = taperAngleTwo_raw(); + return res; +} + +inline bool ExtrudeFeature::hasTwoExtents() const +{ + bool res = hasTwoExtents_raw(); + return res; +} + +inline std::vector> ExtrudeFeature::participantBodies() const +{ + std::vector> res; + size_t s; + + BRepBody** p= participantBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool ExtrudeFeature::participantBodies(const std::vector>& value) +{ + BRepBody** value_ = new BRepBody*[value.size()]; + for(size_t i=0; i ExtrudeFeature::symmetricExtent() const +{ + core::Ptr res = symmetricExtent_raw(); + return res; +} + +inline bool ExtrudeFeature::isThinExtrude() const +{ + bool res = isThinExtrude_raw(); + return res; +} + +inline bool ExtrudeFeature::isThinExtrude(bool value) +{ + return isThinExtrude_raw(value); +} + +inline bool ExtrudeFeature::setThinExtrude(ThinExtrudeWallLocation thinExtrudeWallLocationOne, const core::Ptr& thinExtrudeWallThicknessOne, ThinExtrudeWallLocation thinExtrudeWallLocationTwo, const core::Ptr& thinExtrudeWallThicknessTwo) +{ + bool res = setThinExtrude_raw(thinExtrudeWallLocationOne, thinExtrudeWallThicknessOne.get(), thinExtrudeWallLocationTwo, thinExtrudeWallThicknessTwo.get()); + return res; +} + +inline ThinExtrudeWallLocation ExtrudeFeature::thinExtrudeWallLocationOne() const +{ + ThinExtrudeWallLocation res = thinExtrudeWallLocationOne_raw(); + return res; +} + +inline bool ExtrudeFeature::thinExtrudeWallLocationOne(ThinExtrudeWallLocation value) +{ + return thinExtrudeWallLocationOne_raw(value); +} + +inline ThinExtrudeWallLocation ExtrudeFeature::thinExtrudeWallLocationTwo() const +{ + ThinExtrudeWallLocation res = thinExtrudeWallLocationTwo_raw(); + return res; +} + +inline bool ExtrudeFeature::thinExtrudeWallLocationTwo(ThinExtrudeWallLocation value) +{ + return thinExtrudeWallLocationTwo_raw(value); +} + +inline core::Ptr ExtrudeFeature::thinExtrudeWallThicknessOne() const +{ + core::Ptr res = thinExtrudeWallThicknessOne_raw(); + return res; +} + +inline core::Ptr ExtrudeFeature::thinExtrudeWallThicknessTwo() const +{ + core::Ptr res = thinExtrudeWallThicknessTwo_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EXTRUDEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ExtrudeFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/ExtrudeFeatureInput.h new file mode 100644 index 0000000..6b363c2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ExtrudeFeatureInput.h @@ -0,0 +1,542 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EXTRUDEFEATUREINPUT_CPP__ +# define ADSK_FUSION_EXTRUDEFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_EXTRUDEFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_EXTRUDEFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepBody; + class ExtentDefinition; + class Occurrence; +}} +namespace adsk { namespace core { + class ValueInput; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of an extrude +/// feature. This class also provides properties for setting/getting the Profile and Operation +/// of the extrude. The Profile and Operation are defined when the ExtrudeFeatures.createInput +/// method is called so they do not exist as properties on this class. +class ExtrudeFeatureInput : public core::Base { +public: + + /// Gets and sets the profiles or planar faces used to define the shape of the extrude. + /// This property can return or be set with a single profile, a single planar face, or + /// an ObjectCollection consisting of multiple profiles and planar faces. When an + /// ObjectCollection is used all of the profiles and faces must be co-planar. + /// To create a surface (non-solid) extrusion, you can use the createOpenProfile and createBRepEdgeProfile + /// methods of the Component object to create an open profile. The isSolid property of the + /// ExtrudeFeatureInput property must also be False. + core::Ptr profile() const; + bool profile(const core::Ptr& value); + + /// Gets and sets the type of operation performed by the extrusion. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets and sets the taper angle of the extrusion. This is used to define the + /// taper angle for a single sided and symmetric and defines the angle for side one + /// of a two sided extrusion. This property is initialized with a taper angle of zero. + /// A negative angle will taper the extrusion inward while a positive value will taper + /// the extrusion outward. This property is valid for both parametric and non-parametric extrusions. + core::Ptr taperAngle() const; + bool taperAngle(const core::Ptr& value); + + /// Sets the extrusion extents option to 'Distance'. + /// isSymmetric : Set to 'true' for an extrusion symmetrical about the profile plane + /// distance : ValueInput object that defines the extrude distance. + /// If the isSymmetric argument is 'false', a positive or negative distance can be used to control the direction. + /// Returns true if successful + bool setDistanceExtent(bool isSymmetric, const core::Ptr& distance); + + /// Sets the extrusion extents option to 'Two Side'. + /// This method will fail in the case of a non-parametric extrusion. + /// distanceOne : ValueInput object that defines the extrude distance for the first side. + /// distanceTwo : ValueInput object that defines the extrude distance for the second side. + /// Returns true if successful + bool setTwoSidesDistanceExtent(const core::Ptr& distanceOne, const core::Ptr& distanceTwo); + + /// Sets the extrusion extents option to 'All' (i.e. the extrusion is through-all, in both directions.) + /// This method will fail in the case of a non-parametric extrusion. + /// direction : The direction can be either positive, negative, or symmetric. + /// Returns true if successful + bool setAllExtent(ExtentDirections direction); + + /// Sets the extrusion Direction option to 'One Side' and the Extents option to 'To' (a specified face) + /// toEntity : The entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For an extrude it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// matchShape : If the matchShape argument is 'true', the toEntity is extended to fully intersect the extrusion. + /// directionHint : Specifies the direction of the extrusion. This is only used in the case where there are two possible solutions and the extrusion can + /// hit the toEntity in either direction. An example is if the profile of the extrusion is within a hole. + /// The extrusion will intersect the cylinder of the hole in either direction. + /// Typically there is only a single solution and the direction is determined automatically. + /// Returns true if successful. + bool setOneSideToExtent(const core::Ptr& toEntity, bool matchShape, const core::Ptr& directionHint = NULL); + + /// Set the extrusion Direction option to 'Two Side' + /// This method will fail in the case of a non-parametric extrusion. + /// toEntityOne : The first entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For an extrude it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// toEntityTwo : The second entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For an extrude it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// matchShape : If the matchShape argument is 'true', the toEntity is extended to fully intersect the extrusion. + /// Returns true if successful. + bool setTwoSidesToExtent(const core::Ptr& toEntityOne, const core::Ptr& toEntityTwo, bool matchShape); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs to be + /// specified when the Extrusion is created based on geometry (e.g. a profile and/or face(s)) + /// in another component AND (the Extrusion) is not in the root component. + /// The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// Specifies if the extrusion should be created as a solid or surface. If + /// it's a surface then there aren't any end caps and it's open. When a ExtrudeFeature + /// input is created, this is initialized to true so a solid will be created if it's not changed. + bool isSolid() const; + bool isSolid(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// Gets and sets the extent used to define the start of the extrusion. When a new ExtrudeFeatureInput + /// object is created the start extent is initialized to be the profile plane but you can change it + /// to a profile plane with offset or from an object by setting this property with either a + /// ProfilePlaneWithOffsetStartDefinition or a EntityStartDefinition object. You can get either one + /// of those objects by using the static create method on the class. + core::Ptr startExtent() const; + bool startExtent(const core::Ptr& value); + + /// Defines the extrusion to go in one direction from the profile. The extent of the extrusion is + /// defined by the extent argument. + /// extent : An ExtentDefinition object that defines how the extent of the extrusion is defined. This can be + /// a specified distance (DistanceExtentDefinition), to an entity (ToEntityExtent), or through-all (AllExtentDefinition). + /// These objects can be obtained by using the static create method on the appropriate class. + /// direction : Specifies the direction of the extrusion. PositiveExtentDirection and NegativeExtentDirection + /// are valid values. PositiveExtentDirection is in the same direction as the normal of the profile's + /// parent sketch plane. + /// taperAngle : Optional argument that specifies the taper angle. If omitted a taper angle of 0 is used. + /// Returns true is setting the input to a one sided extent was successful. + bool setOneSideExtent(const core::Ptr& extent, ExtentDirections direction, const core::Ptr& taperAngle = NULL); + + /// Defines the extrusion to go in both directions from the profile. The extent is defined independently + /// for each direction using the input arguments. + /// sideOneExtent : An ExtentDefinition object that defines how the extent of the extrusion towards side one is defined. This can be + /// a specified distance (DistanceExtentDefinition), to an entity (ToEntityExtent), or through-all (AllExtentDefinition). + /// These objects can be obtained by using the static create method on the appropriate class. + /// sideTwoExtent : An ExtentDefinition object that defines how the extent of the extrusion towards side two is defined. This can be + /// a specified distance (DistanceExtentDefinition), to an entity (ToEntityExtent), or through-all (AllExtentDefinition). + /// These objects can be obtained by using the static create method on the appropriate class. + /// sideOneTaperAngle : Optional argument that specifies the taper angle for side one. If omitted a taper angle of 0 is used. + /// sideTwoTaperAngle : Optional argument that specifies the taper angle for side two. If omitted a taper angle of 0 is used. + /// Returns true is setting the extent was successful. + bool setTwoSidesExtent(const core::Ptr& sideOneExtent, const core::Ptr& sideTwoExtent, const core::Ptr& sideOneTaperAngle = NULL, const core::Ptr& sideTwoTaperAngle = NULL); + + /// Defines the extrusion to go symmetrically in both directions from the profile. + /// distance : The distance of the extrusions. This is either the full length of half of the length of the final extrusion + /// depending on the value of the isFullLength property. + /// isFullLength : Defines if the value defines the full length of the extrusion or half of the length. A value of true indicates + /// it defines the full length. + /// taperAngle : Optional argument that specifies the taper angle. The same taper angle is used for both sides for a symmetric + /// extrusion. If omitted a taper angle of 0 is used. + /// Returns true is setting the extent was successful. + bool setSymmetricExtent(const core::Ptr& distance, bool isFullLength, const core::Ptr& taperAngle = NULL); + + /// Gets the extent assigned for a single sided extrude or side one of a two-sided extrusion. To set the extent, use + /// one of the set methods on the ExtrudeFeatureInput object. + core::Ptr extentOne() const; + + /// Gets the extent assigned for side two of the extrusion. If the extrude is single sided extrude this + /// property will return null. The hasTwoExtents property can be used to determine if there + /// are two sides or not. To set the extent, use one of the set methods on the ExtrudeFeatureInput object. + core::Ptr extentTwo() const; + + /// Gets the value that will be used as the taper angle for a single sided extrusion or side one of a two-sided + /// extrusion. To set the taper angle, use one of the set methods on the ExtrudeFeatureInput object. + core::Ptr taperAngleOne() const; + + /// Gets the value that will be used as the taper angle for side two of a two-sided extrusion. If the extrusion is + /// single-sided, this property will return null. The hasTwoExtents property can be used to determine if there + /// are two sides or not. To set the taper angle, use one of the set methods on the ExtrudeFeatureInput object. + core::Ptr taperAngleTwo() const; + + /// Property that indicates if the extrusion is a single or two-sided extrusion. If false, the extentTwo + /// and taperAngleTwo properties should not be used. + bool hasTwoExtents() const; + + /// Gets and sets the list of bodies that will participate in the feature when the operation is a cut or intersection. + /// If this property has not been set, the default behavior is that all bodies that are intersected by the + /// feature will participate. + /// This property can return null in the case where the feature has not been fully defined so that + /// possible intersecting bodies can be computed. + std::vector> participantBodies() const; + bool participantBodies(const std::vector>& value); + + /// Sets or returns whether the extrude is a thin extrude. + /// Setting it as false will make it a regular extrude. + bool isThinExtrude() const; + bool isThinExtrude(bool value); + + /// Changes the extrude feature to be a thin extrude. This is only valid if the isThinExtrude property + /// is False. If the extrusion is already a thin extrude, you can use the properties on the ExtrudeFeature + /// to modify the thin extrude specific values. + /// thinExtrudeWallLocationOne : Specifies the position of the thin wall extrude with respect to the profile being extruded. This defines + /// the direction for a single sided thin extrude or side one of a two-sided extrusion. + /// thinExtrudeWallThicknessOne : A ValueInput object that defines the thickness for a single sided thin extrude or side one of a two-sided + /// extrusion . + /// thinExtrudeWallLocationTwo : Optional argument that specifies the position of side two of a two-sided extrusion. This argument is ignored + /// for a single sided thin extrude. + /// thinExtrudeWallThicknessTwo : Optional argument that is a ValueInput object that defines the thickness for side two of a + /// two-sided extrusion. This argument is ignored for a single sided thin extrude. + /// Returns true if successful. + bool setThinExtrude(ThinExtrudeWallLocation thinExtrudeWallLocationOne, const core::Ptr& thinExtrudeWallThicknessOne, ThinExtrudeWallLocation thinExtrudeWallLocationTwo = adsk::fusion::Side1, const core::Ptr& thinExtrudeWallThicknessTwo = NULL); + + /// Gets and sets the wall location for a one sided thin extrude or side one of a two sided thin extrude + ThinExtrudeWallLocation thinExtrudeWallLocationOne() const; + bool thinExtrudeWallLocationOne(ThinExtrudeWallLocation value); + + /// Gets and sets the wall location for side two of a two sided thin extrude + ThinExtrudeWallLocation thinExtrudeWallLocationTwo() const; + bool thinExtrudeWallLocationTwo(ThinExtrudeWallLocation value); + + /// Gets and sets the wall thickness for a one sided thin extrude or side one of a two sided thin extrude + core::Ptr thinExtrudeWallThicknessOne() const; + bool thinExtrudeWallThicknessOne(const core::Ptr& value); + + /// Gets and sets the wall thickness for side two of a two sided thin extrude + core::Ptr thinExtrudeWallThicknessTwo() const; + bool thinExtrudeWallThicknessTwo(const core::Ptr& value); + + ADSK_FUSION_EXTRUDEFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_EXTRUDEFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_EXTRUDEFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EXTRUDEFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* profile_raw() const = 0; + virtual bool profile_raw(core::Base* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual core::ValueInput* taperAngle_raw() const = 0; + virtual bool taperAngle_raw(core::ValueInput* value) = 0; + virtual bool setDistanceExtent_raw(bool isSymmetric, core::ValueInput* distance) = 0; + virtual bool setTwoSidesDistanceExtent_raw(core::ValueInput* distanceOne, core::ValueInput* distanceTwo) = 0; + virtual bool setAllExtent_raw(ExtentDirections direction) = 0; + virtual bool setOneSideToExtent_raw(core::Base* toEntity, bool matchShape, core::Vector3D* directionHint) = 0; + virtual bool setTwoSidesToExtent_raw(core::Base* toEntityOne, core::Base* toEntityTwo, bool matchShape) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual bool isSolid_raw() const = 0; + virtual bool isSolid_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual ExtentDefinition* startExtent_raw() const = 0; + virtual bool startExtent_raw(ExtentDefinition* value) = 0; + virtual bool setOneSideExtent_raw(ExtentDefinition* extent, ExtentDirections direction, core::ValueInput* taperAngle) = 0; + virtual bool setTwoSidesExtent_raw(ExtentDefinition* sideOneExtent, ExtentDefinition* sideTwoExtent, core::ValueInput* sideOneTaperAngle, core::ValueInput* sideTwoTaperAngle) = 0; + virtual bool setSymmetricExtent_raw(core::ValueInput* distance, bool isFullLength, core::ValueInput* taperAngle) = 0; + virtual ExtentDefinition* extentOne_raw() const = 0; + virtual ExtentDefinition* extentTwo_raw() const = 0; + virtual core::ValueInput* taperAngleOne_raw() const = 0; + virtual core::ValueInput* taperAngleTwo_raw() const = 0; + virtual bool hasTwoExtents_raw() const = 0; + virtual BRepBody** participantBodies_raw(size_t& return_size) const = 0; + virtual bool participantBodies_raw(BRepBody** value, size_t value_size) = 0; + virtual bool isThinExtrude_raw() const = 0; + virtual bool isThinExtrude_raw(bool value) = 0; + virtual bool setThinExtrude_raw(ThinExtrudeWallLocation thinExtrudeWallLocationOne, core::ValueInput* thinExtrudeWallThicknessOne, ThinExtrudeWallLocation thinExtrudeWallLocationTwo, core::ValueInput* thinExtrudeWallThicknessTwo) = 0; + virtual ThinExtrudeWallLocation thinExtrudeWallLocationOne_raw() const = 0; + virtual bool thinExtrudeWallLocationOne_raw(ThinExtrudeWallLocation value) = 0; + virtual ThinExtrudeWallLocation thinExtrudeWallLocationTwo_raw() const = 0; + virtual bool thinExtrudeWallLocationTwo_raw(ThinExtrudeWallLocation value) = 0; + virtual core::ValueInput* thinExtrudeWallThicknessOne_raw() const = 0; + virtual bool thinExtrudeWallThicknessOne_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* thinExtrudeWallThicknessTwo_raw() const = 0; + virtual bool thinExtrudeWallThicknessTwo_raw(core::ValueInput* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ExtrudeFeatureInput::profile() const +{ + core::Ptr res = profile_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::profile(const core::Ptr& value) +{ + return profile_raw(value.get()); +} + +inline FeatureOperations ExtrudeFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr ExtrudeFeatureInput::taperAngle() const +{ + core::Ptr res = taperAngle_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::taperAngle(const core::Ptr& value) +{ + return taperAngle_raw(value.get()); +} + +inline bool ExtrudeFeatureInput::setDistanceExtent(bool isSymmetric, const core::Ptr& distance) +{ + bool res = setDistanceExtent_raw(isSymmetric, distance.get()); + return res; +} + +inline bool ExtrudeFeatureInput::setTwoSidesDistanceExtent(const core::Ptr& distanceOne, const core::Ptr& distanceTwo) +{ + bool res = setTwoSidesDistanceExtent_raw(distanceOne.get(), distanceTwo.get()); + return res; +} + +inline bool ExtrudeFeatureInput::setAllExtent(ExtentDirections direction) +{ + bool res = setAllExtent_raw(direction); + return res; +} + +inline bool ExtrudeFeatureInput::setOneSideToExtent(const core::Ptr& toEntity, bool matchShape, const core::Ptr& directionHint) +{ + bool res = setOneSideToExtent_raw(toEntity.get(), matchShape, directionHint.get()); + return res; +} + +inline bool ExtrudeFeatureInput::setTwoSidesToExtent(const core::Ptr& toEntityOne, const core::Ptr& toEntityTwo, bool matchShape) +{ + bool res = setTwoSidesToExtent_raw(toEntityOne.get(), toEntityTwo.get(), matchShape); + return res; +} + +inline core::Ptr ExtrudeFeatureInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline bool ExtrudeFeatureInput::isSolid() const +{ + bool res = isSolid_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::isSolid(bool value) +{ + return isSolid_raw(value); +} + +inline core::Ptr ExtrudeFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline core::Ptr ExtrudeFeatureInput::startExtent() const +{ + core::Ptr res = startExtent_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::startExtent(const core::Ptr& value) +{ + return startExtent_raw(value.get()); +} + +inline bool ExtrudeFeatureInput::setOneSideExtent(const core::Ptr& extent, ExtentDirections direction, const core::Ptr& taperAngle) +{ + bool res = setOneSideExtent_raw(extent.get(), direction, taperAngle.get()); + return res; +} + +inline bool ExtrudeFeatureInput::setTwoSidesExtent(const core::Ptr& sideOneExtent, const core::Ptr& sideTwoExtent, const core::Ptr& sideOneTaperAngle, const core::Ptr& sideTwoTaperAngle) +{ + bool res = setTwoSidesExtent_raw(sideOneExtent.get(), sideTwoExtent.get(), sideOneTaperAngle.get(), sideTwoTaperAngle.get()); + return res; +} + +inline bool ExtrudeFeatureInput::setSymmetricExtent(const core::Ptr& distance, bool isFullLength, const core::Ptr& taperAngle) +{ + bool res = setSymmetricExtent_raw(distance.get(), isFullLength, taperAngle.get()); + return res; +} + +inline core::Ptr ExtrudeFeatureInput::extentOne() const +{ + core::Ptr res = extentOne_raw(); + return res; +} + +inline core::Ptr ExtrudeFeatureInput::extentTwo() const +{ + core::Ptr res = extentTwo_raw(); + return res; +} + +inline core::Ptr ExtrudeFeatureInput::taperAngleOne() const +{ + core::Ptr res = taperAngleOne_raw(); + return res; +} + +inline core::Ptr ExtrudeFeatureInput::taperAngleTwo() const +{ + core::Ptr res = taperAngleTwo_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::hasTwoExtents() const +{ + bool res = hasTwoExtents_raw(); + return res; +} + +inline std::vector> ExtrudeFeatureInput::participantBodies() const +{ + std::vector> res; + size_t s; + + BRepBody** p= participantBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool ExtrudeFeatureInput::participantBodies(const std::vector>& value) +{ + BRepBody** value_ = new BRepBody*[value.size()]; + for(size_t i=0; i& thinExtrudeWallThicknessOne, ThinExtrudeWallLocation thinExtrudeWallLocationTwo, const core::Ptr& thinExtrudeWallThicknessTwo) +{ + bool res = setThinExtrude_raw(thinExtrudeWallLocationOne, thinExtrudeWallThicknessOne.get(), thinExtrudeWallLocationTwo, thinExtrudeWallThicknessTwo.get()); + return res; +} + +inline ThinExtrudeWallLocation ExtrudeFeatureInput::thinExtrudeWallLocationOne() const +{ + ThinExtrudeWallLocation res = thinExtrudeWallLocationOne_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::thinExtrudeWallLocationOne(ThinExtrudeWallLocation value) +{ + return thinExtrudeWallLocationOne_raw(value); +} + +inline ThinExtrudeWallLocation ExtrudeFeatureInput::thinExtrudeWallLocationTwo() const +{ + ThinExtrudeWallLocation res = thinExtrudeWallLocationTwo_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::thinExtrudeWallLocationTwo(ThinExtrudeWallLocation value) +{ + return thinExtrudeWallLocationTwo_raw(value); +} + +inline core::Ptr ExtrudeFeatureInput::thinExtrudeWallThicknessOne() const +{ + core::Ptr res = thinExtrudeWallThicknessOne_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::thinExtrudeWallThicknessOne(const core::Ptr& value) +{ + return thinExtrudeWallThicknessOne_raw(value.get()); +} + +inline core::Ptr ExtrudeFeatureInput::thinExtrudeWallThicknessTwo() const +{ + core::Ptr res = thinExtrudeWallThicknessTwo_raw(); + return res; +} + +inline bool ExtrudeFeatureInput::thinExtrudeWallThicknessTwo(const core::Ptr& value) +{ + return thinExtrudeWallThicknessTwo_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EXTRUDEFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ExtrudeFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/ExtrudeFeatures.h new file mode 100644 index 0000000..ddc594b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ExtrudeFeatures.h @@ -0,0 +1,160 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EXTRUDEFEATURES_CPP__ +# define ADSK_FUSION_EXTRUDEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_EXTRUDEFEATURES_API +# endif +#else +# define ADSK_FUSION_EXTRUDEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ExtrudeFeature; + class ExtrudeFeatureInput; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing extrude features in a design +/// and supports the ability to create new extrude features. +class ExtrudeFeatures : public core::Base { +public: + + /// Function that returns the specified extrude feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of extrude features in the collection. + size_t count() const; + + /// Creates a new ExtrudeFeatureInput object that is used to specify the input needed + /// to create a new extrude feature. + /// profile : The profile argument can be a single Profile, a single planar face, a single SketchText object, + /// or an ObjectCollection consisting of multiple profiles, planar faces, and sketch texts. + /// When an ObjectCollection is used all of the profiles, faces, and sketch texts must be co-planar. + /// To create a surface (non-solid) extrusion, you can use the createOpenProfile and createBRepEdgeProfile + /// methods of the Component object to create an open profile. You also need to set the isSolid property + /// of the returned ExtrudeFeatureInput property to False. + /// operation : The feature operation to perform. + /// Returns the newly created ExtrudeFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& profile, FeatureOperations operation) const; + + /// Creates a new extrude feature based on the information defined by the provided ExtrudeFeatureInput object. + /// To create a new extrusion use the createInput function to create a new input object and use the methods and + /// properties on that object to define the required input for an extrusion. Once the information is defined on the + /// input object you can pass it to the Add method to create the extrusion. + /// input : The ExtrudeFeatureInput object that specifies the input needed to create a new extrude + /// feature. + /// Returns the newly created ExtrudeFeature or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified extrude feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// Creates a basic extrusion that goes from the profile plane the specified distance. + /// profile : The profile argument can be a single Profile, a single planar face, a single SketchText object, + /// or an ObjectCollection consisting of multiple profiles, planar faces, and sketch texts. + /// When an ObjectCollection is used all of the profiles, faces, and sketch texts must be co-planar. + /// To create a surface (non-solid) extrusion, you can use the createOpenProfile and createBRepEdgeProfile + /// methods of the Component object to create an open profile. You also need to set the isSolid property + /// of the returned ExtrudeFeatureInput property to False. + /// distance : ValueInput object that defines the extrude distance. A positive value extrudes in the positive direction + /// of the sketch plane and negative value is in the opposite direction. + /// operation : The feature operation to perform. + /// Returns the newly created ExtrudeFeature or null if the creation failed. + core::Ptr addSimple(const core::Ptr& profile, const core::Ptr& distance, FeatureOperations operation); + + typedef ExtrudeFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_EXTRUDEFEATURES_API static const char* classType(); + ADSK_FUSION_EXTRUDEFEATURES_API const char* objectType() const override; + ADSK_FUSION_EXTRUDEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EXTRUDEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ExtrudeFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual ExtrudeFeatureInput* createInput_raw(core::Base* profile, FeatureOperations operation) const = 0; + virtual ExtrudeFeature* add_raw(ExtrudeFeatureInput* input) = 0; + virtual ExtrudeFeature* itemByName_raw(const char * name) const = 0; + virtual ExtrudeFeature* addSimple_raw(core::Base* profile, core::ValueInput* distance, FeatureOperations operation) = 0; +}; + +// Inline wrappers + +inline core::Ptr ExtrudeFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ExtrudeFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ExtrudeFeatures::createInput(const core::Ptr& profile, FeatureOperations operation) const +{ + core::Ptr res = createInput_raw(profile.get(), operation); + return res; +} + +inline core::Ptr ExtrudeFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ExtrudeFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline core::Ptr ExtrudeFeatures::addSimple(const core::Ptr& profile, const core::Ptr& distance, FeatureOperations operation) +{ + core::Ptr res = addSimple_raw(profile.get(), distance.get(), operation); + return res; +} + +template inline void ExtrudeFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EXTRUDEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/Feature.h b/usr/autodesk/CPP/include/Fusion/Features/Feature.h new file mode 100644 index 0000000..ef7fa17 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/Feature.h @@ -0,0 +1,341 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FEATURE_CPP__ +# define ADSK_FUSION_FEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_FEATURE_API +# endif +#else +# define ADSK_FUSION_FEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepBodies; + class BRepFaces; + class Component; + class FeatureList; + class Occurrence; + class TimelineObject; +}} +namespace adsk { namespace core { + class Attributes; +}} + +namespace adsk { namespace fusion { + +/// Base class object representing all features. +class Feature : public core::Base { +public: + + /// Returns the name of the feature as seen in the browser (non-parametric) or in the timeline (parametric). + std::string name() const; + bool name(const std::string& value); + + /// Deletes the feature. + /// This works for both parametric and non-parametric features. + /// Returns a bool indicating if the delete was successful or not. + bool deleteMe(); + + /// Dissolves the feature so that the feature information is lost + /// and only the B-Rep geometry defined by the feature remains. + /// This is only valid for non-parametric features. + /// Returns a bool indicating if the dissolve was successful or not. + bool dissolve(); + + /// Gets and sets if this feature is suppressed. This is only valid + /// for parametric features. + bool isSuppressed() const; + bool isSuppressed(bool value); + + /// Indicates if this feature is parametric or not. + bool isParametric() const; + + /// Returns the faces that were created by this feature. + /// This works for both parametric and non-parametric features. + core::Ptr faces() const; + + /// Returns the parent component that owns this feature. + core::Ptr parentComponent() const; + + /// Returns the set of features that are linked to this feature. The set of linked features + /// are all of the features that were created in various components as the result of a + /// single feature being created in the user interface. + core::Ptr linkedFeatures() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// Returns the timeline object associated with this feature. + core::Ptr timelineObject() const; + + /// Returns the bodies that were modified or created by this feature. + /// This property works for both parametric and non-parametric features. + /// For a BaseFeature, this property has two different behaviors depending + /// on if the BaseFeature is active for edit or not. When the base feature is + /// active, this property returns the bodies owned by the base feature or the + /// source bodies. When the base feature is not active, this property returns + /// the result bodies. + /// When a body is added to a base feature, that body is owned by the base feature + /// and is only seen in the UI when the base feature is active. This body is referred + /// to as a "source body". Fusion creates a parametric copy of the body when you + /// exit the base feature. This copy is referred to as the "result body," and it + /// is used for subsequent modeling operations. + /// You can map between the source and result bodies by using their position + /// within the bodies returned. To get a valid list of result bodies, you should + /// roll the timeline to immediately after the base feature node in the timeline. + /// Otherwise, subsequent operations could have done something to cause one or + /// more bodies to no longer be available. + core::Ptr bodies() const; + + /// Returns the collection of attributes associated with this face. + core::Ptr attributes() const; + + /// If this feature is associated with a base feature, this property will return that base feature. + /// If it's not associated with a base feature, this property will return null. + core::Ptr baseFeature() const; + + /// Returns the current health state of the feature. + FeatureHealthStates healthState() const; + + /// Returns the error or warning message in the case where the healthState property returns either + /// WarningFeatureHealthState or ErrorFeatureHealthState. Otherwise this property returns an empty string. + std::string errorOrWarningMessage() const; + + /// Returns a token for the Feature object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same feature. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_FEATURE_API static const char* classType(); + ADSK_FUSION_FEATURE_API const char* objectType() const override; + ADSK_FUSION_FEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* name_raw() const = 0; + virtual bool deleteMe_raw() = 0; + virtual bool dissolve_raw() = 0; + virtual bool isSuppressed_raw() const = 0; + virtual bool isSuppressed_raw(bool value) = 0; + virtual bool isParametric_raw() const = 0; + virtual BRepFaces* faces_raw() const = 0; + virtual Component* parentComponent_raw() const = 0; + virtual FeatureList* linkedFeatures_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual BRepBodies* bodies_raw() const = 0; + virtual bool name__raw(const char * value) = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual BaseFeature* baseFeature_raw() const = 0; + virtual FeatureHealthStates healthState_raw() const = 0; + virtual char* errorOrWarningMessage_raw() const = 0; + virtual char* entityToken_raw() const = 0; + virtual void placeholderFeature0() {} + virtual void placeholderFeature1() {} + virtual void placeholderFeature2() {} + virtual void placeholderFeature3() {} + virtual void placeholderFeature4() {} + virtual void placeholderFeature5() {} + virtual void placeholderFeature6() {} + virtual void placeholderFeature7() {} + virtual void placeholderFeature8() {} + virtual void placeholderFeature9() {} + virtual void placeholderFeature10() {} + virtual void placeholderFeature11() {} + virtual void placeholderFeature12() {} + virtual void placeholderFeature13() {} + virtual void placeholderFeature14() {} + virtual void placeholderFeature15() {} + virtual void placeholderFeature16() {} + virtual void placeholderFeature17() {} + virtual void placeholderFeature18() {} + virtual void placeholderFeature19() {} + virtual void placeholderFeature20() {} + virtual void placeholderFeature21() {} + virtual void placeholderFeature22() {} + virtual void placeholderFeature23() {} + virtual void placeholderFeature24() {} + virtual void placeholderFeature25() {} + virtual void placeholderFeature26() {} + virtual void placeholderFeature27() {} + virtual void placeholderFeature28() {} + virtual void placeholderFeature29() {} + virtual void placeholderFeature30() {} + virtual void placeholderFeature31() {} + virtual void placeholderFeature32() {} + virtual void placeholderFeature33() {} + virtual void placeholderFeature34() {} + virtual void placeholderFeature35() {} + virtual void placeholderFeature36() {} + virtual void placeholderFeature37() {} + virtual void placeholderFeature38() {} + virtual void placeholderFeature39() {} + virtual void placeholderFeature40() {} + virtual void placeholderFeature41() {} + virtual void placeholderFeature42() {} + virtual void placeholderFeature43() {} + virtual void placeholderFeature44() {} + virtual void placeholderFeature45() {} +}; + +// Inline wrappers + +inline std::string Feature::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Feature::name(const std::string& value) +{ + return name__raw(value.c_str()); +} + +inline bool Feature::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline bool Feature::dissolve() +{ + bool res = dissolve_raw(); + return res; +} + +inline bool Feature::isSuppressed() const +{ + bool res = isSuppressed_raw(); + return res; +} + +inline bool Feature::isSuppressed(bool value) +{ + return isSuppressed_raw(value); +} + +inline bool Feature::isParametric() const +{ + bool res = isParametric_raw(); + return res; +} + +inline core::Ptr Feature::faces() const +{ + core::Ptr res = faces_raw(); + return res; +} + +inline core::Ptr Feature::parentComponent() const +{ + core::Ptr res = parentComponent_raw(); + return res; +} + +inline core::Ptr Feature::linkedFeatures() const +{ + core::Ptr res = linkedFeatures_raw(); + return res; +} + +inline core::Ptr Feature::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr Feature::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline core::Ptr Feature::bodies() const +{ + core::Ptr res = bodies_raw(); + return res; +} + +inline core::Ptr Feature::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline core::Ptr Feature::baseFeature() const +{ + core::Ptr res = baseFeature_raw(); + return res; +} + +inline FeatureHealthStates Feature::healthState() const +{ + FeatureHealthStates res = healthState_raw(); + return res; +} + +inline std::string Feature::errorOrWarningMessage() const +{ + std::string res; + + char* p= errorOrWarningMessage_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string Feature::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FeatureList.h b/usr/autodesk/CPP/include/Fusion/Features/FeatureList.h new file mode 100644 index 0000000..b586b52 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FeatureList.h @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FEATURELIST_CPP__ +# define ADSK_FUSION_FEATURELIST_API XI_EXPORT +# else +# define ADSK_FUSION_FEATURELIST_API +# endif +#else +# define ADSK_FUSION_FEATURELIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Feature; +}} + +namespace adsk { namespace fusion { + +/// Provides access to a list of features. This is used in the API to return +/// a list of features from an API call. +class FeatureList : public core::Base { +public: + + /// Returns the specified folder. + /// index : The index of the feature to return. The first feature in the list has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of features in this collection. + size_t count() const; + + typedef Feature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_FEATURELIST_API static const char* classType(); + ADSK_FUSION_FEATURELIST_API const char* objectType() const override; + ADSK_FUSION_FEATURELIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FEATURELIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Feature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr FeatureList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t FeatureList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void FeatureList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FEATURELIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/Features.h b/usr/autodesk/CPP/include/Fusion/Features/Features.h new file mode 100644 index 0000000..6836678 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/Features.h @@ -0,0 +1,747 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FEATURES_CPP__ +# define ADSK_FUSION_FEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_FEATURES_API +# endif +#else +# define ADSK_FUSION_FEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeatures; + class BoundaryFillFeatures; + class BoxFeatures; + class ChamferFeatures; + class CircularPatternFeatures; + class CoilFeatures; + class CombineFeatures; + class CopyPasteBodies; + class CustomFeatures; + class CutPasteBodies; + class CylinderFeatures; + class DeleteFaceFeatures; + class DraftFeatures; + class ExtendFeatures; + class ExtrudeFeatures; + class Feature; + class FilletFeatures; + class FlangeFeatures; + class FormFeatures; + class HoleFeatures; + class LoftFeatures; + class MirrorFeatures; + class MoveFeatures; + class OffsetFacesFeatures; + class OffsetFeatures; + class PatchFeatures; + class Path; + class PathPatternFeatures; + class PipeFeatures; + class RectangularPatternFeatures; + class RefoldFeatures; + class RemoveFeatures; + class ReplaceFaceFeatures; + class ReverseNormalFeatures; + class RevolveFeatures; + class RibFeatures; + class RuledSurfaceFeatures; + class RuleFilletFeatures; + class ScaleFeatures; + class ShellFeatures; + class SilhouetteSplitFeatures; + class SphereFeatures; + class SplitBodyFeatures; + class SplitFaceFeatures; + class StitchFeatures; + class SurfaceDeleteFaceFeatures; + class SweepFeatures; + class ThickenFeatures; + class ThreadFeatures; + class TorusFeatures; + class TrimFeatures; + class UnfoldFeatures; + class UnstitchFeatures; + class UntrimFeatures; + class WebFeatures; +}} + +namespace adsk { namespace fusion { + +/// The features collection which provides access to all existing features. This collection +/// provides direct access to all features regardless of type. It also provides access +/// to type specific collections where you can get features of a specific type and also create +/// new features of that type. +class Features : public core::Base { +public: + + /// Function that returns the specified feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of bodies in the collection. + size_t count() const; + + /// Returns the collection that provides access to the extrude features within the component + /// and supports the creation of new extrude features. + core::Ptr extrudeFeatures() const; + + /// Returns the collection that provides access to the revolve features within the component + /// and supports the creation of new revolved features. + core::Ptr revolveFeatures() const; + + /// Returns the collection that provides access to the hole features within the component + /// and supports the creation of new hole features. + core::Ptr holeFeatures() const; + + /// Returns the collection that provides access to the fillet features within the component + /// and supports the creation of new fillet features. + core::Ptr filletFeatures() const; + + /// Returns the collection that provides access to the sweep features within the component + /// and supports the creation of new sweep features. + core::Ptr sweepFeatures() const; + + /// Returns the collection that provides access to the chamfer features within the component + /// and supports the creation of new chamfer features. + core::Ptr chamferFeatures() const; + + /// Returns the collection that provides access to the shell features within the component + /// and supports the creation of new shell features. + core::Ptr shellFeatures() const; + + /// Returns the collection that provides access to the mirror features within the component + /// and supports the creation of new mirror features. + core::Ptr mirrorFeatures() const; + + /// Returns the collection that provides access to the circular pattern features within the component + /// and supports the creation of new circular pattern features. + core::Ptr circularPatternFeatures() const; + + /// Returns the collection that provides access to the rectangular pattern features within the component + /// and supports the creation of new rectangular pattern features. + core::Ptr rectangularPatternFeatures() const; + + /// Returns the collection that provides access to the path pattern features within the component + /// and supports the creation of new path pattern features. + core::Ptr pathPatternFeatures() const; + + /// Returns the collection that provides access to the combine features within the component + /// and supports the creation of new combine features. + core::Ptr combineFeatures() const; + + /// Returns the collection that provides access to the thread features within the component + /// and supports the creation of new thread features. + core::Ptr threadFeatures() const; + + /// Returns the collection that provides access to the draft features within the component + /// and supports the creation of new draft features. + core::Ptr draftFeatures() const; + + /// Returns the collection that provides access to the scale features within the component + /// and supports the creation of new scale features. + core::Ptr scaleFeatures() const; + + /// Method that creates a Path used to define the shape of a Sweep feature. A Path is a contiguous + /// set of curves that can be a combination of sketch curves and model edges. + /// curve : A SketchCurve or an ObjectCollection containing multiple sketch entities and/or BRepEdge objects. If a single sketch curve + /// or edge is input the isChain argument is checked to determine if connected curves (they do not need to be tangent) + /// should be automatically found. If multiple curves are provided the isChain argument is always + /// treated as false so you must provide all of the curves in the object collection that you want included in the path. + /// The provided curves must all connect together in a single path. + /// The input curves can be from multiple sketches and bodies and they need to geometrically connect for + /// a valid path to be created. + /// isChain : Optional argument, that defaults to true. If this argument is set to true, all curves and edges that are end point + /// connected to the single input curve will be found and used to create the path. + /// This argument is only used when the first argument is a single SketchCurve/BRepEdge object. + /// Returns the newly created Path. + core::Ptr createPath(const core::Ptr& curve, bool isChain = true); + + /// Returns the collection that provides access to the replaceFace features within the component + /// and supports the creation of new replaceFace features. + core::Ptr replaceFaceFeatures() const; + + /// Returns the collection that provides access to the Move features within the component + /// and supports the creation of new Move features. + core::Ptr moveFeatures() const; + + /// Returns the collection that provides access to the SplitFace features within the component and supports the creation + /// of new SplitFace features + core::Ptr splitFaceFeatures() const; + + /// Returns the collection that provides access to the SplitBody features within the component and supports the creation + /// of new SplitBody features + core::Ptr splitBodyFeatures() const; + + /// Returns the collection that provides access to the Parting Line Split features within the component and supports + /// the creation of new Parting Line Split features + core::Ptr silhouetteSplitFeatures() const; + + /// Returns the collection that provides access to the Offset features within the component + /// and supports the creation of new Offset features. + core::Ptr offsetFeatures() const; + + /// Returns the collection that provides access to the Extend features within the component + /// and supports the creation of new Extend features. + core::Ptr extendFeatures() const; + + /// Returns the collection that provides access to the Stitch features within the component + /// and supports the creation of new Stitch features. + core::Ptr stitchFeatures() const; + + /// Returns the collection that provides access to the Boundary Fill features within the component + /// and supports the creation of new Boundary Fill features. + core::Ptr boundaryFillFeatures() const; + + /// Returns the collection that provides access to the Trim features within the component + /// and supports the creation of new Trim features. + core::Ptr trimFeatures() const; + + /// Returns the collection that provides access to the Thicken features within the component + /// and supports the creation of new Thicken features. + core::Ptr thickenFeatures() const; + + /// Returns the collection that provides access to the Unstitch features within the component + /// and supports the creation of new Unstitch features. + core::Ptr unstitchFeatures() const; + + /// Returns the collection that provides access to the Remove features within the component + /// and supports the creation of new Remove features. + core::Ptr removeFeatures() const; + + /// Returns the collection that provides access to the existing base features + /// and supports the creation of new base features. A base feature represents + /// a body that is non-parametric. + core::Ptr baseFeatures() const; + + /// Returns the collection that provides access to the Coil Primitive features within the component. + core::Ptr coilFeatures() const; + + /// Returns the collection that provides access to the existing box features. + core::Ptr boxFeatures() const; + + /// Returns the collection that provides access to the existing cylinder features. + core::Ptr cylinderFeatures() const; + + /// Returns the collection that provides access to the existing sphere features. + core::Ptr sphereFeatures() const; + + /// Returns the collection that provides access to the existing torus features. + core::Ptr torusFeatures() const; + + /// Returns the collection that provides access to the existing pipe features. + core::Ptr pipeFeatues() const; + + /// Returns the collection that provides access to the existing rib features. + core::Ptr ribFeatures() const; + + /// Returns the collection that provides access to the existing web features. + core::Ptr webFeatures() const; + + /// Returns the collection that provides access to the existing form features. + core::Ptr formFeatures() const; + + /// Returns the collection that provides access to the Reverse Normal features within the component + /// and supports the creation of new Reverse Normal features. + core::Ptr reverseNormalFeatures() const; + + /// Returns the collection that provides access to the Patch features within the component + /// and supports the creation of new Patch features. + core::Ptr patchFeatures() const; + + /// Returns the collection that provides access to the existing loft features and + /// supports the creation of new loft features. + core::Ptr loftFeatures() const; + + /// Returns the collection that provides access to the existing form features. + core::Ptr ruleFilletFeatures() const; + + /// Function that returns the specified feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the same name seen in the timeline. + /// Returns the specified item or null if a feature matching the name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// Returns the collection that provides access to the existing Surface Delete Face features. + core::Ptr surfaceDeleteFaceFeatures() const; + + /// Returns the collection that provides access to the existing Delete Face features. + core::Ptr deleteFaceFeatures() const; + + /// Returns the collection that provides access to the existing Offset Face features. + core::Ptr offsetFacesFeatures() const; + + /// Returns the collection that provides access to the existing copy-paste features + /// and supports the creation of new copy-paste features. + core::Ptr copyPasteBodies() const; + + /// Returns the collection that provides access to the existing cut-paste features + /// and supports the creation of new cut-paste features. + core::Ptr cutPasteBodies() const; + + /// Returns the collection that provides access to the existing flange features. + core::Ptr flangeFeatures() const; + + /// Returns the collection that provides access to the existing unfold features. + core::Ptr unfoldFeatures() const; + + /// Returns the collection that provides access to the existing refold features. + core::Ptr refoldFeatures() const; + + /// Returns the collection that provides access to the Ruled Surface features within the component + /// and supports the creation of new Ruled Surface features. + core::Ptr ruledSurfaceFeatures() const; + + /// Returns the collection that provides access to the custom features within the component + /// and supports the creation of new custom features. + core::Ptr customFeatures() const; + + /// Returns the collection that provides access to the Untrim features within the component + /// and supports the creation of new Untrim features. + core::Ptr untrimFeatures() const; + + typedef Feature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_FEATURES_API static const char* classType(); + ADSK_FUSION_FEATURES_API const char* objectType() const override; + ADSK_FUSION_FEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Feature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual ExtrudeFeatures* extrudeFeatures_raw() const = 0; + virtual RevolveFeatures* revolveFeatures_raw() const = 0; + virtual HoleFeatures* holeFeatures_raw() const = 0; + virtual FilletFeatures* filletFeatures_raw() const = 0; + virtual SweepFeatures* sweepFeatures_raw() const = 0; + virtual ChamferFeatures* chamferFeatures_raw() const = 0; + virtual ShellFeatures* shellFeatures_raw() const = 0; + virtual MirrorFeatures* mirrorFeatures_raw() const = 0; + virtual CircularPatternFeatures* circularPatternFeatures_raw() const = 0; + virtual RectangularPatternFeatures* rectangularPatternFeatures_raw() const = 0; + virtual PathPatternFeatures* pathPatternFeatures_raw() const = 0; + virtual CombineFeatures* combineFeatures_raw() const = 0; + virtual ThreadFeatures* threadFeatures_raw() const = 0; + virtual DraftFeatures* draftFeatures_raw() const = 0; + virtual ScaleFeatures* scaleFeatures_raw() const = 0; + virtual Path* createPath_raw(core::Base* curve, bool isChain) = 0; + virtual ReplaceFaceFeatures* replaceFaceFeatures_raw() const = 0; + virtual MoveFeatures* moveFeatures_raw() const = 0; + virtual SplitFaceFeatures* splitFaceFeatures_raw() const = 0; + virtual SplitBodyFeatures* splitBodyFeatures_raw() const = 0; + virtual SilhouetteSplitFeatures* silhouetteSplitFeatures_raw() const = 0; + virtual OffsetFeatures* offsetFeatures_raw() const = 0; + virtual ExtendFeatures* extendFeatures_raw() const = 0; + virtual StitchFeatures* stitchFeatures_raw() const = 0; + virtual BoundaryFillFeatures* boundaryFillFeatures_raw() const = 0; + virtual TrimFeatures* trimFeatures_raw() const = 0; + virtual ThickenFeatures* thickenFeatures_raw() const = 0; + virtual UnstitchFeatures* unstitchFeatures_raw() const = 0; + virtual RemoveFeatures* removeFeatures_raw() const = 0; + virtual BaseFeatures* baseFeatures_raw() const = 0; + virtual CoilFeatures* coilFeatures_raw() const = 0; + virtual BoxFeatures* boxFeatures_raw() const = 0; + virtual CylinderFeatures* cylinderFeatures_raw() const = 0; + virtual SphereFeatures* sphereFeatures_raw() const = 0; + virtual TorusFeatures* torusFeatures_raw() const = 0; + virtual PipeFeatures* pipeFeatues_raw() const = 0; + virtual RibFeatures* ribFeatures_raw() const = 0; + virtual WebFeatures* webFeatures_raw() const = 0; + virtual FormFeatures* formFeatures_raw() const = 0; + virtual ReverseNormalFeatures* reverseNormalFeatures_raw() const = 0; + virtual PatchFeatures* patchFeatures_raw() const = 0; + virtual LoftFeatures* loftFeatures_raw() const = 0; + virtual RuleFilletFeatures* ruleFilletFeatures_raw() const = 0; + virtual Feature* itemByName_raw(const char * name) const = 0; + virtual SurfaceDeleteFaceFeatures* surfaceDeleteFaceFeatures_raw() const = 0; + virtual DeleteFaceFeatures* deleteFaceFeatures_raw() const = 0; + virtual OffsetFacesFeatures* offsetFacesFeatures_raw() const = 0; + virtual CopyPasteBodies* copyPasteBodies_raw() const = 0; + virtual CutPasteBodies* cutPasteBodies_raw() const = 0; + virtual FlangeFeatures* flangeFeatures_raw() const = 0; + virtual UnfoldFeatures* unfoldFeatures_raw() const = 0; + virtual RefoldFeatures* refoldFeatures_raw() const = 0; + virtual RuledSurfaceFeatures* ruledSurfaceFeatures_raw() const = 0; + virtual CustomFeatures* customFeatures_raw() const = 0; + virtual UntrimFeatures* untrimFeatures_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr Features::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t Features::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr Features::extrudeFeatures() const +{ + core::Ptr res = extrudeFeatures_raw(); + return res; +} + +inline core::Ptr Features::revolveFeatures() const +{ + core::Ptr res = revolveFeatures_raw(); + return res; +} + +inline core::Ptr Features::holeFeatures() const +{ + core::Ptr res = holeFeatures_raw(); + return res; +} + +inline core::Ptr Features::filletFeatures() const +{ + core::Ptr res = filletFeatures_raw(); + return res; +} + +inline core::Ptr Features::sweepFeatures() const +{ + core::Ptr res = sweepFeatures_raw(); + return res; +} + +inline core::Ptr Features::chamferFeatures() const +{ + core::Ptr res = chamferFeatures_raw(); + return res; +} + +inline core::Ptr Features::shellFeatures() const +{ + core::Ptr res = shellFeatures_raw(); + return res; +} + +inline core::Ptr Features::mirrorFeatures() const +{ + core::Ptr res = mirrorFeatures_raw(); + return res; +} + +inline core::Ptr Features::circularPatternFeatures() const +{ + core::Ptr res = circularPatternFeatures_raw(); + return res; +} + +inline core::Ptr Features::rectangularPatternFeatures() const +{ + core::Ptr res = rectangularPatternFeatures_raw(); + return res; +} + +inline core::Ptr Features::pathPatternFeatures() const +{ + core::Ptr res = pathPatternFeatures_raw(); + return res; +} + +inline core::Ptr Features::combineFeatures() const +{ + core::Ptr res = combineFeatures_raw(); + return res; +} + +inline core::Ptr Features::threadFeatures() const +{ + core::Ptr res = threadFeatures_raw(); + return res; +} + +inline core::Ptr Features::draftFeatures() const +{ + core::Ptr res = draftFeatures_raw(); + return res; +} + +inline core::Ptr Features::scaleFeatures() const +{ + core::Ptr res = scaleFeatures_raw(); + return res; +} + +inline core::Ptr Features::createPath(const core::Ptr& curve, bool isChain) +{ + core::Ptr res = createPath_raw(curve.get(), isChain); + return res; +} + +inline core::Ptr Features::replaceFaceFeatures() const +{ + core::Ptr res = replaceFaceFeatures_raw(); + return res; +} + +inline core::Ptr Features::moveFeatures() const +{ + core::Ptr res = moveFeatures_raw(); + return res; +} + +inline core::Ptr Features::splitFaceFeatures() const +{ + core::Ptr res = splitFaceFeatures_raw(); + return res; +} + +inline core::Ptr Features::splitBodyFeatures() const +{ + core::Ptr res = splitBodyFeatures_raw(); + return res; +} + +inline core::Ptr Features::silhouetteSplitFeatures() const +{ + core::Ptr res = silhouetteSplitFeatures_raw(); + return res; +} + +inline core::Ptr Features::offsetFeatures() const +{ + core::Ptr res = offsetFeatures_raw(); + return res; +} + +inline core::Ptr Features::extendFeatures() const +{ + core::Ptr res = extendFeatures_raw(); + return res; +} + +inline core::Ptr Features::stitchFeatures() const +{ + core::Ptr res = stitchFeatures_raw(); + return res; +} + +inline core::Ptr Features::boundaryFillFeatures() const +{ + core::Ptr res = boundaryFillFeatures_raw(); + return res; +} + +inline core::Ptr Features::trimFeatures() const +{ + core::Ptr res = trimFeatures_raw(); + return res; +} + +inline core::Ptr Features::thickenFeatures() const +{ + core::Ptr res = thickenFeatures_raw(); + return res; +} + +inline core::Ptr Features::unstitchFeatures() const +{ + core::Ptr res = unstitchFeatures_raw(); + return res; +} + +inline core::Ptr Features::removeFeatures() const +{ + core::Ptr res = removeFeatures_raw(); + return res; +} + +inline core::Ptr Features::baseFeatures() const +{ + core::Ptr res = baseFeatures_raw(); + return res; +} + +inline core::Ptr Features::coilFeatures() const +{ + core::Ptr res = coilFeatures_raw(); + return res; +} + +inline core::Ptr Features::boxFeatures() const +{ + core::Ptr res = boxFeatures_raw(); + return res; +} + +inline core::Ptr Features::cylinderFeatures() const +{ + core::Ptr res = cylinderFeatures_raw(); + return res; +} + +inline core::Ptr Features::sphereFeatures() const +{ + core::Ptr res = sphereFeatures_raw(); + return res; +} + +inline core::Ptr Features::torusFeatures() const +{ + core::Ptr res = torusFeatures_raw(); + return res; +} + +inline core::Ptr Features::pipeFeatues() const +{ + core::Ptr res = pipeFeatues_raw(); + return res; +} + +inline core::Ptr Features::ribFeatures() const +{ + core::Ptr res = ribFeatures_raw(); + return res; +} + +inline core::Ptr Features::webFeatures() const +{ + core::Ptr res = webFeatures_raw(); + return res; +} + +inline core::Ptr Features::formFeatures() const +{ + core::Ptr res = formFeatures_raw(); + return res; +} + +inline core::Ptr Features::reverseNormalFeatures() const +{ + core::Ptr res = reverseNormalFeatures_raw(); + return res; +} + +inline core::Ptr Features::patchFeatures() const +{ + core::Ptr res = patchFeatures_raw(); + return res; +} + +inline core::Ptr Features::loftFeatures() const +{ + core::Ptr res = loftFeatures_raw(); + return res; +} + +inline core::Ptr Features::ruleFilletFeatures() const +{ + core::Ptr res = ruleFilletFeatures_raw(); + return res; +} + +inline core::Ptr Features::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline core::Ptr Features::surfaceDeleteFaceFeatures() const +{ + core::Ptr res = surfaceDeleteFaceFeatures_raw(); + return res; +} + +inline core::Ptr Features::deleteFaceFeatures() const +{ + core::Ptr res = deleteFaceFeatures_raw(); + return res; +} + +inline core::Ptr Features::offsetFacesFeatures() const +{ + core::Ptr res = offsetFacesFeatures_raw(); + return res; +} + +inline core::Ptr Features::copyPasteBodies() const +{ + core::Ptr res = copyPasteBodies_raw(); + return res; +} + +inline core::Ptr Features::cutPasteBodies() const +{ + core::Ptr res = cutPasteBodies_raw(); + return res; +} + +inline core::Ptr Features::flangeFeatures() const +{ + core::Ptr res = flangeFeatures_raw(); + return res; +} + +inline core::Ptr Features::unfoldFeatures() const +{ + core::Ptr res = unfoldFeatures_raw(); + return res; +} + +inline core::Ptr Features::refoldFeatures() const +{ + core::Ptr res = refoldFeatures_raw(); + return res; +} + +inline core::Ptr Features::ruledSurfaceFeatures() const +{ + core::Ptr res = ruledSurfaceFeatures_raw(); + return res; +} + +inline core::Ptr Features::customFeatures() const +{ + core::Ptr res = customFeatures_raw(); + return res; +} + +inline core::Ptr Features::untrimFeatures() const +{ + core::Ptr res = untrimFeatures_raw(); + return res; +} + +template inline void Features::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FilletEdgeSet.h b/usr/autodesk/CPP/include/Fusion/Features/FilletEdgeSet.h new file mode 100644 index 0000000..921f62a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FilletEdgeSet.h @@ -0,0 +1,96 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FILLETEDGESET_CPP__ +# define ADSK_FUSION_FILLETEDGESET_API XI_EXPORT +# else +# define ADSK_FUSION_FILLETEDGESET_API +# endif +#else +# define ADSK_FUSION_FILLETEDGESET_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The base class for the classes that define the different types of fillet edge sets. +class FilletEdgeSet : public core::Base { +public: + + /// Gets and sets the Tangent chain for fillet. This enables tangent chain option for fillet. + bool isTangentChain() const; + bool isTangentChain(bool value); + + ADSK_FUSION_FILLETEDGESET_API static const char* classType(); + ADSK_FUSION_FILLETEDGESET_API const char* objectType() const override; + ADSK_FUSION_FILLETEDGESET_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FILLETEDGESET_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isTangentChain_raw() const = 0; + virtual bool isTangentChain_raw(bool value) = 0; + virtual void placeholderFilletEdgeSet0() {} + virtual void placeholderFilletEdgeSet1() {} + virtual void placeholderFilletEdgeSet2() {} + virtual void placeholderFilletEdgeSet3() {} + virtual void placeholderFilletEdgeSet4() {} + virtual void placeholderFilletEdgeSet5() {} + virtual void placeholderFilletEdgeSet6() {} + virtual void placeholderFilletEdgeSet7() {} + virtual void placeholderFilletEdgeSet8() {} + virtual void placeholderFilletEdgeSet9() {} + virtual void placeholderFilletEdgeSet10() {} + virtual void placeholderFilletEdgeSet11() {} + virtual void placeholderFilletEdgeSet12() {} + virtual void placeholderFilletEdgeSet13() {} + virtual void placeholderFilletEdgeSet14() {} + virtual void placeholderFilletEdgeSet15() {} + virtual void placeholderFilletEdgeSet16() {} + virtual void placeholderFilletEdgeSet17() {} + virtual void placeholderFilletEdgeSet18() {} + virtual void placeholderFilletEdgeSet19() {} + virtual void placeholderFilletEdgeSet20() {} + virtual void placeholderFilletEdgeSet21() {} + virtual void placeholderFilletEdgeSet22() {} + virtual void placeholderFilletEdgeSet23() {} + virtual void placeholderFilletEdgeSet24() {} + virtual void placeholderFilletEdgeSet25() {} + virtual void placeholderFilletEdgeSet26() {} + virtual void placeholderFilletEdgeSet27() {} + virtual void placeholderFilletEdgeSet28() {} + virtual void placeholderFilletEdgeSet29() {} +}; + +// Inline wrappers + +inline bool FilletEdgeSet::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline bool FilletEdgeSet::isTangentChain(bool value) +{ + return isTangentChain_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FILLETEDGESET_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FilletEdgeSets.h b/usr/autodesk/CPP/include/Fusion/Features/FilletEdgeSets.h new file mode 100644 index 0000000..1bf33e0 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FilletEdgeSets.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FILLETEDGESETS_CPP__ +# define ADSK_FUSION_FILLETEDGESETS_API XI_EXPORT +# else +# define ADSK_FUSION_FILLETEDGESETS_API +# endif +#else +# define ADSK_FUSION_FILLETEDGESETS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class FilletEdgeSet; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing fillet edge sets associated with a fillet feature. +class FilletEdgeSets : public core::Base { +public: + + /// Function that returns the specified fillet edge set using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of fillet edge sets in the collection. + size_t count() const; + + typedef FilletEdgeSet iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_FILLETEDGESETS_API static const char* classType(); + ADSK_FUSION_FILLETEDGESETS_API const char* objectType() const override; + ADSK_FUSION_FILLETEDGESETS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FILLETEDGESETS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual FilletEdgeSet* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr FilletEdgeSets::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t FilletEdgeSets::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void FilletEdgeSets::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FILLETEDGESETS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FilletFeature.h b/usr/autodesk/CPP/include/Fusion/Features/FilletFeature.h new file mode 100644 index 0000000..655a539 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FilletFeature.h @@ -0,0 +1,144 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FILLETFEATURE_CPP__ +# define ADSK_FUSION_FILLETFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_FILLETFEATURE_API +# endif +#else +# define ADSK_FUSION_FILLETFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class FilletEdgeSets; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing fillet feature in a design. +class FilletFeature : public Feature { +public: + + /// Returns the edge sets collection associated with this fillet. + core::Ptr edgeSets() const; + + /// Gets and sets if the fillet uses the G2 (curvature-continuity) surface quality option. + bool isG2() const; + bool isG2(bool value); + + /// Gets and sets if a rolling ball solution is to be used in any corners. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isRollingBallCorner() const; + bool isRollingBallCorner(bool value); + + /// Gets and sets whether or not edges that are tangentially connected to + /// the input edges (if any) will also be filleted. + bool isTangentChain() const; + bool isTangentChain(bool value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of its parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_FILLETFEATURE_API static const char* classType(); + ADSK_FUSION_FILLETFEATURE_API const char* objectType() const override; + ADSK_FUSION_FILLETFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FILLETFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual FilletEdgeSets* edgeSets_raw() const = 0; + virtual bool isG2_raw() const = 0; + virtual bool isG2_raw(bool value) = 0; + virtual bool isRollingBallCorner_raw() const = 0; + virtual bool isRollingBallCorner_raw(bool value) = 0; + virtual bool isTangentChain_raw() const = 0; + virtual bool isTangentChain_raw(bool value) = 0; + virtual FilletFeature* nativeObject_raw() const = 0; + virtual FilletFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr FilletFeature::edgeSets() const +{ + core::Ptr res = edgeSets_raw(); + return res; +} + +inline bool FilletFeature::isG2() const +{ + bool res = isG2_raw(); + return res; +} + +inline bool FilletFeature::isG2(bool value) +{ + return isG2_raw(value); +} + +inline bool FilletFeature::isRollingBallCorner() const +{ + bool res = isRollingBallCorner_raw(); + return res; +} + +inline bool FilletFeature::isRollingBallCorner(bool value) +{ + return isRollingBallCorner_raw(value); +} + +inline bool FilletFeature::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline bool FilletFeature::isTangentChain(bool value) +{ + return isTangentChain_raw(value); +} + +inline core::Ptr FilletFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr FilletFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FILLETFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FilletFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/FilletFeatureInput.h new file mode 100644 index 0000000..7616595 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FilletFeatureInput.h @@ -0,0 +1,219 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FILLETFEATUREINPUT_CPP__ +# define ADSK_FUSION_FILLETFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_FILLETFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_FILLETFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a fillet +/// feature. +class FilletFeatureInput : public core::Base { +public: + + /// Adds a set of edges with a constant radius to this input. + /// edges : An ObjectCollection containing the edges to be filleted. If the isTangentChain argument is true + /// additional edges may also get filleted if they are tangentially connected to any of the + /// input edges. + /// radius : A ValueInput object that defines the radius of the fillet. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "2 in") or if no units are specified + /// it is interpreted using the current default units for length. + /// isTangentChain : A boolean value for setting whether or not edges that are tangentially connected to + /// the input edges (if any) will also be filleted. + /// Returns true if the set of edges was successfully added to the FilletFeatureInput. + bool addConstantRadiusEdgeSet(const core::Ptr& edges, const core::Ptr& radius, bool isTangentChain); + + /// Adds a single edge or set of tangent edges along with variable radius information to this input. + /// tangentEdges : An object collection containing a single edge or multiple edges. Multiple edges + /// must be tangentially connected and added to the collection in order. + /// startRadius : A ValueInput object that defines the starting radius of the fillet. If a single edge is + /// being filleted, the start radius is at the start end of the edge. If multiple tangent + /// edges are being filleted the start radius is the open end of the first edge in the + /// collection. + /// If the ValueInput uses a real then it is interpreted as centimeters. If it is a string then + /// the units can be defined as part of the string (i.e. "2 in") or if no units are specified + /// it is interpreted using the current default units for length. + /// endRadius : A ValueInput object that defines the ending radius of the fillet. If a single edge is + /// being filleted, the end radius is at the end of the edge. If multiple tangent + /// edges are being filleted the end radius is the open end of the last edge in the + /// collection. + /// If the ValueInput uses a real then it is interpreted as centimeters. If it is a string then + /// the units can be defined as part of the string (i.e. "2 in") or if no units are specified + /// it is interpreted using the current default units for length. + /// positions : An array of ValueInput objects that defines the positions of any additional radii + /// along the edge(s). The value must be between 0 and 1 and defines the percentage along the + /// curve where a radius is defined. The value is unitless. This array must have the same + /// number of values as the array passed in for the radii argument. + /// radii : An array of ValueInput objects that define the radii at positions along the edge(s). + /// This array must have the same number of values as the array passed in for + /// the positions argument. If the ValueInput uses a real then it is interpreted as centimeters. + /// If it is a string then the units can be defined as part of the string (i.e. "2 in"). + /// If no units are specified it will be interpreted using the current default units for length. + /// Returns true if the edge set was successfully added to the FilletFeatureInput. + bool addVariableRadiusEdgeSet(const core::Ptr& tangentEdges, const core::Ptr& startRadius, const core::Ptr& endRadius, const std::vector>& positions, const std::vector>& radii); + + /// Gets and sets if the fillet uses the G2 (curvature-continuity) surface quality option . + bool isG2() const; + bool isG2(bool value); + + /// Gets and sets if a rolling ball or setback solution is to be used in any corners. + bool isRollingBallCorner() const; + bool isRollingBallCorner(bool value); + + /// Gets and sets if any edges that are tangentially connected to any of filleted + /// edges will also be included in the fillet. + bool isTangentChain() const; + bool isTangentChain(bool value); + + /// Adds a set of edges with a chord length to this input. + /// edges : An ObjectCollection containing the edges to be filleted. If the isTangentChain argument is true + /// additional edges may also get filleted if they are tangentially connected to any of the + /// input edges. + /// chordLength : A ValueInput object that defines the chord length of the fillet. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "2 in") or if no units are specified + /// it is interpreted using the current default units for length. + /// isTangentChain : A boolean value for setting whether or not edges that are tangentially connected to + /// the input edges (if any) will also be filleted. + /// Returns true if the set of edges was successfully added to the FilletFeatureInput. + bool addChordLengthEdgeSet(const core::Ptr& edges, const core::Ptr& chordLength, bool isTangentChain); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_FILLETFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_FILLETFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_FILLETFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FILLETFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool addConstantRadiusEdgeSet_raw(core::ObjectCollection* edges, core::ValueInput* radius, bool isTangentChain) = 0; + virtual bool addVariableRadiusEdgeSet_raw(core::ObjectCollection* tangentEdges, core::ValueInput* startRadius, core::ValueInput* endRadius, core::ValueInput** positions, size_t positions_size, core::ValueInput** radii, size_t radii_size) = 0; + virtual bool isG2_raw() const = 0; + virtual bool isG2_raw(bool value) = 0; + virtual bool isRollingBallCorner_raw() const = 0; + virtual bool isRollingBallCorner_raw(bool value) = 0; + virtual bool isTangentChain_raw() const = 0; + virtual bool isTangentChain_raw(bool value) = 0; + virtual bool addChordLengthEdgeSet_raw(core::ObjectCollection* edges, core::ValueInput* chordLength, bool isTangentChain) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline bool FilletFeatureInput::addConstantRadiusEdgeSet(const core::Ptr& edges, const core::Ptr& radius, bool isTangentChain) +{ + bool res = addConstantRadiusEdgeSet_raw(edges.get(), radius.get(), isTangentChain); + return res; +} + +inline bool FilletFeatureInput::addVariableRadiusEdgeSet(const core::Ptr& tangentEdges, const core::Ptr& startRadius, const core::Ptr& endRadius, const std::vector>& positions, const std::vector>& radii) +{ + core::ValueInput** positions_ = new core::ValueInput*[positions.size()]; + for(size_t i=0; i& edges, const core::Ptr& chordLength, bool isTangentChain) +{ + bool res = addChordLengthEdgeSet_raw(edges.get(), chordLength.get(), isTangentChain); + return res; +} + +inline core::Ptr FilletFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool FilletFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FILLETFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FilletFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/FilletFeatures.h new file mode 100644 index 0000000..6564c5a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FilletFeatures.h @@ -0,0 +1,129 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FILLETFEATURES_CPP__ +# define ADSK_FUSION_FILLETFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_FILLETFEATURES_API +# endif +#else +# define ADSK_FUSION_FILLETFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class FilletFeature; + class FilletFeatureInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing fillet features in a component +/// and supports the ability to create new fillet features. +class FilletFeatures : public core::Base { +public: + + /// Function that returns the specified fillet feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of fillet features in the collection. + size_t count() const; + + /// Creates a FilletFeatureInput object. Use properties and methods on this object + /// to define the fillet you want to create and then use the Add method, passing in + /// the FilletFeatureInput object. + /// Returns the newly created FilletFeatureInput object or null if the creation failed. + core::Ptr createInput() const; + + /// Creates a new fillet feature. + /// input : A FilletFeatureInput object that defines the desired fillet. Use the createInput + /// method to create a new FilletFeatureInput object and then use methods on it + /// (the FilletFeatureInput object) to define the fillet. + /// Returns the newly created FilletFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified fillet feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef FilletFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_FILLETFEATURES_API static const char* classType(); + ADSK_FUSION_FILLETFEATURES_API const char* objectType() const override; + ADSK_FUSION_FILLETFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FILLETFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual FilletFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual FilletFeatureInput* createInput_raw() const = 0; + virtual FilletFeature* add_raw(FilletFeatureInput* input) = 0; + virtual FilletFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr FilletFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t FilletFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr FilletFeatures::createInput() const +{ + core::Ptr res = createInput_raw(); + return res; +} + +inline core::Ptr FilletFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr FilletFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void FilletFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FILLETFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FlangeFeature.h b/usr/autodesk/CPP/include/Fusion/Features/FlangeFeature.h new file mode 100644 index 0000000..81e4eba --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FlangeFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FLANGEFEATURE_CPP__ +# define ADSK_FUSION_FLANGEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_FLANGEFEATURE_API +# endif +#else +# define ADSK_FUSION_FLANGEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing flange feature in a design. +class FlangeFeature : public Feature { +public: + + ADSK_FUSION_FLANGEFEATURE_API static const char* classType(); + ADSK_FUSION_FLANGEFEATURE_API const char* objectType() const override; + ADSK_FUSION_FLANGEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FLANGEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FLANGEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FlangeFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/FlangeFeatures.h new file mode 100644 index 0000000..948d17d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FlangeFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FLANGEFEATURES_CPP__ +# define ADSK_FUSION_FLANGEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_FLANGEFEATURES_API +# endif +#else +# define ADSK_FUSION_FLANGEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class FlangeFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing flange features in a design. +class FlangeFeatures : public core::Base { +public: + + /// Function that returns the specified flange feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of flange features in the collection. + size_t count() const; + + /// Function that returns the specified flange feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef FlangeFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_FLANGEFEATURES_API static const char* classType(); + ADSK_FUSION_FLANGEFEATURES_API const char* objectType() const override; + ADSK_FUSION_FLANGEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FLANGEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual FlangeFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual FlangeFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr FlangeFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t FlangeFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr FlangeFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void FlangeFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FLANGEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FormFeature.h b/usr/autodesk/CPP/include/Fusion/Features/FormFeature.h new file mode 100644 index 0000000..608155f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FormFeature.h @@ -0,0 +1,86 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FORMFEATURE_CPP__ +# define ADSK_FUSION_FORMFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_FORMFEATURE_API +# endif +#else +# define ADSK_FUSION_FORMFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TSplineBodies; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing Form feature in a design. +class FormFeature : public Feature { +public: + + /// Returns a TSplineBodies collection where you can access any existing + /// T-Spline bodies and through it create new T-Spline bodies. + core::Ptr tSplineBodies() const; + + /// Set the user-interface so that the form body is in edit mode. + /// Returns true if successful. + bool startEdit(); + + /// Exits from edit mode in the user-interface. If this form feature in not + /// in edit mode, then nothing happens. + /// Returns true if successful. + bool finishEdit(); + + ADSK_FUSION_FORMFEATURE_API static const char* classType(); + ADSK_FUSION_FORMFEATURE_API const char* objectType() const override; + ADSK_FUSION_FORMFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FORMFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual TSplineBodies* tSplineBodies_raw() const = 0; + virtual bool startEdit_raw() = 0; + virtual bool finishEdit_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr FormFeature::tSplineBodies() const +{ + core::Ptr res = tSplineBodies_raw(); + return res; +} + +inline bool FormFeature::startEdit() +{ + bool res = startEdit_raw(); + return res; +} + +inline bool FormFeature::finishEdit() +{ + bool res = finishEdit_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FORMFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FormFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/FormFeatures.h new file mode 100644 index 0000000..0a2dbd8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FormFeatures.h @@ -0,0 +1,111 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FORMFEATURES_CPP__ +# define ADSK_FUSION_FORMFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_FORMFEATURES_API +# endif +#else +# define ADSK_FUSION_FORMFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class FormFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Form features in a component. +class FormFeatures : public core::Base { +public: + + /// Function that returns the specified Form feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified form feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of Form features in the collection. + size_t count() const; + + /// Creates a new empty form feature in the parent component. + /// Returns the new FormFeature or null in the case of an error. + core::Ptr add(); + + typedef FormFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_FORMFEATURES_API static const char* classType(); + ADSK_FUSION_FORMFEATURES_API const char* objectType() const override; + ADSK_FUSION_FORMFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FORMFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual FormFeature* item_raw(size_t index) const = 0; + virtual FormFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual FormFeature* add_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr FormFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr FormFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t FormFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr FormFeatures::add() +{ + core::Ptr res = add_raw(); + return res; +} + +template inline void FormFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FORMFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/FromEntityStartDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/FromEntityStartDefinition.h new file mode 100644 index 0000000..b12f114 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/FromEntityStartDefinition.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FROMENTITYSTARTDEFINITION_CPP__ +# define ADSK_FUSION_FROMENTITYSTARTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_FROMENTITYSTARTDEFINITION_API +# endif +#else +# define ADSK_FUSION_FROMENTITYSTARTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// A definition object that is used to define a feature whose start is defined by a specified construction +/// plane or face. If a face is specified it must be large enough to completely contain the projected profile. +class FromEntityStartDefinition : public ExtentDefinition { +public: + + /// Statically creates a new FromEntityStartDefinition object. This is used as input when + /// create a new feature and defining the starting condition. + /// entity : An input construction plane or face that defines the start of the feature. If a face is specified it + /// must be large enough to completely contain the projected profile. + /// offset : An input ValueInput objects that defines the offset distance from the specified entity. The offset can be positive or + /// negative. A positive value indicates an offset in the same direction as the positive normal direction of the face. + /// Returns the newly created FromEntityStartDefinition or null in the case of a failure. + static core::Ptr create(const core::Ptr& entity, const core::Ptr& offset); + + /// Gets the currently defined offset value. If the FromEntityStartDefinition object was + /// created statically and is not associated with a feature, this will return a ValueInput object. + /// if the FromEntityStartDefinition is associated with an existing feature, this will return + /// the parameter that was created when the feature was created. To edit the offset, use properties + /// on the parameter to change the value of the parameter. + core::Ptr offset() const; + + /// Gets and sets the entity defining the start of the feature. + core::Ptr entity() const; + bool entity(const core::Ptr& value); + + ADSK_FUSION_FROMENTITYSTARTDEFINITION_API static const char* classType(); + ADSK_FUSION_FROMENTITYSTARTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_FROMENTITYSTARTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FROMENTITYSTARTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_FROMENTITYSTARTDEFINITION_API static FromEntityStartDefinition* create_raw(core::Base* entity, core::ValueInput* offset); + virtual core::Base* offset_raw() const = 0; + virtual core::Base* entity_raw() const = 0; + virtual bool entity_raw(core::Base* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr FromEntityStartDefinition::create(const core::Ptr& entity, const core::Ptr& offset) +{ + core::Ptr res = create_raw(entity.get(), offset.get()); + return res; +} + +inline core::Ptr FromEntityStartDefinition::offset() const +{ + core::Ptr res = offset_raw(); + return res; +} + +inline core::Ptr FromEntityStartDefinition::entity() const +{ + core::Ptr res = entity_raw(); + return res; +} + +inline bool FromEntityStartDefinition::entity(const core::Ptr& value) +{ + return entity_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FROMENTITYSTARTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/HoleFeature.h b/usr/autodesk/CPP/include/Fusion/Features/HoleFeature.h new file mode 100644 index 0000000..9bec4fa --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/HoleFeature.h @@ -0,0 +1,516 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_HOLEFEATURE_CPP__ +# define ADSK_FUSION_HOLEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_HOLEFEATURE_API +# endif +#else +# define ADSK_FUSION_HOLEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepEdge; + class BRepFaces; + class ExtentDefinition; + class HolePositionDefinition; + class ModelParameter; + class Occurrence; + class SketchPoint; +}} +namespace adsk { namespace core { + class ObjectCollection; + class Point3D; + class ValueInput; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing hole feature in a design. +class HoleFeature : public Feature { +public: + + /// Returns the position of the hole. + core::Ptr position() const; + + /// Returns the direction of the hole. + core::Ptr direction() const; + + /// Returns the current type of hole this feature represents. + HoleTypes holeType() const; + + /// Returns the model parameter controlling the hole diameter. The diameter of + /// the hole can be edited through the returned parameter object. + core::Ptr holeDiameter() const; + + /// Returns the model parameter controlling the angle of the tip of the hole. The tip angle of + /// the hole can be edited through the returned parameter object. + core::Ptr tipAngle() const; + + /// Returns the model parameter controlling the counterbore diameter. + /// This will return null in the case the hole type is not a counterbore. + /// The diameter of the counterbore can be edited through the returned parameter. + core::Ptr counterboreDiameter() const; + + /// Returns the model parameter controlling the counterbore depth. + /// This will return null in the case the hole type is not a counterbore. + /// The depth of the counterbore can be edited through the returned parameter. + core::Ptr counterboreDepth() const; + + /// Returns the model parameter controlling the countersink diameter. + /// This will return null in the case the hole type is not a countersink. + /// The diameter of the countersink can be edited through the returned parameter. + core::Ptr countersinkDiameter() const; + + /// Returns the model parameter controlling the countersink angle. + /// This will return null in the case the hole type is not a countersink. + /// The angle of the countersink can be edited through the returned parameter. + core::Ptr countersinkAngle() const; + + /// Gets and sets if the hole is in the default direction or not. + bool isDefaultDirection() const; + bool isDefaultDirection(bool value); + + /// Calling this method will change the hole to a simple hole. + /// Returns true if changing the hole was successful. + bool setToSimple(); + + /// Calling this method will change the hole to a counterbore hole. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// counterboreDiameter : A ValueInput object that defines the counterbore diameter. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "3 in"). If no units are specified + /// it is interpreted using the current default units for length. + /// counterboreDepth : A ValueInput object that defines the counterbore depth. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "3 in"). If no units are specified + /// it is interpreted using the current default units for length. + /// Returns true if changing the hole was successful. + bool setToCounterbore(const core::Ptr& counterboreDiameter, const core::Ptr& counterboreDepth); + + /// Calling this method will change the hole to a countersink hole. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// countersinkDiameter : A ValueInput object that defines the countersink diameter. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "3 in"). If no units are specified + /// it is interpreted using the current default units for length. + /// countersinkAngle : A ValueInput object that defines the countersink angle. If the ValueInput uses + /// a real then it is interpreted as radians. If it is a string then the units + /// can be defined as part of the string (i.e. "120 deg"). If no units are specified + /// it is interpreted using the current default units for length. + /// Returns true if changing the hole was successful. + bool setToCountersink(const core::Ptr& countersinkDiameter, const core::Ptr& countersinkAngle); + + /// Gets the definition object that is defining the extent of the hole. Modifying the + /// definition object will cause the hole to recompute. The extent type of a hole + /// is currently limited to a distance extent. + core::Ptr extentDefinition() const; + + /// Defines the depth of the hole using a specific distance. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// distance : The depth of the hole. If a real is specified the value is in centimeters. If a string is + /// specified the units are derived from the string. If no units are specified, the default + /// units of the document are used. + /// Returns true if setting the extent was successful. + bool setDistanceExtent(const core::Ptr& distance); + + /// Defines the extent of the hole to be through-all. The direction can be + /// either positive, negative. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// direction : The direction of the hole relative to the normal of the sketch plane. + /// Returns true if successful. + bool setAllExtent(ExtentDirections direction); + + /// Sets the extent of the hole to be from the sketch plane to the specified "to" face. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// toEntity : The entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For a hole it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// matchShape : Indicates if the hole is not contained on the face that the hole should match + /// the shape of the entity as if it extended beyond it's current boundaries. + /// directionHint : Specifies the direction of the hole. This is only used in the case where there are two possible solutions and the hole can + /// hit the toEntity in either direction. + /// Typically there is only a single solution and the direction is determined automatically. + /// Returns true if successful. + bool setOneSideToExtent(const core::Ptr& toEntity, bool matchShape, const core::Ptr& directionHint = NULL); + + /// Property that returns the faces at the bottom of the hole. This will typically be a single face + /// but could return more than one face in the case where the bottom of the hole is uneven. + core::Ptr endFaces() const; + + /// Property that returns all of the side faces of the hole. + core::Ptr sideFaces() const; + + /// Redefines the position of a the hole using a point. The point can be a vertex on the face + /// or it can be a Point3D object to define any location on the face. If a Point3D object is + /// provided it will be projected onto the plane along the planes normal. The orientation of the + /// hole is defined by the planar face or construction plane. If a vertex is used, the position of + /// the hole is associative to that vertex. If a Point3D object is used the position of the hole + /// is not associative. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// planarEntity : The planar BRepFace or ConstructionPlane object that defines the orientation of the hole. + /// The natural direction of the hole will be opposite the normal of the face or construction plane. + /// point : A Point3D object or vertex that defines the position of the hole. The point will be projected + /// onto the plane along the normal of the plane. + /// Returns true if successful. + bool setPositionByPoint(const core::Ptr& planarEntity, const core::Ptr& point); + + /// Redefines the position of the hole at the center of a circular or elliptical edge of the face. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// planarEntity : The planar BRepFace or ConstructionPlane object that defines the orientation of the hole. + /// The natural direction of the hole will be opposite the normal of the face or construction plane. + /// centerEdge : A circular or elliptical edge whose center point will be the position of the hole. + /// Returns true if successful. + bool setPositionAtCenter(const core::Ptr& planarEntity, const core::Ptr& centerEdge); + + /// Redefines the position and orientation of the hole using a sketch point. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// sketchPoint : The sketch point that defines the position of the hole. The orientation is + /// inferred from the normal of the point's parent sketch. The natural direction will be + /// opposite the normal of the sketch. + /// Returns true if successful. + bool setPositionBySketchPoint(const core::Ptr& sketchPoint); + + /// Redefines the position and orientation of the hole using a set of points. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// sketchPoints : A collection of sketch points that defines the positions of the holes. The orientation is + /// inferred from the normal of the point's parent sketch. The natural direction will be + /// opposite the normal of the sketch. All of the points must be in the same sketch. + /// Returns true if successful. + bool setPositionBySketchPoints(const core::Ptr& sketchPoints); + + /// Redefines the orientation of the hole using a planar face or construction plane. + /// The position of the hole is defined by the distance from one or two edges. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// planarEntity : The planar BRepFace or ConstructionPlane object that defines the orientation of the hole. + /// The natural direction of the hole will be opposite the normal of the face or construction plane. + /// point : A Point3D object that defines the approximate initial position of the hole. The point will be + /// projected onto the plane. This point should be close to the final position of the hole and + /// is used to determine which solution out of several possible solutions should be chosen + /// for the hole location. + /// edgeOne : A linear BRepEdge object that the position of the hole will be measured from. The position + /// of the hole will be measured along a perpendicular from this edge. + /// offsetOne : A ValueInput object that defines the offset distance from edgeOne. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "3 in"). If no units are specified + /// it is interpreted using the current default units for length. + /// edgeTwo : You can optionally define a second edge and offset to specify the position of the hole. If you use a + /// second edge it has the same requirements as the edgeOne argument. If you provide a second edge you + /// must also provide the offsetTwo argument. + /// offsetTwo : If edgeTwo is defined, you must provide this argument which is a ValueInput object that + /// defines the offset from the edgeTwo. If the ValueInput uses a real then it is interpreted + /// as centimeters. If it is a string then the units can be defined as part of the string + /// (i.e. "3 in"). If no units are specified it is interpreted using the current default units + /// for length. + /// Returns true if successful. + bool setPositionByPlaneAndOffsets(const core::Ptr& planarEntity, const core::Ptr& point, const core::Ptr& edgeOne, const core::Ptr& offsetOne, const core::Ptr& edgeTwo = NULL, const core::Ptr& offsetTwo = NULL); + + /// Redefines the position and orientation of the hole to be on the start, end or center of an edge. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// planarEntity : The planar BRepFace or ConstructionPlane object that defines the orientation of the hole + /// and start of the hole. The natural direction of the hole will be opposite the normal of + /// the face or construction plane. + /// edge : The edge to position the hole on. + /// position : The position along the edge to place the hole. + /// Returns true if successful. + bool setPositionOnEdge(const core::Ptr& planarEntity, const core::Ptr& edge, HoleEdgePositions position); + + /// Returns a HolePositionDefinition object that provides access to the information used + /// to define the position of the hole. This returns null in the case where IsParametric + /// is false. + core::Ptr holePositionDefinition() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Gets and sets the list of bodies that will participate in the feature when the operation is a cut or intersection. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + std::vector> participantBodies() const; + bool participantBodies(const std::vector>& value); + + ADSK_FUSION_HOLEFEATURE_API static const char* classType(); + ADSK_FUSION_HOLEFEATURE_API const char* objectType() const override; + ADSK_FUSION_HOLEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_HOLEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Point3D* position_raw() const = 0; + virtual core::Vector3D* direction_raw() const = 0; + virtual HoleTypes holeType_raw() const = 0; + virtual ModelParameter* holeDiameter_raw() const = 0; + virtual ModelParameter* tipAngle_raw() const = 0; + virtual ModelParameter* counterboreDiameter_raw() const = 0; + virtual ModelParameter* counterboreDepth_raw() const = 0; + virtual ModelParameter* countersinkDiameter_raw() const = 0; + virtual ModelParameter* countersinkAngle_raw() const = 0; + virtual bool isDefaultDirection_raw() const = 0; + virtual bool isDefaultDirection_raw(bool value) = 0; + virtual bool setToSimple_raw() = 0; + virtual bool setToCounterbore_raw(core::ValueInput* counterboreDiameter, core::ValueInput* counterboreDepth) = 0; + virtual bool setToCountersink_raw(core::ValueInput* countersinkDiameter, core::ValueInput* countersinkAngle) = 0; + virtual ExtentDefinition* extentDefinition_raw() const = 0; + virtual bool setDistanceExtent_raw(core::ValueInput* distance) = 0; + virtual bool setAllExtent_raw(ExtentDirections direction) = 0; + virtual bool setOneSideToExtent_raw(core::Base* toEntity, bool matchShape, core::Vector3D* directionHint) = 0; + virtual BRepFaces* endFaces_raw() const = 0; + virtual BRepFaces* sideFaces_raw() const = 0; + virtual bool setPositionByPoint_raw(core::Base* planarEntity, core::Base* point) = 0; + virtual bool setPositionAtCenter_raw(core::Base* planarEntity, BRepEdge* centerEdge) = 0; + virtual bool setPositionBySketchPoint_raw(SketchPoint* sketchPoint) = 0; + virtual bool setPositionBySketchPoints_raw(core::ObjectCollection* sketchPoints) = 0; + virtual bool setPositionByPlaneAndOffsets_raw(core::Base* planarEntity, core::Point3D* point, BRepEdge* edgeOne, core::ValueInput* offsetOne, BRepEdge* edgeTwo, core::ValueInput* offsetTwo) = 0; + virtual bool setPositionOnEdge_raw(core::Base* planarEntity, BRepEdge* edge, HoleEdgePositions position) = 0; + virtual HolePositionDefinition* holePositionDefinition_raw() const = 0; + virtual HoleFeature* nativeObject_raw() const = 0; + virtual HoleFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual BRepBody** participantBodies_raw(size_t& return_size) const = 0; + virtual bool participantBodies_raw(BRepBody** value, size_t value_size) = 0; +}; + +// Inline wrappers + +inline core::Ptr HoleFeature::position() const +{ + core::Ptr res = position_raw(); + return res; +} + +inline core::Ptr HoleFeature::direction() const +{ + core::Ptr res = direction_raw(); + return res; +} + +inline HoleTypes HoleFeature::holeType() const +{ + HoleTypes res = holeType_raw(); + return res; +} + +inline core::Ptr HoleFeature::holeDiameter() const +{ + core::Ptr res = holeDiameter_raw(); + return res; +} + +inline core::Ptr HoleFeature::tipAngle() const +{ + core::Ptr res = tipAngle_raw(); + return res; +} + +inline core::Ptr HoleFeature::counterboreDiameter() const +{ + core::Ptr res = counterboreDiameter_raw(); + return res; +} + +inline core::Ptr HoleFeature::counterboreDepth() const +{ + core::Ptr res = counterboreDepth_raw(); + return res; +} + +inline core::Ptr HoleFeature::countersinkDiameter() const +{ + core::Ptr res = countersinkDiameter_raw(); + return res; +} + +inline core::Ptr HoleFeature::countersinkAngle() const +{ + core::Ptr res = countersinkAngle_raw(); + return res; +} + +inline bool HoleFeature::isDefaultDirection() const +{ + bool res = isDefaultDirection_raw(); + return res; +} + +inline bool HoleFeature::isDefaultDirection(bool value) +{ + return isDefaultDirection_raw(value); +} + +inline bool HoleFeature::setToSimple() +{ + bool res = setToSimple_raw(); + return res; +} + +inline bool HoleFeature::setToCounterbore(const core::Ptr& counterboreDiameter, const core::Ptr& counterboreDepth) +{ + bool res = setToCounterbore_raw(counterboreDiameter.get(), counterboreDepth.get()); + return res; +} + +inline bool HoleFeature::setToCountersink(const core::Ptr& countersinkDiameter, const core::Ptr& countersinkAngle) +{ + bool res = setToCountersink_raw(countersinkDiameter.get(), countersinkAngle.get()); + return res; +} + +inline core::Ptr HoleFeature::extentDefinition() const +{ + core::Ptr res = extentDefinition_raw(); + return res; +} + +inline bool HoleFeature::setDistanceExtent(const core::Ptr& distance) +{ + bool res = setDistanceExtent_raw(distance.get()); + return res; +} + +inline bool HoleFeature::setAllExtent(ExtentDirections direction) +{ + bool res = setAllExtent_raw(direction); + return res; +} + +inline bool HoleFeature::setOneSideToExtent(const core::Ptr& toEntity, bool matchShape, const core::Ptr& directionHint) +{ + bool res = setOneSideToExtent_raw(toEntity.get(), matchShape, directionHint.get()); + return res; +} + +inline core::Ptr HoleFeature::endFaces() const +{ + core::Ptr res = endFaces_raw(); + return res; +} + +inline core::Ptr HoleFeature::sideFaces() const +{ + core::Ptr res = sideFaces_raw(); + return res; +} + +inline bool HoleFeature::setPositionByPoint(const core::Ptr& planarEntity, const core::Ptr& point) +{ + bool res = setPositionByPoint_raw(planarEntity.get(), point.get()); + return res; +} + +inline bool HoleFeature::setPositionAtCenter(const core::Ptr& planarEntity, const core::Ptr& centerEdge) +{ + bool res = setPositionAtCenter_raw(planarEntity.get(), centerEdge.get()); + return res; +} + +inline bool HoleFeature::setPositionBySketchPoint(const core::Ptr& sketchPoint) +{ + bool res = setPositionBySketchPoint_raw(sketchPoint.get()); + return res; +} + +inline bool HoleFeature::setPositionBySketchPoints(const core::Ptr& sketchPoints) +{ + bool res = setPositionBySketchPoints_raw(sketchPoints.get()); + return res; +} + +inline bool HoleFeature::setPositionByPlaneAndOffsets(const core::Ptr& planarEntity, const core::Ptr& point, const core::Ptr& edgeOne, const core::Ptr& offsetOne, const core::Ptr& edgeTwo, const core::Ptr& offsetTwo) +{ + bool res = setPositionByPlaneAndOffsets_raw(planarEntity.get(), point.get(), edgeOne.get(), offsetOne.get(), edgeTwo.get(), offsetTwo.get()); + return res; +} + +inline bool HoleFeature::setPositionOnEdge(const core::Ptr& planarEntity, const core::Ptr& edge, HoleEdgePositions position) +{ + bool res = setPositionOnEdge_raw(planarEntity.get(), edge.get(), position); + return res; +} + +inline core::Ptr HoleFeature::holePositionDefinition() const +{ + core::Ptr res = holePositionDefinition_raw(); + return res; +} + +inline core::Ptr HoleFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr HoleFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline std::vector> HoleFeature::participantBodies() const +{ + std::vector> res; + size_t s; + + BRepBody** p= participantBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool HoleFeature::participantBodies(const std::vector>& value) +{ + BRepBody** value_ = new BRepBody*[value.size()]; + for(size_t i=0; i + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_HOLEFEATUREINPUT_CPP__ +# define ADSK_FUSION_HOLEFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_HOLEFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_HOLEFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepBody; + class BRepEdge; + class Occurrence; + class SketchPoint; +}} +namespace adsk { namespace core { + class ObjectCollection; + class Point3D; + class ValueInput; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a hole +/// feature. +class HoleFeatureInput : public core::Base { +public: + + /// Defines the position of a the hole using a point. The point can be a vertex on the face + /// or it can be a Point3D object to define any location on the face. If a Point3D object is + /// provided it will be projected onto the plane along the planes normal. The orientation of the + /// hole is defined by the planar face or construction plane. If a vertex is used, the position of + /// the hole is associative to that vertex. If a Point3D object is used the position of the hole + /// is not associative. + /// planarEntity : The planar BRepFace or ConstructionPlane object that defines the orientation of the hole. + /// The natural direction of the hole will be opposite the normal of the face or construction plane. + /// point : A Point3D object or vertex that defines the position of the hole. The point will be projected + /// onto the plane along the normal of the plane. + /// Returns true if successful. + bool setPositionByPoint(const core::Ptr& planarEntity, const core::Ptr& point); + + /// Defines the position of the hole at the center of a circular or elliptical edge of the face. + /// planarEntity : The planar BRepFace or ConstructionPlane object that defines the orientation of the hole. + /// The natural direction of the hole will be opposite the normal of the face or construction plane. + /// centerEdge : A circular or elliptical edge whose center point will be the position of the hole. + /// Returns true if successful. + bool setPositionAtCenter(const core::Ptr& planarEntity, const core::Ptr& centerEdge); + + /// Defines the position and orientation of the hole using a sketch point. + /// sketchPoint : The sketch point that defines the position of the hole. The orientation is + /// inferred from the normal of the point's parent sketch. The natural direction will be + /// opposite the normal of the sketch. + /// Returns true if successful. + bool setPositionBySketchPoint(const core::Ptr& sketchPoint); + + /// Defines the orientation of the hole using a planar face or construction plane. + /// The position of the hole is defined by the distance from one or two edges. + /// planarEntity : The planar BRepFace or ConstructionPlane object that defines the orientation of the hole. + /// The natural direction of the hole will be opposite the normal of the face or construction plane. + /// point : A Point3D object that defines the approximate initial position of the hole. The point will be + /// projected onto the plane. This point should be close to the final position of the hole and + /// is used to determine which solution out of several possible solutions should be chosen + /// for the hole location. + /// edgeOne : A linear BRepEdge object that the position of the hole will be measured from. The position + /// of the hole will be measured along a perpendicular from this edge. + /// offsetOne : A ValueInput object that defines the offset distance from edgeOne. If the ValueInput uses + /// a real then it is interpreted as centimeters. If it is a string then the units + /// can be defined as part of the string (i.e. "3 in"). If no units are specified + /// it is interpreted using the current default units for length. + /// edgeTwo : You can optionally define a second edge and offset to specify the position of the hole. If you use a + /// second edge it has the same requirements as the edgeOne argument. If you provide a second edge you + /// must also provide the offsetTwo argument. + /// offsetTwo : If edgeTwo is defined, you must provide this argument which is a ValueInput object that + /// defines the offset from the edgeTwo. If the ValueInput uses a real then it is interpreted + /// as centimeters. If it is a string then the units can be defined as part of the string + /// (i.e. "3 in"). If no units are specified it is interpreted using the current default units + /// for length. + /// Returns true if successful. + bool setPositionByPlaneAndOffsets(const core::Ptr& planarEntity, const core::Ptr& point, const core::Ptr& edgeOne, const core::Ptr& offsetOne, const core::Ptr& edgeTwo = NULL, const core::Ptr& offsetTwo = NULL); + + /// Defines the position and orientation of the hole to be on the start, end or center of an edge. + /// planarEntity : The planar BRepFace or ConstructionPlane object that defines the orientation of the hole + /// and start of the hole. The natural direction of the hole will be opposite the normal of + /// the face or construction plane. + /// edge : The edge to position the hole on. + /// position : The position along the edge to place the hole. + /// Returns true if successful. + bool setPositionOnEdge(const core::Ptr& planarEntity, const core::Ptr& edge, HoleEdgePositions position); + + /// Gets the ValueInput object that defines the angle of the tip of the hole. The default + /// is "118.0 deg" but can be modified by setting it using another Value object. + core::Ptr tipAngle() const; + bool tipAngle(const core::Ptr& value); + + /// Gets or sets if the hole goes in the default direction or is reversed. + bool isDefaultDirection() const; + bool isDefaultDirection(bool value); + + /// Defines the depth of the hole using a specified distance. + /// distance : The depth of the hole. If a real is specified the value is in centimeters. + /// If a string is specified the units are derived from the string. If no units are specified, + /// the default units of the document are used. + /// Returns true if setting the extent was successful. + bool setDistanceExtent(const core::Ptr& distance); + + /// Defines the extent of the hole to be through-all. The direction can be + /// either positive, negative. + /// direction : The direction of the hole relative to the normal of the sketch plane. + /// Returns true if successful. + bool setAllExtent(ExtentDirections direction); + + /// Sets the extent of the hole to be from the sketch plane to the specified "to" face. + /// toEntity : The entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For a hole it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// matchShape : Indicates if the hole is not contained on the face that the hole should match + /// the shape of the entity as if it extended beyond it's current boundaries. + /// directionHint : Specifies the direction of the hole. This is only used in the case where there are two possible solutions and the hole can + /// hit the toEntity in either direction. + /// Typically there is only a single solution and the direction is determined automatically. + /// Returns true if successful. + bool setOneSideToExtent(const core::Ptr& toEntity, bool matchShape, const core::Ptr& directionHint = NULL); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs to be + /// specified when the Hole is created based on geometry (e.g. a face or point) + /// in another component AND (the Hole) is not in the root component. + /// The CreationOccurrence is analogous to the active occurrence in the UI + /// A value of null indicates that everything is in the context of a single component. + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// Defines the position and orientation of the hole using a set of sketch points. + /// sketchPoints : A collection of sketch points that defines the positions of the holes. The orientation is + /// inferred from the normal of the point's parent sketch. The natural direction will be + /// opposite the normal of the sketch. The points can be from multiple sketches but they + /// must all be co-planar. + /// Returns true if successful. + bool setPositionBySketchPoints(const core::Ptr& sketchPoints); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// Gets and sets the list of bodies that will participate in the hole. + /// If this property has not been set, the default behavior is that all bodies that are intersected by the + /// hole will participate. + /// This property can return null in the case where the feature has not been fully defined so that + /// possible intersecting bodies can be computed. + std::vector> participantBodies() const; + bool participantBodies(const std::vector>& value); + + ADSK_FUSION_HOLEFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_HOLEFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_HOLEFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_HOLEFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setPositionByPoint_raw(core::Base* planarEntity, core::Base* point) = 0; + virtual bool setPositionAtCenter_raw(core::Base* planarEntity, BRepEdge* centerEdge) = 0; + virtual bool setPositionBySketchPoint_raw(SketchPoint* sketchPoint) = 0; + virtual bool setPositionByPlaneAndOffsets_raw(core::Base* planarEntity, core::Point3D* point, BRepEdge* edgeOne, core::ValueInput* offsetOne, BRepEdge* edgeTwo, core::ValueInput* offsetTwo) = 0; + virtual bool setPositionOnEdge_raw(core::Base* planarEntity, BRepEdge* edge, HoleEdgePositions position) = 0; + virtual core::ValueInput* tipAngle_raw() const = 0; + virtual bool tipAngle_raw(core::ValueInput* value) = 0; + virtual bool isDefaultDirection_raw() const = 0; + virtual bool isDefaultDirection_raw(bool value) = 0; + virtual bool setDistanceExtent_raw(core::ValueInput* distance) = 0; + virtual bool setAllExtent_raw(ExtentDirections direction) = 0; + virtual bool setOneSideToExtent_raw(core::Base* toEntity, bool matchShape, core::Vector3D* directionHint) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual bool setPositionBySketchPoints_raw(core::ObjectCollection* sketchPoints) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual BRepBody** participantBodies_raw(size_t& return_size) const = 0; + virtual bool participantBodies_raw(BRepBody** value, size_t value_size) = 0; +}; + +// Inline wrappers + +inline bool HoleFeatureInput::setPositionByPoint(const core::Ptr& planarEntity, const core::Ptr& point) +{ + bool res = setPositionByPoint_raw(planarEntity.get(), point.get()); + return res; +} + +inline bool HoleFeatureInput::setPositionAtCenter(const core::Ptr& planarEntity, const core::Ptr& centerEdge) +{ + bool res = setPositionAtCenter_raw(planarEntity.get(), centerEdge.get()); + return res; +} + +inline bool HoleFeatureInput::setPositionBySketchPoint(const core::Ptr& sketchPoint) +{ + bool res = setPositionBySketchPoint_raw(sketchPoint.get()); + return res; +} + +inline bool HoleFeatureInput::setPositionByPlaneAndOffsets(const core::Ptr& planarEntity, const core::Ptr& point, const core::Ptr& edgeOne, const core::Ptr& offsetOne, const core::Ptr& edgeTwo, const core::Ptr& offsetTwo) +{ + bool res = setPositionByPlaneAndOffsets_raw(planarEntity.get(), point.get(), edgeOne.get(), offsetOne.get(), edgeTwo.get(), offsetTwo.get()); + return res; +} + +inline bool HoleFeatureInput::setPositionOnEdge(const core::Ptr& planarEntity, const core::Ptr& edge, HoleEdgePositions position) +{ + bool res = setPositionOnEdge_raw(planarEntity.get(), edge.get(), position); + return res; +} + +inline core::Ptr HoleFeatureInput::tipAngle() const +{ + core::Ptr res = tipAngle_raw(); + return res; +} + +inline bool HoleFeatureInput::tipAngle(const core::Ptr& value) +{ + return tipAngle_raw(value.get()); +} + +inline bool HoleFeatureInput::isDefaultDirection() const +{ + bool res = isDefaultDirection_raw(); + return res; +} + +inline bool HoleFeatureInput::isDefaultDirection(bool value) +{ + return isDefaultDirection_raw(value); +} + +inline bool HoleFeatureInput::setDistanceExtent(const core::Ptr& distance) +{ + bool res = setDistanceExtent_raw(distance.get()); + return res; +} + +inline bool HoleFeatureInput::setAllExtent(ExtentDirections direction) +{ + bool res = setAllExtent_raw(direction); + return res; +} + +inline bool HoleFeatureInput::setOneSideToExtent(const core::Ptr& toEntity, bool matchShape, const core::Ptr& directionHint) +{ + bool res = setOneSideToExtent_raw(toEntity.get(), matchShape, directionHint.get()); + return res; +} + +inline core::Ptr HoleFeatureInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool HoleFeatureInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline bool HoleFeatureInput::setPositionBySketchPoints(const core::Ptr& sketchPoints) +{ + bool res = setPositionBySketchPoints_raw(sketchPoints.get()); + return res; +} + +inline core::Ptr HoleFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool HoleFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline std::vector> HoleFeatureInput::participantBodies() const +{ + std::vector> res; + size_t s; + + BRepBody** p= participantBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool HoleFeatureInput::participantBodies(const std::vector>& value) +{ + BRepBody** value_ = new BRepBody*[value.size()]; + for(size_t i=0; i + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_HOLEFEATURES_CPP__ +# define ADSK_FUSION_HOLEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_HOLEFEATURES_API +# endif +#else +# define ADSK_FUSION_HOLEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class HoleFeature; + class HoleFeatureInput; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing hole features in a component +/// and supports the ability to create new hole features. +class HoleFeatures : public core::Base { +public: + + /// Function that returns the specified hole feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of hole features in the collection. + size_t count() const; + + /// Creates a HoleFeatureInput object that defines a simple hole (a single diameter). + /// This is not a hole feature, but an object used to create a hole feature. Functionality + /// on the returned HoleFeatureInput object is used to define the position and extent + /// of the hole. + /// holeDiameter : A ValueInput object that defines the diameter of the hole. If the ValueInput uses + /// a real, it is interpreted as centimeters. If it is a string, the units + /// can be defined as part of the string (i.e. "3 in") If no units are specified, + /// it is interpreted using the current default units for length. + /// Returns the newly created HoleFeatureInput object or null if the creation failed. + core::Ptr createSimpleInput(const core::Ptr& holeDiameter) const; + + /// Creates a HoleFeatureInput object that defines a counterbore hole. This is not + /// a hole feature but an object used to create a hole feature. Functionality + /// on the returned HoleFeatureInput object is used to define the position and extent + /// of the hole. + /// holeDiameter : A ValueInput object that defines the diameter of the hole. If the ValueInput uses + /// a real, it is interpreted as centimeters. If it is a string, the units + /// can be defined as part of the string (i.e. "3 in") If no units are specified, + /// it is interpreted using the current default units for length. + /// counterboreDiameter : A ValueInput object that defines the counterbore diameter of the hole. If the ValueInput uses + /// a real, it is interpreted as centimeters. If it is a string, the units + /// can be defined as part of the string (i.e. "3 in") If no units are specified, + /// it is interpreted using the current default units for length. + /// counterboreDepth : A ValueInput object that defines the counterbore depth of the hole. If the ValueInput uses + /// a real, it is interpreted as centimeters. If it is a string, the units + /// can be defined as part of the string (i.e. "3 in") If no units are specified, + /// it is interpreted using the current default units for length. + /// Returns the newly created HoleFeatureInput object or null if the creation failed. + core::Ptr createCounterboreInput(const core::Ptr& holeDiameter, const core::Ptr& counterboreDiameter, const core::Ptr& counterboreDepth) const; + + /// Creates a HoleFeatureInput object that defines a countersink hole. This is not + /// a hole feature but an object used to create a hole feature. Functionality + /// on the returned HoleFeatureInput object is used to define the position and extent of the hole. + /// holeDiameter : A ValueInput object that defines the diameter of the hole. If the ValueInput uses + /// a real, it is interpreted as centimeters. If it is a string, the units + /// can be defined as part of the string (i.e. "3 in") If no units are specified, + /// it is interpreted using the current default units for length. + /// countersinkDiameter : A ValueInput object that defines the diameter of the countersink. If the ValueInput uses + /// a real, it is interpreted as centimeters. If it is a string, the units + /// can be defined as part of the string (i.e. "3 in") If no units are specified, + /// it is interpreted using the current default units for length. + /// countersinkAngle : A ValueInput object that defines the angle of the countersink. If the ValueInput uses + /// a real then it is interpreted as radians. If it is a string then the units + /// can be defined as part of the string (i.e. "120 deg"). If no units are specified + /// it is interpreted using the current default units for angles. + /// Returns the newly created HoleFeatureInput object or null if the creation failed. + core::Ptr createCountersinkInput(const core::Ptr& holeDiameter, const core::Ptr& countersinkDiameter, const core::Ptr& countersinkAngle) const; + + /// Creates a new hole feature based on the information provided by a HoleFeatureInput object. + /// To create a new hole, use one of the createInput functions to define a new input object for + /// the type of hole you want to create. Use the methods and properties on the input object + /// to define any additional input. Once the information is defined on the input object, you + /// can pass it to the Add method to create the hole. + /// input : The HoleFeatureInput object that defines the hole you want to create. + /// Returns the newly created HoleFeature or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified hole feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef HoleFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_HOLEFEATURES_API static const char* classType(); + ADSK_FUSION_HOLEFEATURES_API const char* objectType() const override; + ADSK_FUSION_HOLEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_HOLEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual HoleFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual HoleFeatureInput* createSimpleInput_raw(core::ValueInput* holeDiameter) const = 0; + virtual HoleFeatureInput* createCounterboreInput_raw(core::ValueInput* holeDiameter, core::ValueInput* counterboreDiameter, core::ValueInput* counterboreDepth) const = 0; + virtual HoleFeatureInput* createCountersinkInput_raw(core::ValueInput* holeDiameter, core::ValueInput* countersinkDiameter, core::ValueInput* countersinkAngle) const = 0; + virtual HoleFeature* add_raw(HoleFeatureInput* input) = 0; + virtual HoleFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr HoleFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t HoleFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr HoleFeatures::createSimpleInput(const core::Ptr& holeDiameter) const +{ + core::Ptr res = createSimpleInput_raw(holeDiameter.get()); + return res; +} + +inline core::Ptr HoleFeatures::createCounterboreInput(const core::Ptr& holeDiameter, const core::Ptr& counterboreDiameter, const core::Ptr& counterboreDepth) const +{ + core::Ptr res = createCounterboreInput_raw(holeDiameter.get(), counterboreDiameter.get(), counterboreDepth.get()); + return res; +} + +inline core::Ptr HoleFeatures::createCountersinkInput(const core::Ptr& holeDiameter, const core::Ptr& countersinkDiameter, const core::Ptr& countersinkAngle) const +{ + core::Ptr res = createCountersinkInput_raw(holeDiameter.get(), countersinkDiameter.get(), countersinkAngle.get()); + return res; +} + +inline core::Ptr HoleFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr HoleFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void HoleFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_HOLEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/HolePositionDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/HolePositionDefinition.h new file mode 100644 index 0000000..11e86fc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/HolePositionDefinition.h @@ -0,0 +1,81 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_HOLEPOSITIONDEFINITION_CPP__ +# define ADSK_FUSION_HOLEPOSITIONDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_HOLEPOSITIONDEFINITION_API +# endif +#else +# define ADSK_FUSION_HOLEPOSITIONDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The base class for the classes that define how a hole can be positioned. +class HolePositionDefinition : public core::Base { +public: + + ADSK_FUSION_HOLEPOSITIONDEFINITION_API static const char* classType(); + ADSK_FUSION_HOLEPOSITIONDEFINITION_API const char* objectType() const override; + ADSK_FUSION_HOLEPOSITIONDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_HOLEPOSITIONDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual void placeholderHolePositionDefinition0() {} + virtual void placeholderHolePositionDefinition1() {} + virtual void placeholderHolePositionDefinition2() {} + virtual void placeholderHolePositionDefinition3() {} + virtual void placeholderHolePositionDefinition4() {} + virtual void placeholderHolePositionDefinition5() {} + virtual void placeholderHolePositionDefinition6() {} + virtual void placeholderHolePositionDefinition7() {} + virtual void placeholderHolePositionDefinition8() {} + virtual void placeholderHolePositionDefinition9() {} + virtual void placeholderHolePositionDefinition10() {} + virtual void placeholderHolePositionDefinition11() {} + virtual void placeholderHolePositionDefinition12() {} + virtual void placeholderHolePositionDefinition13() {} + virtual void placeholderHolePositionDefinition14() {} + virtual void placeholderHolePositionDefinition15() {} + virtual void placeholderHolePositionDefinition16() {} + virtual void placeholderHolePositionDefinition17() {} + virtual void placeholderHolePositionDefinition18() {} + virtual void placeholderHolePositionDefinition19() {} + virtual void placeholderHolePositionDefinition20() {} + virtual void placeholderHolePositionDefinition21() {} + virtual void placeholderHolePositionDefinition22() {} + virtual void placeholderHolePositionDefinition23() {} + virtual void placeholderHolePositionDefinition24() {} + virtual void placeholderHolePositionDefinition25() {} + virtual void placeholderHolePositionDefinition26() {} + virtual void placeholderHolePositionDefinition27() {} + virtual void placeholderHolePositionDefinition28() {} + virtual void placeholderHolePositionDefinition29() {} + virtual void placeholderHolePositionDefinition30() {} + virtual void placeholderHolePositionDefinition31() {} +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_HOLEPOSITIONDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftCenterLineOrRail.h b/usr/autodesk/CPP/include/Fusion/Features/LoftCenterLineOrRail.h new file mode 100644 index 0000000..f8691dd --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftCenterLineOrRail.h @@ -0,0 +1,92 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTCENTERLINEORRAIL_CPP__ +# define ADSK_FUSION_LOFTCENTERLINEORRAIL_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTCENTERLINEORRAIL_API +# endif +#else +# define ADSK_FUSION_LOFTCENTERLINEORRAIL_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Represent a centerline or a single rail used by a loft feature. +class LoftCenterLineOrRail : public core::Base { +public: + + /// Indicates if this object is a loft centerline (true) or a rail (false). + bool isCenterLine() const; + + /// Gets and sets the entity that defines the centerline or rail. This can be a single sketch entity, + /// a single BRepEdge, a Path, or a Profile. + /// If this LoftCenterLineOrRail object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr entity() const; + bool entity(const core::Ptr& value); + + /// Deletes the centerline or rail. + /// If this LoftCenterLineOrRail object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// Returns true if the operation was successful. + bool deleteMe(); + + ADSK_FUSION_LOFTCENTERLINEORRAIL_API static const char* classType(); + ADSK_FUSION_LOFTCENTERLINEORRAIL_API const char* objectType() const override; + ADSK_FUSION_LOFTCENTERLINEORRAIL_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTCENTERLINEORRAIL_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isCenterLine_raw() const = 0; + virtual core::Base* entity_raw() const = 0; + virtual bool entity_raw(core::Base* value) = 0; + virtual bool deleteMe_raw() = 0; +}; + +// Inline wrappers + +inline bool LoftCenterLineOrRail::isCenterLine() const +{ + bool res = isCenterLine_raw(); + return res; +} + +inline core::Ptr LoftCenterLineOrRail::entity() const +{ + core::Ptr res = entity_raw(); + return res; +} + +inline bool LoftCenterLineOrRail::entity(const core::Ptr& value) +{ + return entity_raw(value.get()); +} + +inline bool LoftCenterLineOrRail::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTCENTERLINEORRAIL_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftCenterLineOrRails.h b/usr/autodesk/CPP/include/Fusion/Features/LoftCenterLineOrRails.h new file mode 100644 index 0000000..eedb419 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftCenterLineOrRails.h @@ -0,0 +1,117 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTCENTERLINEORRAILS_CPP__ +# define ADSK_FUSION_LOFTCENTERLINEORRAILS_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTCENTERLINEORRAILS_API +# endif +#else +# define ADSK_FUSION_LOFTCENTERLINEORRAILS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class LoftCenterLineOrRail; +}} + +namespace adsk { namespace fusion { + +/// Defines a single centerline or one or more rails for a loft feature. +class LoftCenterLineOrRails : public core::Base { +public: + + /// The number of centerlines or rails in the collection. + size_t count() const; + + /// Function that returns the specified LoftCenterLineOrRail using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(int index) const; + + /// Indicates if a centerline or rails are currently defined. + bool isCenterLine() const; + + /// Adds a centerline. A single centerline can be defined for a loft. If a centerline or rails have already + /// been defined, they will be removed and the input will become the new single centerline. + /// If this LoftCenterLineOrRails object is associated with a created feature, + /// entity : The entity that defines the center line. This can be a single sketch curve, a single BRepEdge, a Path consisting of + /// connected B-Rep edges or sketch curves. + /// Returns the new LoftCenterLineOrRail object or null in the case of a failure. + core::Ptr addCenterLine(const core::Ptr& entity); + + /// Add a rail to the loft definition. Multiple rails can be defined, so each call of this + /// method adds a new rail. + /// If this LoftCenterLineOrRails object is associated with a created feature, you need to position the timeline + /// marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// entity : The entity that defines the rail. This can be a single sketch curve, a single BRepEdge, or a Path consisting of + /// connected B-Rep edges or sketch curves. + /// Returns the new LoftCenterLineOrRail object or null in the case of a failure. + core::Ptr addRail(const core::Ptr& entity); + + ADSK_FUSION_LOFTCENTERLINEORRAILS_API static const char* classType(); + ADSK_FUSION_LOFTCENTERLINEORRAILS_API const char* objectType() const override; + ADSK_FUSION_LOFTCENTERLINEORRAILS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTCENTERLINEORRAILS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual size_t count_raw() const = 0; + virtual LoftCenterLineOrRail* item_raw(int index) const = 0; + virtual bool isCenterLine_raw() const = 0; + virtual LoftCenterLineOrRail* addCenterLine_raw(core::Base* entity) = 0; + virtual LoftCenterLineOrRail* addRail_raw(core::Base* entity) = 0; +}; + +// Inline wrappers + +inline size_t LoftCenterLineOrRails::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr LoftCenterLineOrRails::item(int index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline bool LoftCenterLineOrRails::isCenterLine() const +{ + bool res = isCenterLine_raw(); + return res; +} + +inline core::Ptr LoftCenterLineOrRails::addCenterLine(const core::Ptr& entity) +{ + core::Ptr res = addCenterLine_raw(entity.get()); + return res; +} + +inline core::Ptr LoftCenterLineOrRails::addRail(const core::Ptr& entity) +{ + core::Ptr res = addRail_raw(entity.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTCENTERLINEORRAILS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftDirectionEndCondition.h b/usr/autodesk/CPP/include/Fusion/Features/LoftDirectionEndCondition.h new file mode 100644 index 0000000..bd28e6c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftDirectionEndCondition.h @@ -0,0 +1,76 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "LoftEndCondition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTDIRECTIONENDCONDITION_CPP__ +# define ADSK_FUSION_LOFTDIRECTIONENDCONDITION_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTDIRECTIONENDCONDITION_API +# endif +#else +# define ADSK_FUSION_LOFTDIRECTIONENDCONDITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Represents a "Direction" loft end condition. +class LoftDirectionEndCondition : public LoftEndCondition { +public: + + /// Gets the valueInput or Parameter that defines the angle of the direction of the loft. + /// If this object was obtained from a LoftFeatureInput object then this will return a + /// valueInput object with the initial value provided. If this object was obtained from + /// an exiting LoftFeature then it returns a Parameter. In the case of a parameter, to change the angle, + /// edit the value of the associated parameter. + core::Ptr angle() const; + + /// Gets the valueInput or Parameter that defines the weight of the loft. + /// If this object was obtained from a LoftFeatureInput object then this will return a + /// valueInput object with the initial value provided. If this object was obtained from + /// an exiting LoftFeature then it returns a Parameter. In the case of a parameter, to change the weight, + /// edit the value of the associated parameter. + core::Ptr weight() const; + + ADSK_FUSION_LOFTDIRECTIONENDCONDITION_API static const char* classType(); + ADSK_FUSION_LOFTDIRECTIONENDCONDITION_API const char* objectType() const override; + ADSK_FUSION_LOFTDIRECTIONENDCONDITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTDIRECTIONENDCONDITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* angle_raw() const = 0; + virtual core::Base* weight_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr LoftDirectionEndCondition::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline core::Ptr LoftDirectionEndCondition::weight() const +{ + core::Ptr res = weight_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTDIRECTIONENDCONDITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftEndCondition.h b/usr/autodesk/CPP/include/Fusion/Features/LoftEndCondition.h new file mode 100644 index 0000000..0814c45 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftEndCondition.h @@ -0,0 +1,78 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTENDCONDITION_CPP__ +# define ADSK_FUSION_LOFTENDCONDITION_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTENDCONDITION_API +# endif +#else +# define ADSK_FUSION_LOFTENDCONDITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class LoftSection; +}} + +namespace adsk { namespace fusion { + +/// The base class for all loft end conditions. +class LoftEndCondition : public core::Base { +public: + + /// Returns the parent loft section. + core::Ptr parentLoftSection() const; + + ADSK_FUSION_LOFTENDCONDITION_API static const char* classType(); + ADSK_FUSION_LOFTENDCONDITION_API const char* objectType() const override; + ADSK_FUSION_LOFTENDCONDITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTENDCONDITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual LoftSection* parentLoftSection_raw() const = 0; + virtual void placeholderLoftEndCondition0() {} + virtual void placeholderLoftEndCondition1() {} + virtual void placeholderLoftEndCondition2() {} + virtual void placeholderLoftEndCondition3() {} + virtual void placeholderLoftEndCondition4() {} + virtual void placeholderLoftEndCondition5() {} + virtual void placeholderLoftEndCondition6() {} + virtual void placeholderLoftEndCondition7() {} + virtual void placeholderLoftEndCondition8() {} + virtual void placeholderLoftEndCondition9() {} + virtual void placeholderLoftEndCondition10() {} + virtual void placeholderLoftEndCondition11() {} + virtual void placeholderLoftEndCondition12() {} + virtual void placeholderLoftEndCondition13() {} + virtual void placeholderLoftEndCondition14() {} +}; + +// Inline wrappers + +inline core::Ptr LoftEndCondition::parentLoftSection() const +{ + core::Ptr res = parentLoftSection_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTENDCONDITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftFeature.h b/usr/autodesk/CPP/include/Fusion/Features/LoftFeature.h new file mode 100644 index 0000000..12cb69e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftFeature.h @@ -0,0 +1,205 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTFEATURE_CPP__ +# define ADSK_FUSION_LOFTFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTFEATURE_API +# endif +#else +# define ADSK_FUSION_LOFTFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepFace; + class BRepFaces; + class LoftCenterLineOrRails; + class LoftSections; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing loft feature in a design. +class LoftFeature : public Feature { +public: + + /// Returns the set of sections that the loft passes through. + /// This property returns null in the case where the feature is non-parametric. + core::Ptr loftSections() const; + + /// Returns the single centerline or the set of rails that define the shape of the loft. + /// This property returns null in the case where the feature is non-parametric. + core::Ptr centerLineOrRails() const; + + /// Property that returns the face that caps the start of the loft and is coincident + /// with the first section. In the case where the loft isn't capped and there isn't + /// a start face, this property will return null. + core::Ptr startFace() const; + + /// Property that returns the face that caps the end of the loft and is coincident + /// with the last section. In the case where the loft isn't capped and there isn't an end face, + /// this property will return null. + core::Ptr endFace() const; + + /// Property that returns all of the side faces (i.e. those running through the sections) + /// of the feature. + core::Ptr sideFaces() const; + + /// Gets and sets the type of operation performed by the extrusion. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Indicates if this feature was initially created as a solid or a surface. + bool isSolid() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Gets and sets the list of bodies that will participate in the feature when the operation is a cut or intersection. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + std::vector> participantBodies() const; + bool participantBodies(const std::vector>& value); + + ADSK_FUSION_LOFTFEATURE_API static const char* classType(); + ADSK_FUSION_LOFTFEATURE_API const char* objectType() const override; + ADSK_FUSION_LOFTFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual LoftSections* loftSections_raw() const = 0; + virtual LoftCenterLineOrRails* centerLineOrRails_raw() const = 0; + virtual BRepFace* startFace_raw() const = 0; + virtual BRepFace* endFace_raw() const = 0; + virtual BRepFaces* sideFaces_raw() const = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual bool isSolid_raw() const = 0; + virtual LoftFeature* nativeObject_raw() const = 0; + virtual LoftFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual BRepBody** participantBodies_raw(size_t& return_size) const = 0; + virtual bool participantBodies_raw(BRepBody** value, size_t value_size) = 0; +}; + +// Inline wrappers + +inline core::Ptr LoftFeature::loftSections() const +{ + core::Ptr res = loftSections_raw(); + return res; +} + +inline core::Ptr LoftFeature::centerLineOrRails() const +{ + core::Ptr res = centerLineOrRails_raw(); + return res; +} + +inline core::Ptr LoftFeature::startFace() const +{ + core::Ptr res = startFace_raw(); + return res; +} + +inline core::Ptr LoftFeature::endFace() const +{ + core::Ptr res = endFace_raw(); + return res; +} + +inline core::Ptr LoftFeature::sideFaces() const +{ + core::Ptr res = sideFaces_raw(); + return res; +} + +inline FeatureOperations LoftFeature::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool LoftFeature::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline bool LoftFeature::isSolid() const +{ + bool res = isSolid_raw(); + return res; +} + +inline core::Ptr LoftFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr LoftFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline std::vector> LoftFeature::participantBodies() const +{ + std::vector> res; + size_t s; + + BRepBody** p= participantBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool LoftFeature::participantBodies(const std::vector>& value) +{ + BRepBody** value_ = new BRepBody*[value.size()]; + for(size_t i=0; i + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTFEATUREINPUT_CPP__ +# define ADSK_FUSION_LOFTFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_LOFTFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepBody; + class LoftCenterLineOrRails; + class LoftSections; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// This object defines the all of the input necessary to create a loft feature. It is the +/// programming equivalent to the Loft command dialog. Through this object you provide +/// the input needed to fully define a loft. To create the loft feature you pass +/// this object the LoftFeatures.add method. +class LoftFeatureInput : public core::Base { +public: + + /// The set of sections, (or profiles as they're referred to in the user-interface), that the loft will pass through. Use the add method on the LoftSections + /// object to specify new sections. + core::Ptr loftSections() const; + + /// The single centerline or set of rails that define the shape of the loft. Use methods on the + /// returned LoftCenterLineOrRails object to define the centerline or rails. + core::Ptr centerLineOrRails() const; + + /// Gets and sets the type of operation performed by the loft. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs to be + /// specified when the loft is created based on geometry (e.g. a profile and/or face(s)) + /// when the loft is being created in another component AND the loft is not in the root component. + /// The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// Specifies if the loft should be created as a solid or surface. This is + /// initialized to true so a solid will attempt to be created if it's not changed. + bool isSolid() const; + bool isSolid(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// Gets and sets the list of bodies that will participate in the feature when the operation is a cut or intersection. + /// If this property has not been set, the default behavior is that all bodies that are intersected by the + /// feature will participate. + /// This property can return null in the case where the feature has not been fully defined so that + /// possible intersecting bodies can be computed. + std::vector> participantBodies() const; + bool participantBodies(const std::vector>& value); + + ADSK_FUSION_LOFTFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_LOFTFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_LOFTFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual LoftSections* loftSections_raw() const = 0; + virtual LoftCenterLineOrRails* centerLineOrRails_raw() const = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual bool isSolid_raw() const = 0; + virtual bool isSolid_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual BRepBody** participantBodies_raw(size_t& return_size) const = 0; + virtual bool participantBodies_raw(BRepBody** value, size_t value_size) = 0; +}; + +// Inline wrappers + +inline core::Ptr LoftFeatureInput::loftSections() const +{ + core::Ptr res = loftSections_raw(); + return res; +} + +inline core::Ptr LoftFeatureInput::centerLineOrRails() const +{ + core::Ptr res = centerLineOrRails_raw(); + return res; +} + +inline FeatureOperations LoftFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool LoftFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr LoftFeatureInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool LoftFeatureInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline bool LoftFeatureInput::isSolid() const +{ + bool res = isSolid_raw(); + return res; +} + +inline bool LoftFeatureInput::isSolid(bool value) +{ + return isSolid_raw(value); +} + +inline core::Ptr LoftFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool LoftFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline std::vector> LoftFeatureInput::participantBodies() const +{ + std::vector> res; + size_t s; + + BRepBody** p= participantBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool LoftFeatureInput::participantBodies(const std::vector>& value) +{ + BRepBody** value_ = new BRepBody*[value.size()]; + for(size_t i=0; i + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTFEATURES_CPP__ +# define ADSK_FUSION_LOFTFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTFEATURES_API +# endif +#else +# define ADSK_FUSION_LOFTFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class LoftFeature; + class LoftFeatureInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing loft features in a design. +class LoftFeatures : public core::Base { +public: + + /// Function that returns the specified loft feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified loft feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of loft features in the collection. + size_t count() const; + + /// Creates a LoftFeatureInput object. Use properties and methods on the returned LoftFeatureInput + /// object to provide the required input to create a loft feature. The LoftFeatureInput object can then be used as input to the + /// add method to create the loft feature. + /// operation : The feature operation to perform. + /// Returns the newly created LoftFeatureInput object or null if the creation failed. + core::Ptr createInput(FeatureOperations operation) const; + + /// Creates a new loft feature. + /// input : A LoftFeatureInput object that defines the desired loft feature. Use the createInput + /// method to create a new LoftFeatureInput object and then use methods on it + /// (the LoftFeatureInput object) to define the required input. + /// Returns the newly created LoftFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + typedef LoftFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_LOFTFEATURES_API static const char* classType(); + ADSK_FUSION_LOFTFEATURES_API const char* objectType() const override; + ADSK_FUSION_LOFTFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual LoftFeature* item_raw(size_t index) const = 0; + virtual LoftFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual LoftFeatureInput* createInput_raw(FeatureOperations operation) const = 0; + virtual LoftFeature* add_raw(LoftFeatureInput* input) = 0; +}; + +// Inline wrappers + +inline core::Ptr LoftFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr LoftFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t LoftFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr LoftFeatures::createInput(FeatureOperations operation) const +{ + core::Ptr res = createInput_raw(operation); + return res; +} + +inline core::Ptr LoftFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +template inline void LoftFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftFreeEndCondition.h b/usr/autodesk/CPP/include/Fusion/Features/LoftFreeEndCondition.h new file mode 100644 index 0000000..fef938c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftFreeEndCondition.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "LoftEndCondition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTFREEENDCONDITION_CPP__ +# define ADSK_FUSION_LOFTFREEENDCONDITION_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTFREEENDCONDITION_API +# endif +#else +# define ADSK_FUSION_LOFTFREEENDCONDITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Represents a "Free" loft end condition. +class LoftFreeEndCondition : public LoftEndCondition { +public: + + ADSK_FUSION_LOFTFREEENDCONDITION_API static const char* classType(); + ADSK_FUSION_LOFTFREEENDCONDITION_API const char* objectType() const override; + ADSK_FUSION_LOFTFREEENDCONDITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTFREEENDCONDITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTFREEENDCONDITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftPointSharpEndCondition.h b/usr/autodesk/CPP/include/Fusion/Features/LoftPointSharpEndCondition.h new file mode 100644 index 0000000..1050fbd --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftPointSharpEndCondition.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "LoftEndCondition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTPOINTSHARPENDCONDITION_CPP__ +# define ADSK_FUSION_LOFTPOINTSHARPENDCONDITION_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTPOINTSHARPENDCONDITION_API +# endif +#else +# define ADSK_FUSION_LOFTPOINTSHARPENDCONDITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Represents a "Point Sharp" loft end condition. +class LoftPointSharpEndCondition : public LoftEndCondition { +public: + + ADSK_FUSION_LOFTPOINTSHARPENDCONDITION_API static const char* classType(); + ADSK_FUSION_LOFTPOINTSHARPENDCONDITION_API const char* objectType() const override; + ADSK_FUSION_LOFTPOINTSHARPENDCONDITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTPOINTSHARPENDCONDITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTPOINTSHARPENDCONDITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftPointTangentEndCondition.h b/usr/autodesk/CPP/include/Fusion/Features/LoftPointTangentEndCondition.h new file mode 100644 index 0000000..7f63692 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftPointTangentEndCondition.h @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "LoftEndCondition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTPOINTTANGENTENDCONDITION_CPP__ +# define ADSK_FUSION_LOFTPOINTTANGENTENDCONDITION_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTPOINTTANGENTENDCONDITION_API +# endif +#else +# define ADSK_FUSION_LOFTPOINTTANGENTENDCONDITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Represents a "Point Tangent" loft end condition. +class LoftPointTangentEndCondition : public LoftEndCondition { +public: + + /// Gets the valueInput or Parameter that defines the weight of the loft. + /// If this object was obtained from a LoftFeatureInput object then this will return a + /// valueInput object with the initial value provided. If this object was obtained from + /// an exiting LoftFeature then it returns a Parameter. In the case of a parameter, to change the weight, + /// edit the value of the associated parameter. + core::Ptr weight() const; + + ADSK_FUSION_LOFTPOINTTANGENTENDCONDITION_API static const char* classType(); + ADSK_FUSION_LOFTPOINTTANGENTENDCONDITION_API const char* objectType() const override; + ADSK_FUSION_LOFTPOINTTANGENTENDCONDITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTPOINTTANGENTENDCONDITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* weight_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr LoftPointTangentEndCondition::weight() const +{ + core::Ptr res = weight_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTPOINTTANGENTENDCONDITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftSection.h b/usr/autodesk/CPP/include/Fusion/Features/LoftSection.h new file mode 100644 index 0000000..b1d4859 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftSection.h @@ -0,0 +1,235 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTSECTION_CPP__ +# define ADSK_FUSION_LOFTSECTION_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTSECTION_API +# endif +#else +# define ADSK_FUSION_LOFTSECTION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class LoftEndCondition; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// A single loft section. +class LoftSection : public core::Base { +public: + + /// Get and sets the entity that defines the section of the loft. This can be a BRepFace, Profile, Path, SketchPoint, ConstructionPoint, or an ObjectCollection + /// of contiguous profiles. + /// If this LoftSection object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr entity() const; + bool entity(const core::Ptr& value); + + /// Deletes this LoftSection. + /// If this LoftSection object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// Returns true if the operation was successful. + bool deleteMe(); + + /// The position of this LoftSection within the collection. The first section has an index + /// of 0. This is also the order of how the section will be used in the loft. The order + /// can be modified by using the reorder method. + int index() const; + + /// Repositions this section so that it has the new index specified. + /// If this LoftSection object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// newIndex : The new index value. For example, passing in zero as the new index will make this + /// the first section in the loft and (LoftSections.count - 1) will make it the last section. + /// All other sections will be maintain their existing order but be shifted to allow space + /// for this section. + /// Returns true if the reorder operation was successful. + bool reorder(int newIndex); + + /// Returns the current end condition. This is only valid for the first and last + /// section and when the result is not closed. In other cases this will return null. + /// This returns one of the several objects derived from LoftEndCondition and represents + /// the current end condition. You can edit the existing condition using properties + /// on the returned object. You can change the end condition using one of the set methods + /// on the LoftSection object. + /// If this LoftSection object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr endCondition() const; + + /// Sets the end condition to be a "Free" end condition. This is the default + /// end condition when a new section is added. + /// This is valid for sections defined with all curve types. + /// If this LoftSection object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// Returns true if the operation was successful. + bool setFreeEndCondition(); + + /// Sets the end condition to be defined by a direction and weight. + /// This is valid for sections defined with sketch curves. + /// If this LoftSection object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// angle : Input ValueInput object that specifies the direction by using an angle. This defaults to an angle of 0.0. + /// If the ValueInput object is a string it must be an valid expression that can be evaluated as an angle. + /// If the ValueInput is a value then it is in radians. + /// weight : Input ValueInput object that defines the weight or the amount of influence of end condition on the loft. + /// This defaults to a value of 1.0. If the ValueInput object is a string it must be an valid expression that + /// can be evaluated as a unitless value. In any case, the value must be greater than 0. + /// Returns true if the operation was successful. + bool setDirectionEndCondition(const core::Ptr& angle = NULL, const core::Ptr& weight = NULL); + + /// Sets the end condition to be tangent to the adjacent face. If the section is not defined by a BRepEdge, + /// then this is ignored because there is no face to be tangent to. + /// This is only valid on the first or last profile. + /// If this LoftSection object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// weight : Input ValueInput object that defines the weight or the amount of influence of end condition on the loft. + /// This defaults to a value of 1.0. If the ValueInput object is a string it must be an valid expression that + /// can be evaluated as a unitless value. In any case, the value must be greater than 0. + /// Returns true if the operation was successful. + bool setTangentEndCondition(const core::Ptr& weight); + + /// Sets the end condition to be smooth to the adjacent face. If the end profile is not defined by a BRepEdge, + /// then this is ignored because there is no face to be smooth to. + /// This is only valid on the first or last section. + /// If this LoftSection object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// weight : Input ValueInput object that defines the weight or the amount of influence of end condition on the loft. + /// This defaults to a value of 1.0. If the ValueInput object is a string it must be an valid expression that + /// can be evaluated as a unitless value. In any case, the value must be greater than 0. + /// Returns true if the operation was successful. + bool setSmoothEndCondition(const core::Ptr& weight); + + /// Sets the end condition to be sharp where the section is a point. This is the default condition for a point section. + /// If this LoftSection object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// Returns true if the operation was successful. + bool setPointSharpEndCondition(); + + /// Set the end condition to a tangent condition in the case where the section is a point. + /// If this LoftSection object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// weight : Input ValueInput object that defines the weight or the amount of influence of end condition on the loft. + /// This defaults to a value of 1.0. If the ValueInput object is a string it must be an valid expression that + /// can be evaluated as a unitless value. In any case, the value must be greater than 0. + /// Returns true if the operation was successful. + bool setPointTangentEndCondition(const core::Ptr& weight); + + ADSK_FUSION_LOFTSECTION_API static const char* classType(); + ADSK_FUSION_LOFTSECTION_API const char* objectType() const override; + ADSK_FUSION_LOFTSECTION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTSECTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* entity_raw() const = 0; + virtual bool entity_raw(core::Base* value) = 0; + virtual bool deleteMe_raw() = 0; + virtual int index_raw() const = 0; + virtual bool reorder_raw(int newIndex) = 0; + virtual LoftEndCondition* endCondition_raw() const = 0; + virtual bool setFreeEndCondition_raw() = 0; + virtual bool setDirectionEndCondition_raw(core::ValueInput* angle, core::ValueInput* weight) = 0; + virtual bool setTangentEndCondition_raw(core::ValueInput* weight) = 0; + virtual bool setSmoothEndCondition_raw(core::ValueInput* weight) = 0; + virtual bool setPointSharpEndCondition_raw() = 0; + virtual bool setPointTangentEndCondition_raw(core::ValueInput* weight) = 0; +}; + +// Inline wrappers + +inline core::Ptr LoftSection::entity() const +{ + core::Ptr res = entity_raw(); + return res; +} + +inline bool LoftSection::entity(const core::Ptr& value) +{ + return entity_raw(value.get()); +} + +inline bool LoftSection::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline int LoftSection::index() const +{ + int res = index_raw(); + return res; +} + +inline bool LoftSection::reorder(int newIndex) +{ + bool res = reorder_raw(newIndex); + return res; +} + +inline core::Ptr LoftSection::endCondition() const +{ + core::Ptr res = endCondition_raw(); + return res; +} + +inline bool LoftSection::setFreeEndCondition() +{ + bool res = setFreeEndCondition_raw(); + return res; +} + +inline bool LoftSection::setDirectionEndCondition(const core::Ptr& angle, const core::Ptr& weight) +{ + bool res = setDirectionEndCondition_raw(angle.get(), weight.get()); + return res; +} + +inline bool LoftSection::setTangentEndCondition(const core::Ptr& weight) +{ + bool res = setTangentEndCondition_raw(weight.get()); + return res; +} + +inline bool LoftSection::setSmoothEndCondition(const core::Ptr& weight) +{ + bool res = setSmoothEndCondition_raw(weight.get()); + return res; +} + +inline bool LoftSection::setPointSharpEndCondition() +{ + bool res = setPointSharpEndCondition_raw(); + return res; +} + +inline bool LoftSection::setPointTangentEndCondition(const core::Ptr& weight) +{ + bool res = setPointTangentEndCondition_raw(weight.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTSECTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftSections.h b/usr/autodesk/CPP/include/Fusion/Features/LoftSections.h new file mode 100644 index 0000000..f169f55 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftSections.h @@ -0,0 +1,93 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTSECTIONS_CPP__ +# define ADSK_FUSION_LOFTSECTIONS_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTSECTIONS_API +# endif +#else +# define ADSK_FUSION_LOFTSECTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class LoftSection; +}} + +namespace adsk { namespace fusion { + +/// The set of two or more sections used to define the shape of the loft. +class LoftSections : public core::Base { +public: + + /// The number of LoftSections in the collection. + size_t count() const; + + /// Function that returns the specified LoftSection using an index into the collection. They are returned + /// in the same order that they are used in the loft. Their order can be modified using the reorder method + /// of the LoftSection object. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(int index) const; + + /// Adds a new section to the loft. The initial end condition is "Free". Additional methods on the + /// returned LoftSection can be used to further define the section. + /// If this LoftSections object is associated with a created feature, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// entity : Specifies the BRepFace, Profile, Path, SketchPoint, ConstructionPoint, or an ObjectCollection containing + /// a contiguous set of Profile objects that defines the section. + /// Returns the newly created LoftSection object. + core::Ptr add(const core::Ptr& entity); + + ADSK_FUSION_LOFTSECTIONS_API static const char* classType(); + ADSK_FUSION_LOFTSECTIONS_API const char* objectType() const override; + ADSK_FUSION_LOFTSECTIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTSECTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual size_t count_raw() const = 0; + virtual LoftSection* item_raw(int index) const = 0; + virtual LoftSection* add_raw(core::Base* entity) = 0; +}; + +// Inline wrappers + +inline size_t LoftSections::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr LoftSections::item(int index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr LoftSections::add(const core::Ptr& entity) +{ + core::Ptr res = add_raw(entity.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTSECTIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftSmoothEndCondition.h b/usr/autodesk/CPP/include/Fusion/Features/LoftSmoothEndCondition.h new file mode 100644 index 0000000..0cad866 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftSmoothEndCondition.h @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "LoftEndCondition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTSMOOTHENDCONDITION_CPP__ +# define ADSK_FUSION_LOFTSMOOTHENDCONDITION_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTSMOOTHENDCONDITION_API +# endif +#else +# define ADSK_FUSION_LOFTSMOOTHENDCONDITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Represents a "Smooth" loft end condition. +class LoftSmoothEndCondition : public LoftEndCondition { +public: + + /// Gets the valueInput or Parameter that defines the weight of the loft. + /// If this object was obtained from a LoftFeatureInput object then this will return a + /// valueInput object with the initial value provided. If this object was obtained from + /// an exiting LoftFeature then it returns a Parameter. In the case of a parameter, to change the weight, + /// edit the value of the associated parameter. + core::Ptr weight() const; + + ADSK_FUSION_LOFTSMOOTHENDCONDITION_API static const char* classType(); + ADSK_FUSION_LOFTSMOOTHENDCONDITION_API const char* objectType() const override; + ADSK_FUSION_LOFTSMOOTHENDCONDITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTSMOOTHENDCONDITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* weight_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr LoftSmoothEndCondition::weight() const +{ + core::Ptr res = weight_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTSMOOTHENDCONDITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/LoftTangentEndCondition.h b/usr/autodesk/CPP/include/Fusion/Features/LoftTangentEndCondition.h new file mode 100644 index 0000000..e238cc9 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/LoftTangentEndCondition.h @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "LoftEndCondition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_LOFTTANGENTENDCONDITION_CPP__ +# define ADSK_FUSION_LOFTTANGENTENDCONDITION_API XI_EXPORT +# else +# define ADSK_FUSION_LOFTTANGENTENDCONDITION_API +# endif +#else +# define ADSK_FUSION_LOFTTANGENTENDCONDITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Represents a "Tangent" loft end condition. +class LoftTangentEndCondition : public LoftEndCondition { +public: + + /// Gets the valueInput or Parameter that defines the weight of the loft. + /// If this object was obtained from a LoftFeatureInput object then this will return a + /// valueInput object with the initial value provided. If this object was obtained from + /// an exiting LoftFeature then it returns a Parameter. In the case of a parameter, to change the weight, + /// edit the value of the associated parameter. + core::Ptr weight() const; + + ADSK_FUSION_LOFTTANGENTENDCONDITION_API static const char* classType(); + ADSK_FUSION_LOFTTANGENTENDCONDITION_API const char* objectType() const override; + ADSK_FUSION_LOFTTANGENTENDCONDITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_LOFTTANGENTENDCONDITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* weight_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr LoftTangentEndCondition::weight() const +{ + core::Ptr res = weight_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_LOFTTANGENTENDCONDITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/MirrorFeature.h b/usr/autodesk/CPP/include/Fusion/Features/MirrorFeature.h new file mode 100644 index 0000000..d16fcc0 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/MirrorFeature.h @@ -0,0 +1,201 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MIRRORFEATURE_CPP__ +# define ADSK_FUSION_MIRRORFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_MIRRORFEATURE_API +# endif +#else +# define ADSK_FUSION_MIRRORFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; + class PatternElements; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing mirror feature in a design. +class MirrorFeature : public Feature { +public: + + /// Gets and sets the entities that are mirrored. It can contain faces, features, bodies, or components. + /// The input must all be of a single type. For example, you can't provide a body and a component but + /// the collection must be either all bodies or all components. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the mirror plane. This can be either a planar face or construction plane. + /// This works only for parametric features. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr mirrorPlane() const; + bool mirrorPlane(const core::Ptr& value); + + /// Gets the PatternElements collection that contains the elements created by this pattern. + core::Ptr patternElements() const; + + /// Get the features that were created for this mirror. + /// Returns null in the case where the feature is not parametric. + core::Ptr resultFeatures() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Gets and sets the compute option for this mirror feature. + /// This property only applies when mirroring features and is ignored in the direct modeling environment. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + PatternComputeOptions patternComputeOption() const; + bool patternComputeOption(PatternComputeOptions value); + + /// Gets and sets whether combine is set when doing the Mirror. + /// When true, the mirrored geometry will be Boolean unioned with the original solid or surface body(s) + /// when they connect within the stitch tolerance defined with the stitchTolerance property. If the bodies + /// cannot be unioned or stitched the result will be separate bodies. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isCombine() const; + bool isCombine(bool value); + + /// Returns the parameter controlling the Stitch tolerance to use when stitching mirrored + /// surface bodies with the original bodies. You can edit the tolerance by + /// editing the value of the parameter object. + core::Ptr stitchTolerance() const; + + ADSK_FUSION_MIRRORFEATURE_API static const char* classType(); + ADSK_FUSION_MIRRORFEATURE_API const char* objectType() const override; + ADSK_FUSION_MIRRORFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MIRRORFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual core::Base* mirrorPlane_raw() const = 0; + virtual bool mirrorPlane_raw(core::Base* value) = 0; + virtual PatternElements* patternElements_raw() const = 0; + virtual core::ObjectCollection* resultFeatures_raw() const = 0; + virtual MirrorFeature* nativeObject_raw() const = 0; + virtual MirrorFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual PatternComputeOptions patternComputeOption_raw() const = 0; + virtual bool patternComputeOption_raw(PatternComputeOptions value) = 0; + virtual bool isCombine_raw() const = 0; + virtual bool isCombine_raw(bool value) = 0; + virtual ModelParameter* stitchTolerance_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr MirrorFeature::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool MirrorFeature::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr MirrorFeature::mirrorPlane() const +{ + core::Ptr res = mirrorPlane_raw(); + return res; +} + +inline bool MirrorFeature::mirrorPlane(const core::Ptr& value) +{ + return mirrorPlane_raw(value.get()); +} + +inline core::Ptr MirrorFeature::patternElements() const +{ + core::Ptr res = patternElements_raw(); + return res; +} + +inline core::Ptr MirrorFeature::resultFeatures() const +{ + core::Ptr res = resultFeatures_raw(); + return res; +} + +inline core::Ptr MirrorFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr MirrorFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline PatternComputeOptions MirrorFeature::patternComputeOption() const +{ + PatternComputeOptions res = patternComputeOption_raw(); + return res; +} + +inline bool MirrorFeature::patternComputeOption(PatternComputeOptions value) +{ + return patternComputeOption_raw(value); +} + +inline bool MirrorFeature::isCombine() const +{ + bool res = isCombine_raw(); + return res; +} + +inline bool MirrorFeature::isCombine(bool value) +{ + return isCombine_raw(value); +} + +inline core::Ptr MirrorFeature::stitchTolerance() const +{ + core::Ptr res = stitchTolerance_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MIRRORFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/MirrorFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/MirrorFeatureInput.h new file mode 100644 index 0000000..f857161 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/MirrorFeatureInput.h @@ -0,0 +1,175 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MIRRORFEATUREINPUT_CPP__ +# define ADSK_FUSION_MIRRORFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_MIRRORFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_MIRRORFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a mirror +/// feature. +class MirrorFeatureInput : public core::Base { +public: + + /// Gets and sets the entities that are mirrored. It can contain faces, features, bodies, or components. + /// The input must all be of a single type. For example, you can't provide a body and a component but + /// the collection must be either all bodies or all components. + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the mirror plane. This can be either a planar face or construction plane. + core::Ptr mirrorPlane() const; + bool mirrorPlane(const core::Ptr& value); + + /// Gets and sets the compute option when mirroring features. The default value for this is AdjustPatternCompute. + /// This property only applies when mirroring features and is ignored in the direct modeling environment. + PatternComputeOptions patternComputeOption() const; + bool patternComputeOption(PatternComputeOptions value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// Gets and sets whether the mirrored bodies should be combined with the original bodies. + /// When true, the mirrored geometry will be Boolean unioned with the original solid or surface body(s) + /// when they connect within the stitch tolerance defined with the stitchTolerance property. If the bodies + /// cannot be unioned or stitched the result will be separate bodies. + /// If any input object is not a body, then this setting is ignored. + /// Default is false. + bool isCombine() const; + bool isCombine(bool value); + + /// Gets and sets the ValueInput object that defines the Stitching Tolerance (length) + /// to use when doing a mirror and combine for surface bodies. + core::Ptr stitchTolerance() const; + bool stitchTolerance(const core::Ptr& value); + + ADSK_FUSION_MIRRORFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_MIRRORFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_MIRRORFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MIRRORFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual core::Base* mirrorPlane_raw() const = 0; + virtual bool mirrorPlane_raw(core::Base* value) = 0; + virtual PatternComputeOptions patternComputeOption_raw() const = 0; + virtual bool patternComputeOption_raw(PatternComputeOptions value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual bool isCombine_raw() const = 0; + virtual bool isCombine_raw(bool value) = 0; + virtual core::ValueInput* stitchTolerance_raw() const = 0; + virtual bool stitchTolerance_raw(core::ValueInput* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr MirrorFeatureInput::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool MirrorFeatureInput::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr MirrorFeatureInput::mirrorPlane() const +{ + core::Ptr res = mirrorPlane_raw(); + return res; +} + +inline bool MirrorFeatureInput::mirrorPlane(const core::Ptr& value) +{ + return mirrorPlane_raw(value.get()); +} + +inline PatternComputeOptions MirrorFeatureInput::patternComputeOption() const +{ + PatternComputeOptions res = patternComputeOption_raw(); + return res; +} + +inline bool MirrorFeatureInput::patternComputeOption(PatternComputeOptions value) +{ + return patternComputeOption_raw(value); +} + +inline core::Ptr MirrorFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool MirrorFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline bool MirrorFeatureInput::isCombine() const +{ + bool res = isCombine_raw(); + return res; +} + +inline bool MirrorFeatureInput::isCombine(bool value) +{ + return isCombine_raw(value); +} + +inline core::Ptr MirrorFeatureInput::stitchTolerance() const +{ + core::Ptr res = stitchTolerance_raw(); + return res; +} + +inline bool MirrorFeatureInput::stitchTolerance(const core::Ptr& value) +{ + return stitchTolerance_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MIRRORFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/MirrorFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/MirrorFeatures.h new file mode 100644 index 0000000..be200ef --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/MirrorFeatures.h @@ -0,0 +1,136 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MIRRORFEATURES_CPP__ +# define ADSK_FUSION_MIRRORFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_MIRRORFEATURES_API +# endif +#else +# define ADSK_FUSION_MIRRORFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class MirrorFeature; + class MirrorFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing mirror features in a component +/// and supports the ability to create new mirror features. +class MirrorFeatures : public core::Base { +public: + + /// Function that returns the specified mirror feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of mirror features in the collection. + size_t count() const; + + /// Creates a MirrorFeatureInput object. Use properties and methods on this object + /// to define the mirror you want to create and then use the Add method, passing in + /// the MirrorFeatureInput object. + /// inputEntities : A collection of the entities to mirror. It can contain faces, features, bodies, or components. + /// The input must all be of a single type. For example, you can't provide a body and a component but + /// the collection must be either all bodies or all components. + /// mirrorPlane : Input planar entity that defines the mirror plane. This can be either a planar face or a construction plane. + /// Returns the newly created MirrorFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& inputEntities, const core::Ptr& mirrorPlane) const; + + /// Creates a new mirror feature. + /// input : A MirrorFeatureInput object that defines the desired mirror. Use the createInput + /// method to create a new MirrorFeatureInput object and then use methods on it + /// (the MirrorFeatureInput object) to define the mirror. + /// Returns the newly created MirrorFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified mirror feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef MirrorFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_MIRRORFEATURES_API static const char* classType(); + ADSK_FUSION_MIRRORFEATURES_API const char* objectType() const override; + ADSK_FUSION_MIRRORFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MIRRORFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual MirrorFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual MirrorFeatureInput* createInput_raw(core::ObjectCollection* inputEntities, core::Base* mirrorPlane) const = 0; + virtual MirrorFeature* add_raw(MirrorFeatureInput* input) = 0; + virtual MirrorFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr MirrorFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t MirrorFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr MirrorFeatures::createInput(const core::Ptr& inputEntities, const core::Ptr& mirrorPlane) const +{ + core::Ptr res = createInput_raw(inputEntities.get(), mirrorPlane.get()); + return res; +} + +inline core::Ptr MirrorFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr MirrorFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void MirrorFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MIRRORFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/MoveFeature.h b/usr/autodesk/CPP/include/Fusion/Features/MoveFeature.h new file mode 100644 index 0000000..e84ecc7 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/MoveFeature.h @@ -0,0 +1,123 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MOVEFEATURE_CPP__ +# define ADSK_FUSION_MOVEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_MOVEFEATURE_API +# endif +#else +# define ADSK_FUSION_MOVEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; +}} +namespace adsk { namespace core { + class Matrix3D; + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing move feature in a design. +class MoveFeature : public Feature { +public: + + /// Gets and sets the entities to move. This is done by using an ObjectCollection + /// containing the objects to move. For a parametric model, the collection can contain + /// BRepBody or BRepFace objects but not a combination of both. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the move transform of the input bodies. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr transform() const; + bool transform(const core::Ptr& value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_MOVEFEATURE_API static const char* classType(); + ADSK_FUSION_MOVEFEATURE_API const char* objectType() const override; + ADSK_FUSION_MOVEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MOVEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual core::Matrix3D* transform_raw() const = 0; + virtual bool transform_raw(core::Matrix3D* value) = 0; + virtual MoveFeature* nativeObject_raw() const = 0; + virtual MoveFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr MoveFeature::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool MoveFeature::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr MoveFeature::transform() const +{ + core::Ptr res = transform_raw(); + return res; +} + +inline bool MoveFeature::transform(const core::Ptr& value) +{ + return transform_raw(value.get()); +} + +inline core::Ptr MoveFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr MoveFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MOVEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/MoveFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/MoveFeatureInput.h new file mode 100644 index 0000000..0e604de --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/MoveFeatureInput.h @@ -0,0 +1,117 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MOVEFEATUREINPUT_CPP__ +# define ADSK_FUSION_MOVEFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_MOVEFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_MOVEFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class Matrix3D; + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a move feature. +class MoveFeatureInput : public core::Base { +public: + + /// An ObjectCollection containing the objects to move. The collection can contain + /// BRepBody or BRepFace objects but not a mixture of the two types. + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the tranform to apply to the input entities. This can describe a move (translation) + /// or a rotation. The matrix must define an orthogonal transform. That is the axes remain + /// perpendicular to each other and there isn't any scale or mirror defined. + core::Ptr transform() const; + bool transform(const core::Ptr& value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_MOVEFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_MOVEFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_MOVEFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MOVEFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual core::Matrix3D* transform_raw() const = 0; + virtual bool transform_raw(core::Matrix3D* value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr MoveFeatureInput::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool MoveFeatureInput::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr MoveFeatureInput::transform() const +{ + core::Ptr res = transform_raw(); + return res; +} + +inline bool MoveFeatureInput::transform(const core::Ptr& value) +{ + return transform_raw(value.get()); +} + +inline core::Ptr MoveFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool MoveFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MOVEFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/MoveFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/MoveFeatures.h new file mode 100644 index 0000000..3eec42c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/MoveFeatures.h @@ -0,0 +1,140 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MOVEFEATURES_CPP__ +# define ADSK_FUSION_MOVEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_MOVEFEATURES_API +# endif +#else +# define ADSK_FUSION_MOVEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class MoveFeature; + class MoveFeatureInput; +}} +namespace adsk { namespace core { + class Matrix3D; + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing move features in a component +/// and supports the ability to create new move features. +class MoveFeatures : public core::Base { +public: + + /// Function that returns the specified move feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of move features in the collection. + size_t count() const; + + /// Creates a MoveFeatureInput object. Use properties and methods on this object + /// to define the move feature you want to create and then use the Add method, passing in + /// the MoveFeatureInput object. + /// inputEntities : An ObjectCollection containing the entities to move. This collection can only contain + /// BRepBody objects in parametric modeling. It can be BRep bodies, T-Spline bodies, + /// mesh bodies mixed or faces and features mixed in non-parametric modeling. + /// transform : The transform to apply to the input entities. This can describe a move (translation) or a rotation. The + /// matrix must define an orthogonal transform. That is the axes must be perpendicular to each other and there + /// can't be any scaling or mirroring defined. + /// Returns the newly created MoveFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& inputEntities, const core::Ptr& transform) const; + + /// Creates a new move feature. + /// input : A MoveFeatureInput object that defines the desired move feature. Use the createInput2 + /// method to create a new MoveFeatureInput object and then use methods on the MoveFeatureInput + /// object to define the move feature. + /// Returns the newly created MoveFeature object or null if the creation failed. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified move feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef MoveFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_MOVEFEATURES_API static const char* classType(); + ADSK_FUSION_MOVEFEATURES_API const char* objectType() const override; + ADSK_FUSION_MOVEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MOVEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual MoveFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual MoveFeatureInput* createInput_raw(core::ObjectCollection* inputEntities, core::Matrix3D* transform) const = 0; + virtual MoveFeature* add_raw(MoveFeatureInput* input) = 0; + virtual MoveFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr MoveFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t MoveFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr MoveFeatures::createInput(const core::Ptr& inputEntities, const core::Ptr& transform) const +{ + core::Ptr res = createInput_raw(inputEntities.get(), transform.get()); + return res; +} + +inline core::Ptr MoveFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr MoveFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void MoveFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MOVEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/OffsetFacesFeature.h b/usr/autodesk/CPP/include/Fusion/Features/OffsetFacesFeature.h new file mode 100644 index 0000000..524b593 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/OffsetFacesFeature.h @@ -0,0 +1,49 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_OFFSETFACESFEATURE_CPP__ +# define ADSK_FUSION_OFFSETFACESFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_OFFSETFACESFEATURE_API +# endif +#else +# define ADSK_FUSION_OFFSETFACESFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing Offset Face feature in a design. +/// Offset Face features are created in the UI using the "Press Pull" command. +class OffsetFacesFeature : public Feature { +public: + + ADSK_FUSION_OFFSETFACESFEATURE_API static const char* classType(); + ADSK_FUSION_OFFSETFACESFEATURE_API const char* objectType() const override; + ADSK_FUSION_OFFSETFACESFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_OFFSETFACESFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_OFFSETFACESFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/OffsetFacesFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/OffsetFacesFeatures.h new file mode 100644 index 0000000..e8df428 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/OffsetFacesFeatures.h @@ -0,0 +1,103 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_OFFSETFACESFEATURES_CPP__ +# define ADSK_FUSION_OFFSETFACESFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_OFFSETFACESFEATURES_API +# endif +#else +# define ADSK_FUSION_OFFSETFACESFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class OffsetFacesFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Offset Face features in a design. +/// Offset Face features are created in the UI using the "Press Pull" command. +class OffsetFacesFeatures : public core::Base { +public: + + /// Function that returns the specified Offset Face feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified Offset Face feature using the name of the feature. + /// Offset Face features are created in the UI using the "Press Pull" command. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of Offset Face features in the collection. + /// Offset Face features are created in the UI using the "Press Pull" command. + size_t count() const; + + typedef OffsetFacesFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_OFFSETFACESFEATURES_API static const char* classType(); + ADSK_FUSION_OFFSETFACESFEATURES_API const char* objectType() const override; + ADSK_FUSION_OFFSETFACESFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_OFFSETFACESFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual OffsetFacesFeature* item_raw(size_t index) const = 0; + virtual OffsetFacesFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr OffsetFacesFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr OffsetFacesFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t OffsetFacesFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void OffsetFacesFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_OFFSETFACESFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/OffsetFeature.h b/usr/autodesk/CPP/include/Fusion/Features/OffsetFeature.h new file mode 100644 index 0000000..3def2a8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/OffsetFeature.h @@ -0,0 +1,154 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_OFFSETFEATURE_CPP__ +# define ADSK_FUSION_OFFSETFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_OFFSETFEATURE_API +# endif +#else +# define ADSK_FUSION_OFFSETFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing offset feature in a design. +class OffsetFeature : public Feature { +public: + + /// Sets the faces and sheet bodies to offset. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// entities : An ObjectCollection containing the BRepFace objects to offset. Additional faces may be + /// automatically used depending on the value of the isChainSelection argument. + /// Input faces need not be from the same body. + /// isChainSelection : A boolean value for setting whether or not faces that are tangentially connected to + /// the input faces (if any) will also be offset. The default value is true. + /// Returns true if successful + bool setInputEntities(const core::Ptr& entities, bool isChainSelection = true); + + /// Gets and sets the faces to be offset. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr entities() const; + bool entities(const core::Ptr& value); + + /// Get if the faces that are tangentially connected to the input faces (if any) are also offset. + bool isChainSelection() const; + + /// Returns the parameter controlling the offset distance. You can edit the distance + /// by editing the value of the parameter object. A positive value specifies that the offset + /// is in the same direction as the normal direction of the face. + core::Ptr distance() const; + + /// Gets the feature operation that was performed when the feature was created, + /// (either 'NewBodyFeatureOperation' or 'NewComponentFeatureOperation'. + FeatureOperations operation() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_OFFSETFEATURE_API static const char* classType(); + ADSK_FUSION_OFFSETFEATURE_API const char* objectType() const override; + ADSK_FUSION_OFFSETFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_OFFSETFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setInputEntities_raw(core::ObjectCollection* entities, bool isChainSelection) = 0; + virtual core::ObjectCollection* entities_raw() const = 0; + virtual bool entities_raw(core::ObjectCollection* value) = 0; + virtual bool isChainSelection_raw() const = 0; + virtual ModelParameter* distance_raw() const = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual OffsetFeature* nativeObject_raw() const = 0; + virtual OffsetFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline bool OffsetFeature::setInputEntities(const core::Ptr& entities, bool isChainSelection) +{ + bool res = setInputEntities_raw(entities.get(), isChainSelection); + return res; +} + +inline core::Ptr OffsetFeature::entities() const +{ + core::Ptr res = entities_raw(); + return res; +} + +inline bool OffsetFeature::entities(const core::Ptr& value) +{ + return entities_raw(value.get()); +} + +inline bool OffsetFeature::isChainSelection() const +{ + bool res = isChainSelection_raw(); + return res; +} + +inline core::Ptr OffsetFeature::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline FeatureOperations OffsetFeature::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline core::Ptr OffsetFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr OffsetFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_OFFSETFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/OffsetFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/OffsetFeatureInput.h new file mode 100644 index 0000000..446cf91 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/OffsetFeatureInput.h @@ -0,0 +1,149 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_OFFSETFEATUREINPUT_CPP__ +# define ADSK_FUSION_OFFSETFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_OFFSETFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_OFFSETFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a offset feature. +class OffsetFeatureInput : public core::Base { +public: + + /// An ObjectCollection containing the BRepFace objects being offset. + core::Ptr entities() const; + bool entities(const core::Ptr& value); + + /// Get and sets whether faces that are tangentially connected to the input faces will be included in the offset. + bool isChainSelection() const; + bool isChainSelection(bool value); + + /// Gets and sets the ValueInput object that defines the offset distance. A positive distance value results + /// in an offset in the positive normal direction of the faces. + core::Ptr distance() const; + bool distance(const core::Ptr& value); + + /// Gets and sets the feature operation to perform. Can be 'NewBodyFeatureOperation' or 'NewComponentFeatureOperation'. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_OFFSETFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_OFFSETFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_OFFSETFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_OFFSETFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* entities_raw() const = 0; + virtual bool entities_raw(core::ObjectCollection* value) = 0; + virtual bool isChainSelection_raw() const = 0; + virtual bool isChainSelection_raw(bool value) = 0; + virtual core::ValueInput* distance_raw() const = 0; + virtual bool distance_raw(core::ValueInput* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr OffsetFeatureInput::entities() const +{ + core::Ptr res = entities_raw(); + return res; +} + +inline bool OffsetFeatureInput::entities(const core::Ptr& value) +{ + return entities_raw(value.get()); +} + +inline bool OffsetFeatureInput::isChainSelection() const +{ + bool res = isChainSelection_raw(); + return res; +} + +inline bool OffsetFeatureInput::isChainSelection(bool value) +{ + return isChainSelection_raw(value); +} + +inline core::Ptr OffsetFeatureInput::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline bool OffsetFeatureInput::distance(const core::Ptr& value) +{ + return distance_raw(value.get()); +} + +inline FeatureOperations OffsetFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool OffsetFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr OffsetFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool OffsetFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_OFFSETFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/OffsetFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/OffsetFeatures.h new file mode 100644 index 0000000..228f323 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/OffsetFeatures.h @@ -0,0 +1,142 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_OFFSETFEATURES_CPP__ +# define ADSK_FUSION_OFFSETFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_OFFSETFEATURES_API +# endif +#else +# define ADSK_FUSION_OFFSETFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class OffsetFeature; + class OffsetFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Offset features in a component +/// and supports the ability to create new Offset features. +class OffsetFeatures : public core::Base { +public: + + /// Function that returns the specified offset feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of Offset features in the collection. + size_t count() const; + + /// Creates a OffsetFeatureInput object. Use properties and methods on this object + /// to define the offset feature you want to create and then use the Add method, passing in + /// the OffsetFeatureInput object to create the feature. + /// entities : An ObjectCollection containing the BRepFace objects to offset. Additional faces may be + /// automatically used depending on the value of the isChainSelection argument. + /// Input faces need not be from the same body. + /// distance : ValueInput object that defines the offset distance. A positive value is in the positive + /// normal direction of the face being offset. + /// operation : The feature operation to perform. 'NewBodyFeatureOperation' and 'NewComponentFeatureOperation' are the + /// options supported. + /// isChainSelection : A boolean value for setting whether or not faces that are tangentially connected to + /// the input faces (if any) will be included in the offset. The default value is true. + /// Returns the newly created OffsetFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& entities, const core::Ptr& distance, FeatureOperations operation, bool isChainSelection = true) const; + + /// Creates a new offset feature. + /// input : A FeatureInput object that defines the desired offset feature. Use the createInput + /// method to create a new OffsetFeatureInput object and then use methods on it + /// (the OffsetFeatureInput object) to define the offset feature. + /// Returns the newly created OffsetFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified offset feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef OffsetFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_OFFSETFEATURES_API static const char* classType(); + ADSK_FUSION_OFFSETFEATURES_API const char* objectType() const override; + ADSK_FUSION_OFFSETFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_OFFSETFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual OffsetFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual OffsetFeatureInput* createInput_raw(core::ObjectCollection* entities, core::ValueInput* distance, FeatureOperations operation, bool isChainSelection) const = 0; + virtual OffsetFeature* add_raw(OffsetFeatureInput* input) = 0; + virtual OffsetFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr OffsetFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t OffsetFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr OffsetFeatures::createInput(const core::Ptr& entities, const core::Ptr& distance, FeatureOperations operation, bool isChainSelection) const +{ + core::Ptr res = createInput_raw(entities.get(), distance.get(), operation, isChainSelection); + return res; +} + +inline core::Ptr OffsetFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr OffsetFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void OffsetFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_OFFSETFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/OffsetStartDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/OffsetStartDefinition.h new file mode 100644 index 0000000..d2f2079 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/OffsetStartDefinition.h @@ -0,0 +1,93 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_OFFSETSTARTDEFINITION_CPP__ +# define ADSK_FUSION_OFFSETSTARTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_OFFSETSTARTDEFINITION_API +# endif +#else +# define ADSK_FUSION_OFFSETSTARTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Plane; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// A definition object that is used to define a feature whose start plane is defined as plane that is +/// offset from the sketch plane of the profile. +class OffsetStartDefinition : public ExtentDefinition { +public: + + /// Statically creates a new OffsetStartDefinition object. This is used as input when + /// create a new feature and defining the starting condition. + /// offset : An input ValueInput objects that defines the offset distance. The offset can be positive or + /// negative. A positive value indicates an offset in the same direction as the z axis of the + /// profile plane. + /// Returns the newly created OffsetStartDefinition object or null in the case of failure. + static core::Ptr create(const core::Ptr& offset); + + /// Gets the currently defined offset value. If the ProfilePlaneWithOffsetDefinition object was + /// created statically and is not associated with a feature, this will return a ValueInput object. + /// if the ProfilePlaneWithOffsetDefinition is associated with an existing feature, this will return + /// the parameter that was created when the feature was created. To edit the offset, use properties + /// on the parameter to change the value of the parameter. + core::Ptr offset() const; + + /// Returns the geometric definition of the profile plane. + core::Ptr profilePlane() const; + + ADSK_FUSION_OFFSETSTARTDEFINITION_API static const char* classType(); + ADSK_FUSION_OFFSETSTARTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_OFFSETSTARTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_OFFSETSTARTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_OFFSETSTARTDEFINITION_API static OffsetStartDefinition* create_raw(core::ValueInput* offset); + virtual core::Base* offset_raw() const = 0; + virtual core::Plane* profilePlane_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr OffsetStartDefinition::create(const core::Ptr& offset) +{ + core::Ptr res = create_raw(offset.get()); + return res; +} + +inline core::Ptr OffsetStartDefinition::offset() const +{ + core::Ptr res = offset_raw(); + return res; +} + +inline core::Ptr OffsetStartDefinition::profilePlane() const +{ + core::Ptr res = profilePlane_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_OFFSETSTARTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/OnEdgeHolePositionDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/OnEdgeHolePositionDefinition.h new file mode 100644 index 0000000..9459901 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/OnEdgeHolePositionDefinition.h @@ -0,0 +1,85 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "HolePositionDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_ONEDGEHOLEPOSITIONDEFINITION_CPP__ +# define ADSK_FUSION_ONEDGEHOLEPOSITIONDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_ONEDGEHOLEPOSITIONDEFINITION_API +# endif +#else +# define ADSK_FUSION_ONEDGEHOLEPOSITIONDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepEdge; +}} + +namespace adsk { namespace fusion { + +/// Provides positioning information for a hole that is positioned +/// on the start, end or center of an edge. +class OnEdgeHolePositionDefinition : public HolePositionDefinition { +public: + + /// Returns the plane that defines the orientation and start of the hole. + core::Ptr planarEntity() const; + + /// Returns the edge the hole is positioned on. + core::Ptr edge() const; + + /// Returns the position of the hole on the edge. + /// The hole can be at the start, midpoint, or end of the edge. + HoleEdgePositions position() const; + + ADSK_FUSION_ONEDGEHOLEPOSITIONDEFINITION_API static const char* classType(); + ADSK_FUSION_ONEDGEHOLEPOSITIONDEFINITION_API const char* objectType() const override; + ADSK_FUSION_ONEDGEHOLEPOSITIONDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_ONEDGEHOLEPOSITIONDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* planarEntity_raw() const = 0; + virtual BRepEdge* edge_raw() const = 0; + virtual HoleEdgePositions position_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr OnEdgeHolePositionDefinition::planarEntity() const +{ + core::Ptr res = planarEntity_raw(); + return res; +} + +inline core::Ptr OnEdgeHolePositionDefinition::edge() const +{ + core::Ptr res = edge_raw(); + return res; +} + +inline HoleEdgePositions OnEdgeHolePositionDefinition::position() const +{ + HoleEdgePositions res = position_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_ONEDGEHOLEPOSITIONDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/OneSideToExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/OneSideToExtentDefinition.h new file mode 100644 index 0000000..baa8524 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/OneSideToExtentDefinition.h @@ -0,0 +1,86 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_ONESIDETOEXTENTDEFINITION_CPP__ +# define ADSK_FUSION_ONESIDETOEXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_ONESIDETOEXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_ONESIDETOEXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines the inputs for a OneSideToExtentDefinition object. +/// This defines a feature extent that goes up to a face or construction plane in one direction. +class OneSideToExtentDefinition : public ExtentDefinition { +public: + + /// Gets and sets the entity that defines the extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. + core::Ptr toEntity() const; + bool toEntity(const core::Ptr& value); + + /// Specifies if the face should be extended or use adjacent faces if necessary to define the termination + /// of the extrusion. + /// When used for a revolve feature this is ignored and is always treated as true. + bool matchShape() const; + bool matchShape(bool value); + + ADSK_FUSION_ONESIDETOEXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_ONESIDETOEXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_ONESIDETOEXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_ONESIDETOEXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* toEntity_raw() const = 0; + virtual bool toEntity_raw(core::Base* value) = 0; + virtual bool matchShape_raw() const = 0; + virtual bool matchShape_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr OneSideToExtentDefinition::toEntity() const +{ + core::Ptr res = toEntity_raw(); + return res; +} + +inline bool OneSideToExtentDefinition::toEntity(const core::Ptr& value) +{ + return toEntity_raw(value.get()); +} + +inline bool OneSideToExtentDefinition::matchShape() const +{ + bool res = matchShape_raw(); + return res; +} + +inline bool OneSideToExtentDefinition::matchShape(bool value) +{ + return matchShape_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_ONESIDETOEXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PatchFeature.h b/usr/autodesk/CPP/include/Fusion/Features/PatchFeature.h new file mode 100644 index 0000000..2038dec --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PatchFeature.h @@ -0,0 +1,137 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PATCHFEATURE_CPP__ +# define ADSK_FUSION_PATCHFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_PATCHFEATURE_API +# endif +#else +# define ADSK_FUSION_PATCHFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing patch feature in a design. +class PatchFeature : public Feature { +public: + + /// Returns an ObjectCollection that contains all of the sketch curves or B-Rep edges + /// that define the closed outer boundary of the patch feature. + /// When setting this property, the input can be a sketch profile, a single sketch curve, a single B-Rep edge, + /// or an ObjectCollection of sketch curves or B-Rep edges. + /// If a single sketch curve or B-Rep edge is input, that is not closed, Fusion 360 will automatically find connected sketch curves + /// or B-Rep edges in order to define a closed loop. All sketch curves are valid as input. BRepEdges are valid if they are + /// an "open" edge, which means they are only used by one face. + /// If an ObjectCollection of sketch curves or B-Rep edges is input they must define a closed shape and the B-Rep + /// edges must be valid "open" edges. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr boundaryCurve() const; + bool boundaryCurve(const core::Ptr& value); + + /// Gets the type of operation performed by the patch feature. + FeatureOperations operation() const; + + /// Gets and sets the type of surface continuity used when creating the patch face. This is only used when BRepEdges are input and + /// defines the continuity of how the patch face connects to the face adjacent to each of the input edges. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + SurfaceContinuityTypes continuity() const; + bool continuity(SurfaceContinuityTypes value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_PATCHFEATURE_API static const char* classType(); + ADSK_FUSION_PATCHFEATURE_API const char* objectType() const override; + ADSK_FUSION_PATCHFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PATCHFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* boundaryCurve_raw() const = 0; + virtual bool boundaryCurve_raw(core::Base* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual SurfaceContinuityTypes continuity_raw() const = 0; + virtual bool continuity_raw(SurfaceContinuityTypes value) = 0; + virtual PatchFeature* nativeObject_raw() const = 0; + virtual PatchFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr PatchFeature::boundaryCurve() const +{ + core::Ptr res = boundaryCurve_raw(); + return res; +} + +inline bool PatchFeature::boundaryCurve(const core::Ptr& value) +{ + return boundaryCurve_raw(value.get()); +} + +inline FeatureOperations PatchFeature::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline SurfaceContinuityTypes PatchFeature::continuity() const +{ + SurfaceContinuityTypes res = continuity_raw(); + return res; +} + +inline bool PatchFeature::continuity(SurfaceContinuityTypes value) +{ + return continuity_raw(value); +} + +inline core::Ptr PatchFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr PatchFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PATCHFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PatchFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/PatchFeatureInput.h new file mode 100644 index 0000000..53fe709 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PatchFeatureInput.h @@ -0,0 +1,155 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PATCHFEATUREINPUT_CPP__ +# define ADSK_FUSION_PATCHFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_PATCHFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_PATCHFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a patch feature. +class PatchFeatureInput : public core::Base { +public: + + /// Gets and set the input geometry that will be used to define the boundary. This can be a sketch profile, + /// a single sketch curve, a single B-Rep edge, or a Path object. + /// If a single sketch curve or B-Rep edge is input, that is not closed, Fusion 360 will automatically find connected sketch curves + /// or B-Rep edges in order to define a closed loop. All sketch curves are valid as input. BRepEdges are valid if they are + /// an "open" edge, which means they are only used by one face. + /// If a Path is input it must define a closed shape and the B-Rep edges must be valid "open" edges. + core::Ptr boundaryCurve() const; + bool boundaryCurve(const core::Ptr& value); + + /// Gets and sets the type of operation performed by the patch feature. Only 'NewBodyFeatureOperation' and 'NewComponentFeatureOperation' are + /// valid operations for patch features. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets and sets type of surface continuity to use when matching boundary edges to face edges. When a new PatchFeatureInput is + /// created, this is initialized to ConnectedSurfaceContinuityType. This value is ignored when creating a patch for sketch curves. + SurfaceContinuityTypes continuity() const; + bool continuity(SurfaceContinuityTypes value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs to be + /// specified when the Patch feature is created based on geometry (e.g. a profile, edges, faces) + /// in another component AND (the Patch feature) is not in the root component. + /// The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + ADSK_FUSION_PATCHFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_PATCHFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_PATCHFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PATCHFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* boundaryCurve_raw() const = 0; + virtual bool boundaryCurve_raw(core::Base* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual SurfaceContinuityTypes continuity_raw() const = 0; + virtual bool continuity_raw(SurfaceContinuityTypes value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr PatchFeatureInput::boundaryCurve() const +{ + core::Ptr res = boundaryCurve_raw(); + return res; +} + +inline bool PatchFeatureInput::boundaryCurve(const core::Ptr& value) +{ + return boundaryCurve_raw(value.get()); +} + +inline FeatureOperations PatchFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool PatchFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline SurfaceContinuityTypes PatchFeatureInput::continuity() const +{ + SurfaceContinuityTypes res = continuity_raw(); + return res; +} + +inline bool PatchFeatureInput::continuity(SurfaceContinuityTypes value) +{ + return continuity_raw(value); +} + +inline core::Ptr PatchFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool PatchFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline core::Ptr PatchFeatureInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool PatchFeatureInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PATCHFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PatchFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/PatchFeatures.h new file mode 100644 index 0000000..09955c3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PatchFeatures.h @@ -0,0 +1,137 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PATCHFEATURES_CPP__ +# define ADSK_FUSION_PATCHFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_PATCHFEATURES_API +# endif +#else +# define ADSK_FUSION_PATCHFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class PatchFeature; + class PatchFeatureInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Patch features in a component +/// and supports the ability to create new Patch features. +class PatchFeatures : public core::Base { +public: + + /// Function that returns the specified patch feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified patch feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of Patch features in the collection. + size_t count() const; + + /// Creates a PatchFeatureInput object. Use properties and methods on the returned PatchFeatureInput + /// object to set other settings. The PatchFeatureInput object can then be used as input to the + /// add method to create the patch feature. + /// boundaryCurve : Defines the input geometry that will be used to define the boundary. This can be a sketch profile, + /// a single sketch curve, a single B-Rep edge, or a Path object. + /// If a single sketch curve or B-Rep edge is input, that is not closed, Fusion 360 will automatically find connected sketch curves + /// or B-Rep edges in order to define a closed loop. All sketch curves are valid as input. BRepEdges are valid if they are + /// an "open" edge, which means they are only used by one face. + /// If a Path is input it must define a closed shape and the B-Rep edges must be valid "open" edges. + /// operation : The feature operation to perform. Only 'NewBodyFeatureOperation' and 'NewComponentFeatureOperation' are + /// valid operations for patch features. + /// Returns the newly created PatchFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& boundaryCurve, FeatureOperations operation) const; + + /// Creates a new patch feature. + /// input : A PatchFeatureInput object that defines the desired patch feature. Use the createInput + /// method to create a new PatchFeatureInput object and then use methods on it + /// (the PatchFeatureInput object) to define the patch feature. + /// Returns the newly created PatchFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + typedef PatchFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_PATCHFEATURES_API static const char* classType(); + ADSK_FUSION_PATCHFEATURES_API const char* objectType() const override; + ADSK_FUSION_PATCHFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PATCHFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual PatchFeature* item_raw(size_t index) const = 0; + virtual PatchFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual PatchFeatureInput* createInput_raw(core::Base* boundaryCurve, FeatureOperations operation) const = 0; + virtual PatchFeature* add_raw(PatchFeatureInput* input) = 0; +}; + +// Inline wrappers + +inline core::Ptr PatchFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr PatchFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t PatchFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr PatchFeatures::createInput(const core::Ptr& boundaryCurve, FeatureOperations operation) const +{ + core::Ptr res = createInput_raw(boundaryCurve.get(), operation); + return res; +} + +inline core::Ptr PatchFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +template inline void PatchFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PATCHFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/Path.h b/usr/autodesk/CPP/include/Fusion/Features/Path.h new file mode 100644 index 0000000..b04b6b8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/Path.h @@ -0,0 +1,166 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PATH_CPP__ +# define ADSK_FUSION_PATH_API XI_EXPORT +# else +# define ADSK_FUSION_PATH_API +# endif +#else +# define ADSK_FUSION_PATH_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class PathEntity; +}} + +namespace adsk { namespace fusion { + +/// The Path object represents a single set of connected curves. The order of the objects within the collection is the same as the connection order of the entities. +/// When using a Path to create a feature, the Path serves as a way to pass in the set of sketch entities and edges. When +/// getting the Path of an existing feature it returns the actual path used to define the feature geometry. In cases like a +/// sweep feature, this can result in using portions of the original input sketch curves or edges and the returned path +/// will provide these "partial" curves as the PathEntity objects. +class Path : public core::Base { +public: + + /// Function that returns the specified PathEntity using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of curves in the path. + size_t count() const; + + /// Indicates if the path is closed or not. Returns True in the case of a closed path. + bool isClosed() const; + + /// This property is not supported for the Path object. + core::Ptr assemblyContext() const; + + /// This property is not supported for the Path object. + core::Ptr nativeObject() const; + + /// This method is not supported for the Path object. + /// occurrence : + /// + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Creates a new Path that can be used as input to various features. For example, it is used + /// to create an open set of curves to create surfaces using extrude, revolve, and sweep. + /// It is also used to create the path for a sweep and sections and profiles and rails for lofts. And + /// it is used to define the boundary of a patch feature. + /// Although the creation of a path is very flexible as far as the types of entities and whether they + /// are planar or not, each of the features have specific requirements and the path must meet those + /// requirements. For example, a path for an extrusion can only contain sketch curves and must be planar, + /// whereas the path for a sweep can contain a mix of sketch curves and edges and can be in three dimensions. + /// curves : A SketchCurve, BRepEdge, or an ObjectCollection containing multiple sketch entities and/or BRepEdges. If a single sketch curve + /// or BRepEdge is input the chainCurves argument is used to determine if connected curves or edges (they do not need to be tangent) + /// should be automatically found. Searching for connected curves is only performed within the same sketch or open edges on the same + /// body. If multiple curves are provided the chainCurves argument is treated as false so only the specified input curves are + /// used. The input curves need to geometrically connect for a path to be created. + /// chainOptions : If a single SketchCurve or BRepEdge is input, this argument is used to specify the rules in how chained entities should be found. If + /// an ObjectCollection is input, this argument is ignored. + /// Returns the new Path object or null in the case of a failure. + static core::Ptr create(const core::Ptr& curves, ChainedCurveOptions chainOptions); + + /// Adds additional curves to the existing path. This can be useful when creating a complex path for a sweep and you + /// want to include sets of curves from multiple sketches and edges from multiple bodies. + /// curves : A SketchCurve, BRepEdge, or an ObjectCollection containing multiple sketch entities and/or BRepEdges. If a single sketch curve + /// or BRepEdge is input the chainCurves argument is used to determine if connected curves or edges (they do not need to be tangent) + /// should be automatically found. Searching for connected curves is only performed within the same sketch or open edges on the same + /// body. If multiple curves are provided the chainCurves argument is treated as false so only the specified input curves are + /// used. The input curves need to geometrically connect for a path to be created. + /// chainOptions : If a single SketchCurve or BRepEdge is input, this argument is used to specify the rules in how chained entities should be found. If + /// an ObjectCollection is input, this argument is ignored. + /// Returns a bool indicating if the process was successful or not. + bool addCurves(const core::Ptr& curves, ChainedCurveOptions chainOptions); + + ADSK_FUSION_PATH_API static const char* classType(); + ADSK_FUSION_PATH_API const char* objectType() const override; + ADSK_FUSION_PATH_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PATH_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual PathEntity* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual bool isClosed_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual Path* nativeObject_raw() const = 0; + virtual Path* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + ADSK_FUSION_PATH_API static Path* create_raw(core::Base* curves, ChainedCurveOptions chainOptions); + virtual bool addCurves_raw(core::Base* curves, ChainedCurveOptions chainOptions) = 0; +}; + +// Inline wrappers + +inline core::Ptr Path::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t Path::count() const +{ + size_t res = count_raw(); + return res; +} + +inline bool Path::isClosed() const +{ + bool res = isClosed_raw(); + return res; +} + +inline core::Ptr Path::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr Path::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr Path::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr Path::create(const core::Ptr& curves, ChainedCurveOptions chainOptions) +{ + core::Ptr res = create_raw(curves.get(), chainOptions); + return res; +} + +inline bool Path::addCurves(const core::Ptr& curves, ChainedCurveOptions chainOptions) +{ + bool res = addCurves_raw(curves.get(), chainOptions); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PATH_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PathEntity.h b/usr/autodesk/CPP/include/Fusion/Features/PathEntity.h new file mode 100644 index 0000000..cd78893 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PathEntity.h @@ -0,0 +1,142 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/CoreTypeDefs.h" +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PATHENTITY_CPP__ +# define ADSK_FUSION_PATHENTITY_API XI_EXPORT +# else +# define ADSK_FUSION_PATHENTITY_API +# endif +#else +# define ADSK_FUSION_PATHENTITY_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class Path; +}} +namespace adsk { namespace core { + class Curve3D; +}} + +namespace adsk { namespace fusion { + +/// The PathEntity object represents a curve within a path +class PathEntity : public core::Base { +public: + + /// Property that returns the geometry of the entity. + /// This is different from the original path curve if the true start point is not the same as the start point of the original path curve. + core::Ptr curve() const; + + /// Property that returns the type of the curve referenced by the path entity. This property allows you to determine what type of object will be returned by the Curve property. + core::Curve3DTypes curveType() const; + + /// Property that gets the sketch curve or edge this entity was derived from. + core::Ptr entity() const; + + /// Property that returns the parent Path of the entity. + core::Ptr parentPath() const; + + /// This property is not supported for a PathEntity object. + core::Ptr assemblyContext() const; + + /// This property is not supported for a PathEntity object. + core::Ptr nativeObject() const; + + /// This method is not supported for a PathEntity object. + /// occurrence : + /// + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Indicates if the orientation of this PathEntity is in the same direction or opposed to the natural direction + /// of the SketchCurve or BRepEdge object it is derived from. + bool isOpposedToEntity() const; + + ADSK_FUSION_PATHENTITY_API static const char* classType(); + ADSK_FUSION_PATHENTITY_API const char* objectType() const override; + ADSK_FUSION_PATHENTITY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PATHENTITY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Curve3D* curve_raw() const = 0; + virtual core::Curve3DTypes curveType_raw() const = 0; + virtual core::Base* entity_raw() const = 0; + virtual Path* parentPath_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual PathEntity* nativeObject_raw() const = 0; + virtual PathEntity* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual bool isOpposedToEntity_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr PathEntity::curve() const +{ + core::Ptr res = curve_raw(); + return res; +} + +inline core::Curve3DTypes PathEntity::curveType() const +{ + core::Curve3DTypes res = curveType_raw(); + return res; +} + +inline core::Ptr PathEntity::entity() const +{ + core::Ptr res = entity_raw(); + return res; +} + +inline core::Ptr PathEntity::parentPath() const +{ + core::Ptr res = parentPath_raw(); + return res; +} + +inline core::Ptr PathEntity::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr PathEntity::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr PathEntity::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline bool PathEntity::isOpposedToEntity() const +{ + bool res = isOpposedToEntity_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PATHENTITY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PathPatternFeature.h b/usr/autodesk/CPP/include/Fusion/Features/PathPatternFeature.h new file mode 100644 index 0000000..2f17c83 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PathPatternFeature.h @@ -0,0 +1,327 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PATHPATTERNFEATURE_CPP__ +# define ADSK_FUSION_PATHPATTERNFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_PATHPATTERNFEATURE_API +# endif +#else +# define ADSK_FUSION_PATHPATTERNFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; + class Path; + class PatternElements; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing path pattern feature in a design. +class PathPatternFeature : public Feature { +public: + + /// Gets and sets the input entities. The collection can contain faces, features, bodies or occurrences. + /// All of the entities must be of a single type. For example, it can't contain features and occurrences + /// but only features or occurrences. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the path to create the pattern on path. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr path() const; + bool path(const core::Ptr& value); + + /// Gets the quantity of the elements. + /// Edit the value through ModelParameter. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr quantity() const; + + /// Gets the distance. + /// Edit the value through ModelParameter. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr distance() const; + + /// Gets and sets the start point on the path to count the distance. + /// It's between 0 and 1. 0 means start point of the path, 1 means end point of the path. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + double startPoint() const; + bool startPoint(double value); + + /// Gets and sets if flip the direction from start point. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isFlipDirection() const; + bool isFlipDirection(bool value); + + /// Gets and sets how the distance between elements is computed. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + PatternDistanceType patternDistanceType() const; + bool patternDistanceType(PatternDistanceType value); + + /// Gets and sets if the pattern is in one direction or symmetric. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isSymmetric() const; + bool isSymmetric(bool value); + + /// Gets and sets if the orientation is along path. + /// If false, the orientation is identical. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isOrientationAlongPath() const; + bool isOrientationAlongPath(bool value); + + /// Gets and sets the id's of the elements to suppress. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + std::vector suppressedElementsIds() const; + bool suppressedElementsIds(const std::vector& value); + + /// Gets the PatternElements collection that contains the elements created by this pattern. + core::Ptr patternElements() const; + + /// Get the features that were created for this mirror. + /// Returns null in the case where the feature is parametric. + core::Ptr resultFeatures() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the type of entities the pattern consists of. This can be used to help + /// determine the type of results that will be found in the pattern elements. + PatternEntityTypes patternEntityType() const; + + /// Gets and sets the compute option for this pattern feature. + /// This property only applies when patterning features and is ignored in the direct modeling environment. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + PatternComputeOptions patternComputeOption() const; + bool patternComputeOption(PatternComputeOptions value); + + ADSK_FUSION_PATHPATTERNFEATURE_API static const char* classType(); + ADSK_FUSION_PATHPATTERNFEATURE_API const char* objectType() const override; + ADSK_FUSION_PATHPATTERNFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PATHPATTERNFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual Path* path_raw() const = 0; + virtual bool path_raw(Path* value) = 0; + virtual ModelParameter* quantity_raw() const = 0; + virtual ModelParameter* distance_raw() const = 0; + virtual double startPoint_raw() const = 0; + virtual bool startPoint_raw(double value) = 0; + virtual bool isFlipDirection_raw() const = 0; + virtual bool isFlipDirection_raw(bool value) = 0; + virtual PatternDistanceType patternDistanceType_raw() const = 0; + virtual bool patternDistanceType_raw(PatternDistanceType value) = 0; + virtual bool isSymmetric_raw() const = 0; + virtual bool isSymmetric_raw(bool value) = 0; + virtual bool isOrientationAlongPath_raw() const = 0; + virtual bool isOrientationAlongPath_raw(bool value) = 0; + virtual size_t* suppressedElementsIds_raw(size_t& return_size) const = 0; + virtual bool suppressedElementsIds_raw(const size_t* value, size_t value_size) = 0; + virtual PatternElements* patternElements_raw() const = 0; + virtual core::ObjectCollection* resultFeatures_raw() const = 0; + virtual PathPatternFeature* nativeObject_raw() const = 0; + virtual PathPatternFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual PatternEntityTypes patternEntityType_raw() const = 0; + virtual PatternComputeOptions patternComputeOption_raw() const = 0; + virtual bool patternComputeOption_raw(PatternComputeOptions value) = 0; +}; + +// Inline wrappers + +inline core::Ptr PathPatternFeature::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool PathPatternFeature::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr PathPatternFeature::path() const +{ + core::Ptr res = path_raw(); + return res; +} + +inline bool PathPatternFeature::path(const core::Ptr& value) +{ + return path_raw(value.get()); +} + +inline core::Ptr PathPatternFeature::quantity() const +{ + core::Ptr res = quantity_raw(); + return res; +} + +inline core::Ptr PathPatternFeature::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline double PathPatternFeature::startPoint() const +{ + double res = startPoint_raw(); + return res; +} + +inline bool PathPatternFeature::startPoint(double value) +{ + return startPoint_raw(value); +} + +inline bool PathPatternFeature::isFlipDirection() const +{ + bool res = isFlipDirection_raw(); + return res; +} + +inline bool PathPatternFeature::isFlipDirection(bool value) +{ + return isFlipDirection_raw(value); +} + +inline PatternDistanceType PathPatternFeature::patternDistanceType() const +{ + PatternDistanceType res = patternDistanceType_raw(); + return res; +} + +inline bool PathPatternFeature::patternDistanceType(PatternDistanceType value) +{ + return patternDistanceType_raw(value); +} + +inline bool PathPatternFeature::isSymmetric() const +{ + bool res = isSymmetric_raw(); + return res; +} + +inline bool PathPatternFeature::isSymmetric(bool value) +{ + return isSymmetric_raw(value); +} + +inline bool PathPatternFeature::isOrientationAlongPath() const +{ + bool res = isOrientationAlongPath_raw(); + return res; +} + +inline bool PathPatternFeature::isOrientationAlongPath(bool value) +{ + return isOrientationAlongPath_raw(value); +} + +inline std::vector PathPatternFeature::suppressedElementsIds() const +{ + std::vector res; + size_t s; + + size_t* p= suppressedElementsIds_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool PathPatternFeature::suppressedElementsIds(const std::vector& value) +{ + return suppressedElementsIds_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline core::Ptr PathPatternFeature::patternElements() const +{ + core::Ptr res = patternElements_raw(); + return res; +} + +inline core::Ptr PathPatternFeature::resultFeatures() const +{ + core::Ptr res = resultFeatures_raw(); + return res; +} + +inline core::Ptr PathPatternFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr PathPatternFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline PatternEntityTypes PathPatternFeature::patternEntityType() const +{ + PatternEntityTypes res = patternEntityType_raw(); + return res; +} + +inline PatternComputeOptions PathPatternFeature::patternComputeOption() const +{ + PatternComputeOptions res = patternComputeOption_raw(); + return res; +} + +inline bool PathPatternFeature::patternComputeOption(PatternComputeOptions value) +{ + return patternComputeOption_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PATHPATTERNFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PathPatternFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/PathPatternFeatureInput.h new file mode 100644 index 0000000..73ab9f8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PathPatternFeatureInput.h @@ -0,0 +1,257 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PATHPATTERNFEATUREINPUT_CPP__ +# define ADSK_FUSION_PATHPATTERNFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_PATHPATTERNFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_PATHPATTERNFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class Path; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a path pattern +/// feature. +class PathPatternFeatureInput : public core::Base { +public: + + /// Gets and sets the input entities. The collection can contain faces, features, bodies or occurrences. + /// All of the entities must be of a single type. For example, it can't contain features and occurrences + /// but only features or occurrences. + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the path to create the pattern on path. + core::Ptr path() const; + bool path(const core::Ptr& value); + + /// Gets and sets quantity of the elements. + core::Ptr quantity() const; + bool quantity(const core::Ptr& value); + + /// Gets and sets the distance. + core::Ptr distance() const; + bool distance(const core::Ptr& value); + + /// Gets and sets the start point on the path to count the distance. + /// It's between 0 and 1. 0 means start point of the path, 1 means end point of the path. + double startPoint() const; + bool startPoint(double value); + + /// Gets and sets if flip the direction from start point. + bool isFlipDirection() const; + bool isFlipDirection(bool value); + + /// Gets and sets how the distance between elements is computed. + PatternDistanceType patternDistanceType() const; + bool patternDistanceType(PatternDistanceType value); + + /// Gets and sets if the pattern is in one direction or symmetric. + bool isSymmetric() const; + bool isSymmetric(bool value); + + /// Gets and sets if the orientation is along path. + /// If false, the orientation is identical. + bool isOrientationAlongPath() const; + bool isOrientationAlongPath(bool value); + + /// Gets and sets the compute option when patterning features. The default value for this is AdjustPatternCompute. + /// This property only applies when patterning features and is ignored in the direct modeling environment. + PatternComputeOptions patternComputeOption() const; + bool patternComputeOption(PatternComputeOptions value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_PATHPATTERNFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_PATHPATTERNFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_PATHPATTERNFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PATHPATTERNFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual Path* path_raw() const = 0; + virtual bool path_raw(Path* value) = 0; + virtual core::ValueInput* quantity_raw() const = 0; + virtual bool quantity_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* distance_raw() const = 0; + virtual bool distance_raw(core::ValueInput* value) = 0; + virtual double startPoint_raw() const = 0; + virtual bool startPoint_raw(double value) = 0; + virtual bool isFlipDirection_raw() const = 0; + virtual bool isFlipDirection_raw(bool value) = 0; + virtual PatternDistanceType patternDistanceType_raw() const = 0; + virtual bool patternDistanceType_raw(PatternDistanceType value) = 0; + virtual bool isSymmetric_raw() const = 0; + virtual bool isSymmetric_raw(bool value) = 0; + virtual bool isOrientationAlongPath_raw() const = 0; + virtual bool isOrientationAlongPath_raw(bool value) = 0; + virtual PatternComputeOptions patternComputeOption_raw() const = 0; + virtual bool patternComputeOption_raw(PatternComputeOptions value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr PathPatternFeatureInput::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool PathPatternFeatureInput::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr PathPatternFeatureInput::path() const +{ + core::Ptr res = path_raw(); + return res; +} + +inline bool PathPatternFeatureInput::path(const core::Ptr& value) +{ + return path_raw(value.get()); +} + +inline core::Ptr PathPatternFeatureInput::quantity() const +{ + core::Ptr res = quantity_raw(); + return res; +} + +inline bool PathPatternFeatureInput::quantity(const core::Ptr& value) +{ + return quantity_raw(value.get()); +} + +inline core::Ptr PathPatternFeatureInput::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline bool PathPatternFeatureInput::distance(const core::Ptr& value) +{ + return distance_raw(value.get()); +} + +inline double PathPatternFeatureInput::startPoint() const +{ + double res = startPoint_raw(); + return res; +} + +inline bool PathPatternFeatureInput::startPoint(double value) +{ + return startPoint_raw(value); +} + +inline bool PathPatternFeatureInput::isFlipDirection() const +{ + bool res = isFlipDirection_raw(); + return res; +} + +inline bool PathPatternFeatureInput::isFlipDirection(bool value) +{ + return isFlipDirection_raw(value); +} + +inline PatternDistanceType PathPatternFeatureInput::patternDistanceType() const +{ + PatternDistanceType res = patternDistanceType_raw(); + return res; +} + +inline bool PathPatternFeatureInput::patternDistanceType(PatternDistanceType value) +{ + return patternDistanceType_raw(value); +} + +inline bool PathPatternFeatureInput::isSymmetric() const +{ + bool res = isSymmetric_raw(); + return res; +} + +inline bool PathPatternFeatureInput::isSymmetric(bool value) +{ + return isSymmetric_raw(value); +} + +inline bool PathPatternFeatureInput::isOrientationAlongPath() const +{ + bool res = isOrientationAlongPath_raw(); + return res; +} + +inline bool PathPatternFeatureInput::isOrientationAlongPath(bool value) +{ + return isOrientationAlongPath_raw(value); +} + +inline PatternComputeOptions PathPatternFeatureInput::patternComputeOption() const +{ + PatternComputeOptions res = patternComputeOption_raw(); + return res; +} + +inline bool PathPatternFeatureInput::patternComputeOption(PatternComputeOptions value) +{ + return patternComputeOption_raw(value); +} + +inline core::Ptr PathPatternFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool PathPatternFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PATHPATTERNFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PathPatternFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/PathPatternFeatures.h new file mode 100644 index 0000000..0c09a55 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PathPatternFeatures.h @@ -0,0 +1,144 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PATHPATTERNFEATURES_CPP__ +# define ADSK_FUSION_PATHPATTERNFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_PATHPATTERNFEATURES_API +# endif +#else +# define ADSK_FUSION_PATHPATTERNFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Path; + class PathPatternFeature; + class PathPatternFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing path pattern features in a component +/// and supports the ability to create new path pattern features. +class PathPatternFeatures : public core::Base { +public: + + /// Function that returns the specified path pattern feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of path pattern features in the collection. + size_t count() const; + + /// Creates a PathPatternFeatureInput object. Use properties and methods on this object + /// to define the path pattern you want to create and then use the Add method, passing in + /// the PathPatternFeatureInput object. + /// inputEntities : The collection can contain faces, features, bodies or occurrences. + /// All of the entities must be of a single type. For example, it can't contain features and occurrences + /// but only features or occurrences. + /// path : The Path object that represents a single set of connected curves along which to drive the pattern. + /// quantity : Specifies the number of instances in the first direction. + /// distance : Specifies the distance. How this value is used depends on the value of the PatternDistanceType property. A + /// negative value can be used to change the direction. + /// If the value is ExtentPatternDistanceType then it defines the total distance of the pattern. + /// If the value is SpacingPatternDistanceType then it defines the distance between each element. + /// patternDistanceType : Specifies how the distance between elements is computed. + /// Returns the newly created PathPatternFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& inputEntities, const core::Ptr& path, const core::Ptr& quantity, const core::Ptr& distance, PatternDistanceType patternDistanceType) const; + + /// Creates a new path pattern feature. + /// input : A PathPatternFeatureInput object that defines the desired path pattern. Use the createInput + /// method to create a new PathPatternFeatureInput object and then use methods on it + /// (the PathPatternFeatureInput object) to define the path pattern. + /// Returns the newly created PathPatternFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified path pattern feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef PathPatternFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_PATHPATTERNFEATURES_API static const char* classType(); + ADSK_FUSION_PATHPATTERNFEATURES_API const char* objectType() const override; + ADSK_FUSION_PATHPATTERNFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PATHPATTERNFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual PathPatternFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual PathPatternFeatureInput* createInput_raw(core::ObjectCollection* inputEntities, Path* path, core::ValueInput* quantity, core::ValueInput* distance, PatternDistanceType patternDistanceType) const = 0; + virtual PathPatternFeature* add_raw(PathPatternFeatureInput* input) = 0; + virtual PathPatternFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr PathPatternFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t PathPatternFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr PathPatternFeatures::createInput(const core::Ptr& inputEntities, const core::Ptr& path, const core::Ptr& quantity, const core::Ptr& distance, PatternDistanceType patternDistanceType) const +{ + core::Ptr res = createInput_raw(inputEntities.get(), path.get(), quantity.get(), distance.get(), patternDistanceType); + return res; +} + +inline core::Ptr PathPatternFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr PathPatternFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void PathPatternFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PATHPATTERNFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PatternElement.h b/usr/autodesk/CPP/include/Fusion/Features/PatternElement.h new file mode 100644 index 0000000..354fee1 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PatternElement.h @@ -0,0 +1,163 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PATTERNELEMENT_CPP__ +# define ADSK_FUSION_PATTERNELEMENT_API XI_EXPORT +# else +# define ADSK_FUSION_PATTERNELEMENT_API +# endif +#else +# define ADSK_FUSION_PATTERNELEMENT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; + class Feature; + class Occurrence; +}} +namespace adsk { namespace core { + class Matrix3D; +}} + +namespace adsk { namespace fusion { + +/// This class defines the properties that pertain to the pattern element. +class PatternElement : public core::Base { +public: + + /// Gets the faces generated as a result of this particular element. + std::vector> faces() const; + + /// Gets the id of this element within the pattern. + size_t id() const; + + /// Gets the feature pattern this element is a member of. + core::Ptr parentFeature() const; + + /// Gets and sets whether the element is suppressed or not. A value of True indicates it is suppressed + bool isSuppressed() const; + bool isSuppressed(bool value); + + /// Get the transform that describes this elements relative position to the parent object(s). + /// The transform returned for the first element in a pattern will be an identity matrix. + core::Ptr transform() const; + + /// Get the name of the pattern element. + std::string name() const; + + /// If the patternEntityType property of the parent feature returns OccurrencesPatternType + /// then this property will return the occurrences associated with this particular pattern + /// element. + std::vector> occurrences() const; + + ADSK_FUSION_PATTERNELEMENT_API static const char* classType(); + ADSK_FUSION_PATTERNELEMENT_API const char* objectType() const override; + ADSK_FUSION_PATTERNELEMENT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PATTERNELEMENT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace** faces_raw(size_t& return_size) const = 0; + virtual size_t id_raw() const = 0; + virtual Feature* parentFeature_raw() const = 0; + virtual bool isSuppressed_raw() const = 0; + virtual bool isSuppressed_raw(bool value) = 0; + virtual core::Matrix3D* transform_raw() const = 0; + virtual char* name_raw() const = 0; + virtual Occurrence** occurrences_raw(size_t& return_size) const = 0; +}; + +// Inline wrappers + +inline std::vector> PatternElement::faces() const +{ + std::vector> res; + size_t s; + + BRepFace** p= faces_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline size_t PatternElement::id() const +{ + size_t res = id_raw(); + return res; +} + +inline core::Ptr PatternElement::parentFeature() const +{ + core::Ptr res = parentFeature_raw(); + return res; +} + +inline bool PatternElement::isSuppressed() const +{ + bool res = isSuppressed_raw(); + return res; +} + +inline bool PatternElement::isSuppressed(bool value) +{ + return isSuppressed_raw(value); +} + +inline core::Ptr PatternElement::transform() const +{ + core::Ptr res = transform_raw(); + return res; +} + +inline std::string PatternElement::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> PatternElement::occurrences() const +{ + std::vector> res; + size_t s; + + Occurrence** p= occurrences_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PATTERNELEMENT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PatternElements.h b/usr/autodesk/CPP/include/Fusion/Features/PatternElements.h new file mode 100644 index 0000000..efa2330 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PatternElements.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PATTERNELEMENTS_CPP__ +# define ADSK_FUSION_PATTERNELEMENTS_API XI_EXPORT +# else +# define ADSK_FUSION_PATTERNELEMENTS_API +# endif +#else +# define ADSK_FUSION_PATTERNELEMENTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class PatternElement; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to pattern elements of mirror and pattern features. +class PatternElements : public core::Base { +public: + + /// Function that returns the specified pattern element using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of pattern elements in the collection. + size_t count() const; + + typedef PatternElement iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_PATTERNELEMENTS_API static const char* classType(); + ADSK_FUSION_PATTERNELEMENTS_API const char* objectType() const override; + ADSK_FUSION_PATTERNELEMENTS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PATTERNELEMENTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual PatternElement* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr PatternElements::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t PatternElements::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void PatternElements::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PATTERNELEMENTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PipeFeature.h b/usr/autodesk/CPP/include/Fusion/Features/PipeFeature.h new file mode 100644 index 0000000..f6ed9ef --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PipeFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PIPEFEATURE_CPP__ +# define ADSK_FUSION_PIPEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_PIPEFEATURE_API +# endif +#else +# define ADSK_FUSION_PIPEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing pipe feature in a design. +class PipeFeature : public Feature { +public: + + ADSK_FUSION_PIPEFEATURE_API static const char* classType(); + ADSK_FUSION_PIPEFEATURE_API const char* objectType() const override; + ADSK_FUSION_PIPEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PIPEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PIPEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PipeFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/PipeFeatures.h new file mode 100644 index 0000000..66ce035 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PipeFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PIPEFEATURES_CPP__ +# define ADSK_FUSION_PIPEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_PIPEFEATURES_API +# endif +#else +# define ADSK_FUSION_PIPEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class PipeFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing pipe features in a design. +class PipeFeatures : public core::Base { +public: + + /// Function that returns the specified pipe feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified pipe feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of pipe features in the collection. + size_t count() const; + + typedef PipeFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_PIPEFEATURES_API static const char* classType(); + ADSK_FUSION_PIPEFEATURES_API const char* objectType() const override; + ADSK_FUSION_PIPEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PIPEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual PipeFeature* item_raw(size_t index) const = 0; + virtual PipeFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr PipeFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr PipeFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t PipeFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void PipeFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PIPEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PlaneAndOffsetsHolePositionDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/PlaneAndOffsetsHolePositionDefinition.h new file mode 100644 index 0000000..6c7ccb1 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PlaneAndOffsetsHolePositionDefinition.h @@ -0,0 +1,109 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "HolePositionDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PLANEANDOFFSETSHOLEPOSITIONDEFINITION_CPP__ +# define ADSK_FUSION_PLANEANDOFFSETSHOLEPOSITIONDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_PLANEANDOFFSETSHOLEPOSITIONDEFINITION_API +# endif +#else +# define ADSK_FUSION_PLANEANDOFFSETSHOLEPOSITIONDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepEdge; + class ModelParameter; +}} + +namespace adsk { namespace fusion { + +/// Provides positioning information for a hole that is positioned on a plane +/// and at a distance from one or two edges. +class PlaneAndOffsetsHolePositionDefinition : public HolePositionDefinition { +public: + + /// Returns the plane that defines the orientation and start of the hole. + core::Ptr planarEntity() const; + + /// The first of 2 edges the hole position is measured from. OffsetOne provides access to + /// the model parameter controlling the offset distance. + core::Ptr edgeOne() const; + + /// Returns the model parameter controlling the distance from the center of the hole + /// to EdgeOne. + core::Ptr offsetOne() const; + + /// The second of two edges the hole position is measured from. OffsetTwo provides access + /// to the model parameter controlling the offset distance. This property can return null + /// in the case where only one edge is used. + core::Ptr edgeTwo() const; + + /// Returns the model parameter controlling the distance from the center of the hole + /// to EdgeTwo. This property returns null in the case where only one edge is used. + core::Ptr offsetTwo() const; + + ADSK_FUSION_PLANEANDOFFSETSHOLEPOSITIONDEFINITION_API static const char* classType(); + ADSK_FUSION_PLANEANDOFFSETSHOLEPOSITIONDEFINITION_API const char* objectType() const override; + ADSK_FUSION_PLANEANDOFFSETSHOLEPOSITIONDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PLANEANDOFFSETSHOLEPOSITIONDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* planarEntity_raw() const = 0; + virtual BRepEdge* edgeOne_raw() const = 0; + virtual ModelParameter* offsetOne_raw() const = 0; + virtual BRepEdge* edgeTwo_raw() const = 0; + virtual ModelParameter* offsetTwo_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr PlaneAndOffsetsHolePositionDefinition::planarEntity() const +{ + core::Ptr res = planarEntity_raw(); + return res; +} + +inline core::Ptr PlaneAndOffsetsHolePositionDefinition::edgeOne() const +{ + core::Ptr res = edgeOne_raw(); + return res; +} + +inline core::Ptr PlaneAndOffsetsHolePositionDefinition::offsetOne() const +{ + core::Ptr res = offsetOne_raw(); + return res; +} + +inline core::Ptr PlaneAndOffsetsHolePositionDefinition::edgeTwo() const +{ + core::Ptr res = edgeTwo_raw(); + return res; +} + +inline core::Ptr PlaneAndOffsetsHolePositionDefinition::offsetTwo() const +{ + core::Ptr res = offsetTwo_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PLANEANDOFFSETSHOLEPOSITIONDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/PointHolePositionDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/PointHolePositionDefinition.h new file mode 100644 index 0000000..e3b8652 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/PointHolePositionDefinition.h @@ -0,0 +1,69 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "HolePositionDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_POINTHOLEPOSITIONDEFINITION_CPP__ +# define ADSK_FUSION_POINTHOLEPOSITIONDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_POINTHOLEPOSITIONDEFINITION_API +# endif +#else +# define ADSK_FUSION_POINTHOLEPOSITIONDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Provides positioning information for a hole that is positioned relative to a 3D coordinate +/// point. +class PointHolePositionDefinition : public HolePositionDefinition { +public: + + /// Returns the plane that defines the orientation and start of the hole. + core::Ptr planarEntity() const; + + /// Returns the coordinates defining the position of the hole. + core::Ptr point() const; + + ADSK_FUSION_POINTHOLEPOSITIONDEFINITION_API static const char* classType(); + ADSK_FUSION_POINTHOLEPOSITIONDEFINITION_API const char* objectType() const override; + ADSK_FUSION_POINTHOLEPOSITIONDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_POINTHOLEPOSITIONDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* planarEntity_raw() const = 0; + virtual core::Base* point_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr PointHolePositionDefinition::planarEntity() const +{ + core::Ptr res = planarEntity_raw(); + return res; +} + +inline core::Ptr PointHolePositionDefinition::point() const +{ + core::Ptr res = point_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_POINTHOLEPOSITIONDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ProfilePlaneStartDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/ProfilePlaneStartDefinition.h new file mode 100644 index 0000000..2b1ec31 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ProfilePlaneStartDefinition.h @@ -0,0 +1,74 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PROFILEPLANESTARTDEFINITION_CPP__ +# define ADSK_FUSION_PROFILEPLANESTARTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_PROFILEPLANESTARTDEFINITION_API +# endif +#else +# define ADSK_FUSION_PROFILEPLANESTARTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Plane; +}} + +namespace adsk { namespace fusion { + +/// A definition object that is used to define a feature whose start plane is the sketch plane of the profile. +class ProfilePlaneStartDefinition : public ExtentDefinition { +public: + + /// Statically creates a new ProfilePlaneStartDefinition object. This is used as input when creating a new + /// feature and defining the starting condition. + /// Returns the newly created ProfilePlaneStartDefinition object or null in the case of a failure. + static core::Ptr create(); + + /// Returns the geometric definition of the profile plane. + core::Ptr profilePlane() const; + + ADSK_FUSION_PROFILEPLANESTARTDEFINITION_API static const char* classType(); + ADSK_FUSION_PROFILEPLANESTARTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_PROFILEPLANESTARTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PROFILEPLANESTARTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_PROFILEPLANESTARTDEFINITION_API static ProfilePlaneStartDefinition* create_raw(); + virtual core::Plane* profilePlane_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ProfilePlaneStartDefinition::create() +{ + core::Ptr res = create_raw(); + return res; +} + +inline core::Ptr ProfilePlaneStartDefinition::profilePlane() const +{ + core::Ptr res = profilePlane_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PROFILEPLANESTARTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RectangularPatternFeature.h b/usr/autodesk/CPP/include/Fusion/Features/RectangularPatternFeature.h new file mode 100644 index 0000000..4952c34 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RectangularPatternFeature.h @@ -0,0 +1,357 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RECTANGULARPATTERNFEATURE_CPP__ +# define ADSK_FUSION_RECTANGULARPATTERNFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_RECTANGULARPATTERNFEATURE_API +# endif +#else +# define ADSK_FUSION_RECTANGULARPATTERNFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; + class PatternElements; +}} +namespace adsk { namespace core { + class ObjectCollection; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing rectangular pattern feature in a design. +class RectangularPatternFeature : public Feature { +public: + + /// Gets and sets the input entities. The collection can contain faces, features, bodies or occurrences. + /// All of the entities must be of a single type. For example, it can't contain features and occurrences + /// but only features or occurrences. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the first direction entity. + /// This can be a linear edge, construction axis, sketch line or rectangular pattern feature. + /// If a rectangular pattern feature is set, the directionOneEntity and directionTwoEntity properties return the same rectangular pattern feature. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr directionOneEntity() const; + bool directionOneEntity(const core::Ptr& value); + + /// Gets and sets the second direction entity. + /// This can be a linear edge, construction axis, sketch line or rectangular pattern feature. + /// If a rectangular pattern feature is set, the directionOneEntity and directionTwoEntity properties return the same rectangular pattern feature. + /// This can be null when not entity has been specified to control the second direction. In this case Fusion 360 will compute a default direction which is + /// 90 degrees to the direction one. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr directionTwoEntity() const; + bool directionTwoEntity(const core::Ptr& value); + + /// Returns a Vector3D indicating the positive direction of direction one. + core::Ptr directionOne() const; + + /// Returns a Vector3D indicating the positive direction of direction two. + core::Ptr directionTwo() const; + + /// Gets the number of instances in the first direction. + /// Edit the value through ModelParameter. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr quantityOne() const; + + /// Gets the number of instances in the second direction. + /// Edit the value through ModelParameter. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr quantityTwo() const; + + /// Gets the distance in the first direction. + /// Edit the value through ModelParameter. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr distanceOne() const; + + /// Gets the distance in the second direction. + /// Edit the value through ModelParameter. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr distanceTwo() const; + + /// Gets and sets if the pattern in direction one is in one direction or symmetric. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isSymmetricInDirectionOne() const; + bool isSymmetricInDirectionOne(bool value); + + /// Gets and sets if the pattern in direction two is in one direction or symmetric. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isSymmetricInDirectionTwo() const; + bool isSymmetricInDirectionTwo(bool value); + + /// Gets and sets how the distance between elements is computed. Is initialized to ExtentPatternDistanceType when a new + /// RectangularPatternFeatureInput has been created. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + PatternDistanceType patternDistanceType() const; + bool patternDistanceType(PatternDistanceType value); + + /// Gets and sets the ids of the patterns to suppress. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + std::vector suppressedElementsIds() const; + bool suppressedElementsIds(const std::vector& value); + + /// Gets the PatternElements collection that contains the elements created by this pattern. + core::Ptr patternElements() const; + + /// Get the features that were created for this pattern. + /// Returns null in the case where the feature is parametric. + core::Ptr resultFeatures() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the type of entities the pattern consists of. This can be used to help + /// determine the type of results that will be found in the pattern elements. + PatternEntityTypes patternEntityType() const; + + /// Gets and sets the compute option for this pattern feature. + /// This property only applies when patterning features and is ignored in the direct modeling environment. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + PatternComputeOptions patternComputeOption() const; + bool patternComputeOption(PatternComputeOptions value); + + ADSK_FUSION_RECTANGULARPATTERNFEATURE_API static const char* classType(); + ADSK_FUSION_RECTANGULARPATTERNFEATURE_API const char* objectType() const override; + ADSK_FUSION_RECTANGULARPATTERNFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RECTANGULARPATTERNFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual core::Base* directionOneEntity_raw() const = 0; + virtual bool directionOneEntity_raw(core::Base* value) = 0; + virtual core::Base* directionTwoEntity_raw() const = 0; + virtual bool directionTwoEntity_raw(core::Base* value) = 0; + virtual core::Vector3D* directionOne_raw() const = 0; + virtual core::Vector3D* directionTwo_raw() const = 0; + virtual ModelParameter* quantityOne_raw() const = 0; + virtual ModelParameter* quantityTwo_raw() const = 0; + virtual ModelParameter* distanceOne_raw() const = 0; + virtual ModelParameter* distanceTwo_raw() const = 0; + virtual bool isSymmetricInDirectionOne_raw() const = 0; + virtual bool isSymmetricInDirectionOne_raw(bool value) = 0; + virtual bool isSymmetricInDirectionTwo_raw() const = 0; + virtual bool isSymmetricInDirectionTwo_raw(bool value) = 0; + virtual PatternDistanceType patternDistanceType_raw() const = 0; + virtual bool patternDistanceType_raw(PatternDistanceType value) = 0; + virtual size_t* suppressedElementsIds_raw(size_t& return_size) const = 0; + virtual bool suppressedElementsIds_raw(const size_t* value, size_t value_size) = 0; + virtual PatternElements* patternElements_raw() const = 0; + virtual core::ObjectCollection* resultFeatures_raw() const = 0; + virtual RectangularPatternFeature* nativeObject_raw() const = 0; + virtual RectangularPatternFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual PatternEntityTypes patternEntityType_raw() const = 0; + virtual PatternComputeOptions patternComputeOption_raw() const = 0; + virtual bool patternComputeOption_raw(PatternComputeOptions value) = 0; +}; + +// Inline wrappers + +inline core::Ptr RectangularPatternFeature::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool RectangularPatternFeature::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr RectangularPatternFeature::directionOneEntity() const +{ + core::Ptr res = directionOneEntity_raw(); + return res; +} + +inline bool RectangularPatternFeature::directionOneEntity(const core::Ptr& value) +{ + return directionOneEntity_raw(value.get()); +} + +inline core::Ptr RectangularPatternFeature::directionTwoEntity() const +{ + core::Ptr res = directionTwoEntity_raw(); + return res; +} + +inline bool RectangularPatternFeature::directionTwoEntity(const core::Ptr& value) +{ + return directionTwoEntity_raw(value.get()); +} + +inline core::Ptr RectangularPatternFeature::directionOne() const +{ + core::Ptr res = directionOne_raw(); + return res; +} + +inline core::Ptr RectangularPatternFeature::directionTwo() const +{ + core::Ptr res = directionTwo_raw(); + return res; +} + +inline core::Ptr RectangularPatternFeature::quantityOne() const +{ + core::Ptr res = quantityOne_raw(); + return res; +} + +inline core::Ptr RectangularPatternFeature::quantityTwo() const +{ + core::Ptr res = quantityTwo_raw(); + return res; +} + +inline core::Ptr RectangularPatternFeature::distanceOne() const +{ + core::Ptr res = distanceOne_raw(); + return res; +} + +inline core::Ptr RectangularPatternFeature::distanceTwo() const +{ + core::Ptr res = distanceTwo_raw(); + return res; +} + +inline bool RectangularPatternFeature::isSymmetricInDirectionOne() const +{ + bool res = isSymmetricInDirectionOne_raw(); + return res; +} + +inline bool RectangularPatternFeature::isSymmetricInDirectionOne(bool value) +{ + return isSymmetricInDirectionOne_raw(value); +} + +inline bool RectangularPatternFeature::isSymmetricInDirectionTwo() const +{ + bool res = isSymmetricInDirectionTwo_raw(); + return res; +} + +inline bool RectangularPatternFeature::isSymmetricInDirectionTwo(bool value) +{ + return isSymmetricInDirectionTwo_raw(value); +} + +inline PatternDistanceType RectangularPatternFeature::patternDistanceType() const +{ + PatternDistanceType res = patternDistanceType_raw(); + return res; +} + +inline bool RectangularPatternFeature::patternDistanceType(PatternDistanceType value) +{ + return patternDistanceType_raw(value); +} + +inline std::vector RectangularPatternFeature::suppressedElementsIds() const +{ + std::vector res; + size_t s; + + size_t* p= suppressedElementsIds_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool RectangularPatternFeature::suppressedElementsIds(const std::vector& value) +{ + return suppressedElementsIds_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline core::Ptr RectangularPatternFeature::patternElements() const +{ + core::Ptr res = patternElements_raw(); + return res; +} + +inline core::Ptr RectangularPatternFeature::resultFeatures() const +{ + core::Ptr res = resultFeatures_raw(); + return res; +} + +inline core::Ptr RectangularPatternFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr RectangularPatternFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline PatternEntityTypes RectangularPatternFeature::patternEntityType() const +{ + PatternEntityTypes res = patternEntityType_raw(); + return res; +} + +inline PatternComputeOptions RectangularPatternFeature::patternComputeOption() const +{ + PatternComputeOptions res = patternComputeOption_raw(); + return res; +} + +inline bool RectangularPatternFeature::patternComputeOption(PatternComputeOptions value) +{ + return patternComputeOption_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RECTANGULARPATTERNFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RectangularPatternFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/RectangularPatternFeatureInput.h new file mode 100644 index 0000000..d6ade6e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RectangularPatternFeatureInput.h @@ -0,0 +1,314 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_CPP__ +# define ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a rectangular pattern +/// feature. +class RectangularPatternFeatureInput : public core::Base { +public: + + /// Gets and sets the input entities. The collection can contain faces, features, bodies or occurrences. + /// All of the entities must be of a single type. For example, it can't contain features and occurrences + /// but only features or occurrences. + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Sets all of the input required to define the pattern in the second direction. + /// directionTwoEntity : Specifies the entity used to define the second direction entity. This can be a linear edge, construction axis, sketch line or rectangular pattern feature. + /// If a rectangular pattern feature is set, the directionOneEntity and directionTwoEntity properties return the same rectangular pattern feature. + /// This argument can be null to indicate that the default second direction is to be used, which is 90 degrees to the first direction. + /// quantityTwo : Specifies the number of instances in the second direction. + /// distanceTwo : Specifies the distance in the second direction. How this value is used depends on the value of the PatternDistanceType property. + /// If the value is ExtentPatternDistanceType then it defines the total distance of the pattern. + /// If the value is SpacingPatternDistanceType then it defines the distance between each element. + /// Returns true if it was successful. + bool setDirectionTwo(const core::Ptr& directionTwoEntity, const core::Ptr& quantityTwo, const core::Ptr& distanceTwo); + + /// Gets and sets the first direction entity. + /// This can be a linear edge, construction axis, sketch line or rectangular pattern feature. + /// If a rectangular pattern feature is set, the directionOneEntity and directionTwoEntity properties return the same rectangular pattern feature. + core::Ptr directionOneEntity() const; + bool directionOneEntity(const core::Ptr& value); + + /// Gets and sets the second direction entity. + /// This can be a linear edge, construction axis, sketch line or rectangular pattern feature. + /// If a rectangular pattern feature is set, the directionOneEntity and directionTwoEntity properties return the same rectangular pattern feature. + core::Ptr directionTwoEntity() const; + bool directionTwoEntity(const core::Ptr& value); + + /// Gets and sets the number of instances in the first direction. + core::Ptr quantityOne() const; + bool quantityOne(const core::Ptr& value); + + /// Gets and sets the number of instances in the second direction. + core::Ptr quantityTwo() const; + bool quantityTwo(const core::Ptr& value); + + /// Gets and sets the distance in the first direction. + core::Ptr distanceOne() const; + bool distanceOne(const core::Ptr& value); + + /// Gets and sets the distance in the second direction. + core::Ptr distanceTwo() const; + bool distanceTwo(const core::Ptr& value); + + /// Returns a Vector3D indicating the positive direction of direction one. + core::Ptr directionOne() const; + + /// Returns a Vector3D indicating the positive direction of direction two. + core::Ptr directionTwo() const; + + /// Gets and sets if the pattern in direction one is in one direction or symmetric. + bool isSymmetricInDirectionOne() const; + bool isSymmetricInDirectionOne(bool value); + + /// Gets and sets if the pattern in direction two is in one direction or symmetric. + bool isSymmetricInDirectionTwo() const; + bool isSymmetricInDirectionTwo(bool value); + + /// Gets and sets how the distance between elements is computed. + PatternDistanceType patternDistanceType() const; + bool patternDistanceType(PatternDistanceType value); + + /// Gets and sets the compute option when patterning features. The default value for this is AdjustPatternCompute. + /// This property only applies when patterning features and is ignored in the direct modeling environment. + PatternComputeOptions patternComputeOption() const; + bool patternComputeOption(PatternComputeOptions value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual bool setDirectionTwo_raw(core::Base* directionTwoEntity, core::ValueInput* quantityTwo, core::ValueInput* distanceTwo) = 0; + virtual core::Base* directionOneEntity_raw() const = 0; + virtual bool directionOneEntity_raw(core::Base* value) = 0; + virtual core::Base* directionTwoEntity_raw() const = 0; + virtual bool directionTwoEntity_raw(core::Base* value) = 0; + virtual core::ValueInput* quantityOne_raw() const = 0; + virtual bool quantityOne_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* quantityTwo_raw() const = 0; + virtual bool quantityTwo_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* distanceOne_raw() const = 0; + virtual bool distanceOne_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* distanceTwo_raw() const = 0; + virtual bool distanceTwo_raw(core::ValueInput* value) = 0; + virtual core::Vector3D* directionOne_raw() const = 0; + virtual core::Vector3D* directionTwo_raw() const = 0; + virtual bool isSymmetricInDirectionOne_raw() const = 0; + virtual bool isSymmetricInDirectionOne_raw(bool value) = 0; + virtual bool isSymmetricInDirectionTwo_raw() const = 0; + virtual bool isSymmetricInDirectionTwo_raw(bool value) = 0; + virtual PatternDistanceType patternDistanceType_raw() const = 0; + virtual bool patternDistanceType_raw(PatternDistanceType value) = 0; + virtual PatternComputeOptions patternComputeOption_raw() const = 0; + virtual bool patternComputeOption_raw(PatternComputeOptions value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr RectangularPatternFeatureInput::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline bool RectangularPatternFeatureInput::setDirectionTwo(const core::Ptr& directionTwoEntity, const core::Ptr& quantityTwo, const core::Ptr& distanceTwo) +{ + bool res = setDirectionTwo_raw(directionTwoEntity.get(), quantityTwo.get(), distanceTwo.get()); + return res; +} + +inline core::Ptr RectangularPatternFeatureInput::directionOneEntity() const +{ + core::Ptr res = directionOneEntity_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::directionOneEntity(const core::Ptr& value) +{ + return directionOneEntity_raw(value.get()); +} + +inline core::Ptr RectangularPatternFeatureInput::directionTwoEntity() const +{ + core::Ptr res = directionTwoEntity_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::directionTwoEntity(const core::Ptr& value) +{ + return directionTwoEntity_raw(value.get()); +} + +inline core::Ptr RectangularPatternFeatureInput::quantityOne() const +{ + core::Ptr res = quantityOne_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::quantityOne(const core::Ptr& value) +{ + return quantityOne_raw(value.get()); +} + +inline core::Ptr RectangularPatternFeatureInput::quantityTwo() const +{ + core::Ptr res = quantityTwo_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::quantityTwo(const core::Ptr& value) +{ + return quantityTwo_raw(value.get()); +} + +inline core::Ptr RectangularPatternFeatureInput::distanceOne() const +{ + core::Ptr res = distanceOne_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::distanceOne(const core::Ptr& value) +{ + return distanceOne_raw(value.get()); +} + +inline core::Ptr RectangularPatternFeatureInput::distanceTwo() const +{ + core::Ptr res = distanceTwo_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::distanceTwo(const core::Ptr& value) +{ + return distanceTwo_raw(value.get()); +} + +inline core::Ptr RectangularPatternFeatureInput::directionOne() const +{ + core::Ptr res = directionOne_raw(); + return res; +} + +inline core::Ptr RectangularPatternFeatureInput::directionTwo() const +{ + core::Ptr res = directionTwo_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::isSymmetricInDirectionOne() const +{ + bool res = isSymmetricInDirectionOne_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::isSymmetricInDirectionOne(bool value) +{ + return isSymmetricInDirectionOne_raw(value); +} + +inline bool RectangularPatternFeatureInput::isSymmetricInDirectionTwo() const +{ + bool res = isSymmetricInDirectionTwo_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::isSymmetricInDirectionTwo(bool value) +{ + return isSymmetricInDirectionTwo_raw(value); +} + +inline PatternDistanceType RectangularPatternFeatureInput::patternDistanceType() const +{ + PatternDistanceType res = patternDistanceType_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::patternDistanceType(PatternDistanceType value) +{ + return patternDistanceType_raw(value); +} + +inline PatternComputeOptions RectangularPatternFeatureInput::patternComputeOption() const +{ + PatternComputeOptions res = patternComputeOption_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::patternComputeOption(PatternComputeOptions value) +{ + return patternComputeOption_raw(value); +} + +inline core::Ptr RectangularPatternFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool RectangularPatternFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RECTANGULARPATTERNFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RectangularPatternFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/RectangularPatternFeatures.h new file mode 100644 index 0000000..5be2f44 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RectangularPatternFeatures.h @@ -0,0 +1,144 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RECTANGULARPATTERNFEATURES_CPP__ +# define ADSK_FUSION_RECTANGULARPATTERNFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_RECTANGULARPATTERNFEATURES_API +# endif +#else +# define ADSK_FUSION_RECTANGULARPATTERNFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class RectangularPatternFeature; + class RectangularPatternFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing rectangular pattern features in a component +/// and supports the ability to create new rectangular pattern features. +class RectangularPatternFeatures : public core::Base { +public: + + /// Function that returns the specified rectangular pattern feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of rectangular pattern features in the collection. + size_t count() const; + + /// Creates a RectangularPatternFeatureInput object. Use properties and methods on this object + /// to define the rectangular pattern you want to create and then use the Add method, passing in + /// the RectangularPatternFeatureInput object. + /// inputEntities : The collection can contain faces, features, bodies or occurrences. + /// All of the entities must be of a single type. For example, it can't contain features and occurrences + /// but only features or occurrences. + /// directionOneEntity : Specifies the entity used to define the first direction entity. This can be a linear edge, construction axis, sketch line or rectangular pattern feature. + /// If a rectangular pattern feature is set, the directionOneEntity and directionTwoEntity properties return the same rectangular pattern feature. + /// quantityOne : Specifies the number of instances in the first direction. + /// distanceOne : Specifies the distance in the first direction. How this value is used depends on the value of the PatternDistanceType property. A + /// negative value can be used to change the direction. + /// If the value is ExtentPatternDistanceType then it defines the total distance of the pattern. + /// If the value is SpacingPatternDistanceType then it defines the distance between each element. + /// patternDistanceType : Specifies how the distance between elements is computed. + /// Returns the newly created RectangularPatternFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& inputEntities, const core::Ptr& directionOneEntity, const core::Ptr& quantityOne, const core::Ptr& distanceOne, PatternDistanceType patternDistanceType) const; + + /// Creates a new rectangular pattern feature. + /// input : A RectangularPatternFeatureInput object that defines the desired rectangular pattern. Use the createInput + /// method to create a new RectangularPatternFeatureInput object and then use methods on it + /// (the RectangularPatternFeatureInput object) to define the rectangular pattern. + /// Returns the newly created RectangularPatternFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified rectangular pattern feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef RectangularPatternFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_RECTANGULARPATTERNFEATURES_API static const char* classType(); + ADSK_FUSION_RECTANGULARPATTERNFEATURES_API const char* objectType() const override; + ADSK_FUSION_RECTANGULARPATTERNFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RECTANGULARPATTERNFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual RectangularPatternFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual RectangularPatternFeatureInput* createInput_raw(core::ObjectCollection* inputEntities, core::Base* directionOneEntity, core::ValueInput* quantityOne, core::ValueInput* distanceOne, PatternDistanceType patternDistanceType) const = 0; + virtual RectangularPatternFeature* add_raw(RectangularPatternFeatureInput* input) = 0; + virtual RectangularPatternFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr RectangularPatternFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t RectangularPatternFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr RectangularPatternFeatures::createInput(const core::Ptr& inputEntities, const core::Ptr& directionOneEntity, const core::Ptr& quantityOne, const core::Ptr& distanceOne, PatternDistanceType patternDistanceType) const +{ + core::Ptr res = createInput_raw(inputEntities.get(), directionOneEntity.get(), quantityOne.get(), distanceOne.get(), patternDistanceType); + return res; +} + +inline core::Ptr RectangularPatternFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr RectangularPatternFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void RectangularPatternFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RECTANGULARPATTERNFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RefoldFeature.h b/usr/autodesk/CPP/include/Fusion/Features/RefoldFeature.h new file mode 100644 index 0000000..5b80cd7 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RefoldFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REFOLDFEATURE_CPP__ +# define ADSK_FUSION_REFOLDFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_REFOLDFEATURE_API +# endif +#else +# define ADSK_FUSION_REFOLDFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing refold feature in a design. +class RefoldFeature : public Feature { +public: + + ADSK_FUSION_REFOLDFEATURE_API static const char* classType(); + ADSK_FUSION_REFOLDFEATURE_API const char* objectType() const override; + ADSK_FUSION_REFOLDFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REFOLDFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REFOLDFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RefoldFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/RefoldFeatures.h new file mode 100644 index 0000000..38afe16 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RefoldFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REFOLDFEATURES_CPP__ +# define ADSK_FUSION_REFOLDFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_REFOLDFEATURES_API +# endif +#else +# define ADSK_FUSION_REFOLDFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class RefoldFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing refold features in a design. +class RefoldFeatures : public core::Base { +public: + + /// Function that returns the specified refold feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of refold features in the collection. + size_t count() const; + + /// Function that returns the specified refold feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef RefoldFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_REFOLDFEATURES_API static const char* classType(); + ADSK_FUSION_REFOLDFEATURES_API const char* objectType() const override; + ADSK_FUSION_REFOLDFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REFOLDFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual RefoldFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual RefoldFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr RefoldFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t RefoldFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr RefoldFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void RefoldFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REFOLDFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RemoveFeature.h b/usr/autodesk/CPP/include/Fusion/Features/RemoveFeature.h new file mode 100644 index 0000000..44c0e3d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RemoveFeature.h @@ -0,0 +1,91 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REMOVEFEATURE_CPP__ +# define ADSK_FUSION_REMOVEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_REMOVEFEATURE_API +# endif +#else +# define ADSK_FUSION_REMOVEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing Remove feature in a design. +class RemoveFeature : public Feature { +public: + + /// Gets and sets the body or component occurrence to remove. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr itemToRemove() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_REMOVEFEATURE_API static const char* classType(); + ADSK_FUSION_REMOVEFEATURE_API const char* objectType() const override; + ADSK_FUSION_REMOVEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REMOVEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* itemToRemove_raw() const = 0; + virtual RemoveFeature* nativeObject_raw() const = 0; + virtual RemoveFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr RemoveFeature::itemToRemove() const +{ + core::Ptr res = itemToRemove_raw(); + return res; +} + +inline core::Ptr RemoveFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr RemoveFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REMOVEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RemoveFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/RemoveFeatures.h new file mode 100644 index 0000000..2625fa6 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RemoveFeatures.h @@ -0,0 +1,113 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REMOVEFEATURES_CPP__ +# define ADSK_FUSION_REMOVEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_REMOVEFEATURES_API +# endif +#else +# define ADSK_FUSION_REMOVEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class RemoveFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Remove features in a component +/// and supports the ability to create new Remove features. +class RemoveFeatures : public core::Base { +public: + + /// Function that returns the specified Remove feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified remove feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of Remove features in the collection. + size_t count() const; + + /// Creates a new Remove feature. + /// itemToRemove : A single body (solid or surface) or component occurrence to remove. + /// Returns the newly created RemoveFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& itemToRemove); + + typedef RemoveFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_REMOVEFEATURES_API static const char* classType(); + ADSK_FUSION_REMOVEFEATURES_API const char* objectType() const override; + ADSK_FUSION_REMOVEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REMOVEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual RemoveFeature* item_raw(size_t index) const = 0; + virtual RemoveFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual RemoveFeature* add_raw(core::Base* itemToRemove) = 0; +}; + +// Inline wrappers + +inline core::Ptr RemoveFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr RemoveFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t RemoveFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr RemoveFeatures::add(const core::Ptr& itemToRemove) +{ + core::Ptr res = add_raw(itemToRemove.get()); + return res; +} + +template inline void RemoveFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REMOVEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ReplaceFaceFeature.h b/usr/autodesk/CPP/include/Fusion/Features/ReplaceFaceFeature.h new file mode 100644 index 0000000..c360d1b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ReplaceFaceFeature.h @@ -0,0 +1,130 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REPLACEFACEFEATURE_CPP__ +# define ADSK_FUSION_REPLACEFACEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_REPLACEFACEFEATURE_API +# endif +#else +# define ADSK_FUSION_REPLACEFACEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing replace face feature in a design. +class ReplaceFaceFeature : public Feature { +public: + + /// Method that sets faces to replace. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// sourceFaces : The collection can contain the faces from a solid and/or from features. All the faces must be on the same body. + /// isTangentChain : A boolean value for setting whether or not faces that are tangentially connected to + /// the input faces (if any) will also be included. A value of true indicates that tangent + /// faces will be included. + /// Returns true if successful. + bool setInputEntities(const core::Ptr& sourceFaces, bool isTangentChain); + + /// Gets and sets the entities that define the target faces. The new faces must completely intersect the part. + /// The collection can contain the surface faces, surface bodies and construction planes. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr targetFaces() const; + bool targetFaces(const core::Ptr& value); + + /// Gets if any faces that are tangentially connected to any of + /// the input faces will also be included in setting InputEntities. + bool isTangentChain() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_REPLACEFACEFEATURE_API static const char* classType(); + ADSK_FUSION_REPLACEFACEFEATURE_API const char* objectType() const override; + ADSK_FUSION_REPLACEFACEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REPLACEFACEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setInputEntities_raw(core::ObjectCollection* sourceFaces, bool isTangentChain) = 0; + virtual core::Base* targetFaces_raw() const = 0; + virtual bool targetFaces_raw(core::Base* value) = 0; + virtual bool isTangentChain_raw() const = 0; + virtual ReplaceFaceFeature* nativeObject_raw() const = 0; + virtual ReplaceFaceFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline bool ReplaceFaceFeature::setInputEntities(const core::Ptr& sourceFaces, bool isTangentChain) +{ + bool res = setInputEntities_raw(sourceFaces.get(), isTangentChain); + return res; +} + +inline core::Ptr ReplaceFaceFeature::targetFaces() const +{ + core::Ptr res = targetFaces_raw(); + return res; +} + +inline bool ReplaceFaceFeature::targetFaces(const core::Ptr& value) +{ + return targetFaces_raw(value.get()); +} + +inline bool ReplaceFaceFeature::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline core::Ptr ReplaceFaceFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ReplaceFaceFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REPLACEFACEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ReplaceFaceFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/ReplaceFaceFeatureInput.h new file mode 100644 index 0000000..694b825 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ReplaceFaceFeatureInput.h @@ -0,0 +1,133 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REPLACEFACEFEATUREINPUT_CPP__ +# define ADSK_FUSION_REPLACEFACEFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_REPLACEFACEFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_REPLACEFACEFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a replace face feature. +class ReplaceFaceFeatureInput : public core::Base { +public: + + /// Gets and sets the entities that define the source faces to perform replace. + /// The collection can contain the faces from a solid and/or from features. All the faces must be on the same body. + core::Ptr sourceFaces() const; + bool sourceFaces(const core::Ptr& value); + + /// Gets and sets the entities that define the target faces. The new faces must completely intersect the part. + /// The collection can contain the surface faces, surface bodies and construction planes. + core::Ptr targetFaces() const; + bool targetFaces(const core::Ptr& value); + + /// Gets and sets if any faces that are tangentially connected to any of + /// the input faces will also be included in setting InputEntities. It defaults to true. + bool isTangentChain() const; + bool isTangentChain(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_REPLACEFACEFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_REPLACEFACEFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_REPLACEFACEFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REPLACEFACEFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* sourceFaces_raw() const = 0; + virtual bool sourceFaces_raw(core::ObjectCollection* value) = 0; + virtual core::Base* targetFaces_raw() const = 0; + virtual bool targetFaces_raw(core::Base* value) = 0; + virtual bool isTangentChain_raw() const = 0; + virtual bool isTangentChain_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ReplaceFaceFeatureInput::sourceFaces() const +{ + core::Ptr res = sourceFaces_raw(); + return res; +} + +inline bool ReplaceFaceFeatureInput::sourceFaces(const core::Ptr& value) +{ + return sourceFaces_raw(value.get()); +} + +inline core::Ptr ReplaceFaceFeatureInput::targetFaces() const +{ + core::Ptr res = targetFaces_raw(); + return res; +} + +inline bool ReplaceFaceFeatureInput::targetFaces(const core::Ptr& value) +{ + return targetFaces_raw(value.get()); +} + +inline bool ReplaceFaceFeatureInput::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline bool ReplaceFaceFeatureInput::isTangentChain(bool value) +{ + return isTangentChain_raw(value); +} + +inline core::Ptr ReplaceFaceFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool ReplaceFaceFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REPLACEFACEFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ReplaceFaceFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/ReplaceFaceFeatures.h new file mode 100644 index 0000000..00f1d4b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ReplaceFaceFeatures.h @@ -0,0 +1,139 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REPLACEFACEFEATURES_CPP__ +# define ADSK_FUSION_REPLACEFACEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_REPLACEFACEFEATURES_API +# endif +#else +# define ADSK_FUSION_REPLACEFACEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ReplaceFaceFeature; + class ReplaceFaceFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing replace face features in a component +/// and supports the ability to create new replace face features. +class ReplaceFaceFeatures : public core::Base { +public: + + /// Function that returns the specified replace face feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of replace face features in the collection. + size_t count() const; + + /// Creates a ReplaceFaceFeatureInput object. Use properties and methods on this object + /// to define the replace face you want to create and then use the Add method, passing in + /// the ReplaceFaceFeatureInput object. + /// sourceFaces : Input the entities that define the source faces (the faces to be replaced). + /// The collection can contain the faces from a solid and/or features. All the faces must be on the same body. + /// isTangentChain : A boolean value for setting whether or not faces that are tangentially connected to + /// the input faces (if any) will also be included. A value of true indicates that tangent + /// faces will be included. + /// targetFaces : Input the entities that define the target faces. The new faces must completely intersect the part. + /// The collection can contain the surface faces, surface bodies and construction planes. + /// Returns the newly created ReplaceFaceFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& sourceFaces, bool isTangentChain, const core::Ptr& targetFaces) const; + + /// Creates a new replace face feature. + /// input : A ReplaceFaceFeatureInput object that defines the desired replace face. Use the createInput + /// method to create a new ReplaceFaceFeatureInput object and then use methods on it + /// (the ReplaceFaceFeatureInput object) to define the replace face. + /// Returns the newly created ReplaceFaceFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified replace face feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef ReplaceFaceFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_REPLACEFACEFEATURES_API static const char* classType(); + ADSK_FUSION_REPLACEFACEFEATURES_API const char* objectType() const override; + ADSK_FUSION_REPLACEFACEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REPLACEFACEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ReplaceFaceFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual ReplaceFaceFeatureInput* createInput_raw(core::ObjectCollection* sourceFaces, bool isTangentChain, core::Base* targetFaces) const = 0; + virtual ReplaceFaceFeature* add_raw(ReplaceFaceFeatureInput* input) = 0; + virtual ReplaceFaceFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ReplaceFaceFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ReplaceFaceFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ReplaceFaceFeatures::createInput(const core::Ptr& sourceFaces, bool isTangentChain, const core::Ptr& targetFaces) const +{ + core::Ptr res = createInput_raw(sourceFaces.get(), isTangentChain, targetFaces.get()); + return res; +} + +inline core::Ptr ReplaceFaceFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ReplaceFaceFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void ReplaceFaceFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REPLACEFACEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ReverseNormalFeature.h b/usr/autodesk/CPP/include/Fusion/Features/ReverseNormalFeature.h new file mode 100644 index 0000000..b24f7b5 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ReverseNormalFeature.h @@ -0,0 +1,102 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REVERSENORMALFEATURE_CPP__ +# define ADSK_FUSION_REVERSENORMALFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_REVERSENORMALFEATURE_API +# endif +#else +# define ADSK_FUSION_REVERSENORMALFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing Reverse Normal feature in a design. +class ReverseNormalFeature : public Feature { +public: + + /// Gets and sets the surface bodies (open BRepBodies) whose faces normals are to be reversed. + /// All faces of the input surface bodies get reversed. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr surfaces() const; + bool surfaces(const core::Ptr& value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_REVERSENORMALFEATURE_API static const char* classType(); + ADSK_FUSION_REVERSENORMALFEATURE_API const char* objectType() const override; + ADSK_FUSION_REVERSENORMALFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REVERSENORMALFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* surfaces_raw() const = 0; + virtual bool surfaces_raw(core::ObjectCollection* value) = 0; + virtual ReverseNormalFeature* nativeObject_raw() const = 0; + virtual ReverseNormalFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ReverseNormalFeature::surfaces() const +{ + core::Ptr res = surfaces_raw(); + return res; +} + +inline bool ReverseNormalFeature::surfaces(const core::Ptr& value) +{ + return surfaces_raw(value.get()); +} + +inline core::Ptr ReverseNormalFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ReverseNormalFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REVERSENORMALFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ReverseNormalFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/ReverseNormalFeatures.h new file mode 100644 index 0000000..0f5988b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ReverseNormalFeatures.h @@ -0,0 +1,117 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REVERSENORMALFEATURES_CPP__ +# define ADSK_FUSION_REVERSENORMALFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_REVERSENORMALFEATURES_API +# endif +#else +# define ADSK_FUSION_REVERSENORMALFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ReverseNormalFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Reverse Normal features in a component +/// and supports the ability to create new Reverse Normal features. +class ReverseNormalFeatures : public core::Base { +public: + + /// Function that returns the specified Reverse Normal feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified reverse normal feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of Reverse Normal features in the collection. + size_t count() const; + + /// Creates a new Reverse Normal feature. + /// surfaces : One or more surface bodies (open BRepBodies) containing the faces whose normals are to be reversed. + /// All faces of the input surface bodies get reversed. + /// Returns the newly created ReverseNormalFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& surfaces); + + typedef ReverseNormalFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_REVERSENORMALFEATURES_API static const char* classType(); + ADSK_FUSION_REVERSENORMALFEATURES_API const char* objectType() const override; + ADSK_FUSION_REVERSENORMALFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REVERSENORMALFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ReverseNormalFeature* item_raw(size_t index) const = 0; + virtual ReverseNormalFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual ReverseNormalFeature* add_raw(core::ObjectCollection* surfaces) = 0; +}; + +// Inline wrappers + +inline core::Ptr ReverseNormalFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr ReverseNormalFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t ReverseNormalFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ReverseNormalFeatures::add(const core::Ptr& surfaces) +{ + core::Ptr res = add_raw(surfaces.get()); + return res; +} + +template inline void ReverseNormalFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REVERSENORMALFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RevolveFeature.h b/usr/autodesk/CPP/include/Fusion/Features/RevolveFeature.h new file mode 100644 index 0000000..b791a2c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RevolveFeature.h @@ -0,0 +1,326 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REVOLVEFEATURE_CPP__ +# define ADSK_FUSION_REVOLVEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_REVOLVEFEATURE_API +# endif +#else +# define ADSK_FUSION_REVOLVEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepFaces; + class ExtentDefinition; + class Occurrence; +}} +namespace adsk { namespace core { + class ValueInput; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing revolve feature in a design. +class RevolveFeature : public Feature { +public: + + /// Gets and sets the profiles or planar faces used to define the shape of the revolve. + /// This property can return or be set with a single Profile, a single planar face, or + /// an ObjectCollection consisting of multiple profiles and planar faces. When an + /// ObjectCollection is used all of the profiles and faces must be co-planar. + /// When setting this property of a surface (non-solid) extrusion, you can use the + /// createOpenProfile and createBRepEdgeProfile methods of the Component object to create + /// an open profile. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// This property returns null in the case where the feature is non-parametric. + core::Ptr profile() const; + bool profile(const core::Ptr& value); + + /// Gets and sets the entity used to define the axis of revolution. + /// The axis can be a sketch line, construction axis, or linear edge. If it is not in + /// the same plane as the profile, it is projected onto the profile plane. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr axis() const; + bool axis(const core::Ptr& value); + + /// Gets and sets the type of operation performed by the revolve. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets the definition object that is defining the extent of the revolve. Modifying the + /// definition object will cause the revolve to recompute. Various types of objects can + /// be returned depending on the type of extent currently defined for the revolve. + /// This property returns nothing in the case where the feature is non-parametric. + core::Ptr extentDefinition() const; + + /// Defines the extent of the revolution to be at a defined angle. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// isSymmetric : Boolean that specifies if the extent is symmetric or not. + /// angle : ValueInput object that defines the angle. This can be a string or a value. If + /// it's a string it is interpreted using the current document units and can include + /// equations. For example all of the following are valid as long as they result in + /// angle units; "45", "45 deg", "a1 / 2". If a value is input it is interpreted + /// as radians. + /// If isSymmetric is false a positive or negative angle can be + /// used to control the direction. If isSymmetric is true, the angle is the extent in one + /// direction so the entire angle of the revolution will be twice the specified angle. + /// Use an angle of 360 deg or 2 pi radians to create a full revolve. + /// Returns true if successful + bool setAngleExtent(bool isSymmetric, const core::Ptr& angle); + + /// Changes the extent of the revolve to be defined as a two sided angle extent. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// angleOne : ValueInput object that defines the first angle. This can be a string or a value. If + /// it's a string it is interpreted using the current document units and can include + /// equations. For example all of the following are valid as long as they result in + /// angle units; "45", "45 deg", "a1 / 2". If a value is input it is interpreted + /// as radians. + /// angleTwo : ValueInput object that defines the second angle. This can be a string or a value. If + /// it's a string it is interpreted using the current document units and can include + /// equations. For example all of the following are valid as long as they result in + /// angle units; "45", "45 deg", "a1 / 2". If a value is input it is interpreted + /// as radians. + /// Returns true if successful + bool setTwoSideAngleExtent(const core::Ptr& angleOne, const core::Ptr& angleTwo); + + /// Changes the extent of the revolve to be from the sketch plane to the specified "to" face. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// toEntity : The entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For a revolve it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// directionHint : Specifies the direction of the revolve. + /// Returns true if successful. + bool setOneSideToExtent(const core::Ptr& toEntity, const core::Ptr& directionHint = NULL); + + /// Changes the extent of the revolve to be defined as a two sided to extent. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// toEntityOne : The first entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For a revolve it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// toEntityTwo : The second entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For a revolve it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// Returns true if successful + bool setTwoSidesToExtent(const core::Ptr& toEntityOne, const core::Ptr& toEntityTwo); + + /// Property that returns the set of faces that cap one end of the revolve and are coincident + /// with the sketch plane. In the case of a symmetric revolve these faces are the ones on the + /// positive normal side of the sketch plane. In the case where there aren't any start faces, + /// this property will return null. + core::Ptr startFaces() const; + + /// Property that returns the set of faces that cap the end of the revolve opposite the + /// start faces. In the case where there aren't any start faces, this property will return null. + core::Ptr endFaces() const; + + /// Property that returns all of the faces created around the perimeter of the feature. + core::Ptr sideFaces() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Indicates if this feature was initially created as a solid or a surface. + bool isSolid() const; + + /// Gets and sets the list of bodies that will participate in the feature when the operation is a cut or intersection. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + std::vector> participantBodies() const; + bool participantBodies(const std::vector>& value); + + ADSK_FUSION_REVOLVEFEATURE_API static const char* classType(); + ADSK_FUSION_REVOLVEFEATURE_API const char* objectType() const override; + ADSK_FUSION_REVOLVEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REVOLVEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* profile_raw() const = 0; + virtual bool profile_raw(core::Base* value) = 0; + virtual core::Base* axis_raw() const = 0; + virtual bool axis_raw(core::Base* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual ExtentDefinition* extentDefinition_raw() const = 0; + virtual bool setAngleExtent_raw(bool isSymmetric, core::ValueInput* angle) = 0; + virtual bool setTwoSideAngleExtent_raw(core::ValueInput* angleOne, core::ValueInput* angleTwo) = 0; + virtual bool setOneSideToExtent_raw(core::Base* toEntity, core::Vector3D* directionHint) = 0; + virtual bool setTwoSidesToExtent_raw(core::Base* toEntityOne, core::Base* toEntityTwo) = 0; + virtual BRepFaces* startFaces_raw() const = 0; + virtual BRepFaces* endFaces_raw() const = 0; + virtual BRepFaces* sideFaces_raw() const = 0; + virtual RevolveFeature* nativeObject_raw() const = 0; + virtual RevolveFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual bool isSolid_raw() const = 0; + virtual BRepBody** participantBodies_raw(size_t& return_size) const = 0; + virtual bool participantBodies_raw(BRepBody** value, size_t value_size) = 0; +}; + +// Inline wrappers + +inline core::Ptr RevolveFeature::profile() const +{ + core::Ptr res = profile_raw(); + return res; +} + +inline bool RevolveFeature::profile(const core::Ptr& value) +{ + return profile_raw(value.get()); +} + +inline core::Ptr RevolveFeature::axis() const +{ + core::Ptr res = axis_raw(); + return res; +} + +inline bool RevolveFeature::axis(const core::Ptr& value) +{ + return axis_raw(value.get()); +} + +inline FeatureOperations RevolveFeature::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool RevolveFeature::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr RevolveFeature::extentDefinition() const +{ + core::Ptr res = extentDefinition_raw(); + return res; +} + +inline bool RevolveFeature::setAngleExtent(bool isSymmetric, const core::Ptr& angle) +{ + bool res = setAngleExtent_raw(isSymmetric, angle.get()); + return res; +} + +inline bool RevolveFeature::setTwoSideAngleExtent(const core::Ptr& angleOne, const core::Ptr& angleTwo) +{ + bool res = setTwoSideAngleExtent_raw(angleOne.get(), angleTwo.get()); + return res; +} + +inline bool RevolveFeature::setOneSideToExtent(const core::Ptr& toEntity, const core::Ptr& directionHint) +{ + bool res = setOneSideToExtent_raw(toEntity.get(), directionHint.get()); + return res; +} + +inline bool RevolveFeature::setTwoSidesToExtent(const core::Ptr& toEntityOne, const core::Ptr& toEntityTwo) +{ + bool res = setTwoSidesToExtent_raw(toEntityOne.get(), toEntityTwo.get()); + return res; +} + +inline core::Ptr RevolveFeature::startFaces() const +{ + core::Ptr res = startFaces_raw(); + return res; +} + +inline core::Ptr RevolveFeature::endFaces() const +{ + core::Ptr res = endFaces_raw(); + return res; +} + +inline core::Ptr RevolveFeature::sideFaces() const +{ + core::Ptr res = sideFaces_raw(); + return res; +} + +inline core::Ptr RevolveFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr RevolveFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline bool RevolveFeature::isSolid() const +{ + bool res = isSolid_raw(); + return res; +} + +inline std::vector> RevolveFeature::participantBodies() const +{ + std::vector> res; + size_t s; + + BRepBody** p= participantBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool RevolveFeature::participantBodies(const std::vector>& value) +{ + BRepBody** value_ = new BRepBody*[value.size()]; + for(size_t i=0; i + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REVOLVEFEATUREINPUT_CPP__ +# define ADSK_FUSION_REVOLVEFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_REVOLVEFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_REVOLVEFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepBody; + class Occurrence; +}} +namespace adsk { namespace core { + class ValueInput; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a revolve +/// feature. +class RevolveFeatureInput : public core::Base { +public: + + /// Gets and sets the profiles or planar faces used to define the shape of the revolve. + /// This property can return or be set with a single Profile, a single planar face, or + /// an ObjectCollection consisting of multiple profiles and planar faces. When an + /// ObjectCollection is used all of the profiles and faces must be co-planar. + /// This property returns null in the case where the feature is non-parametric. + /// To create a surface (non-solid) revolution, you can use the createOpenProfile and createBRepEdgeProfile + /// methods of the Component object to create an open profile. The isSolid property of the + /// RevolveFeatureInput property must also be False. + core::Ptr profile() const; + bool profile(const core::Ptr& value); + + /// Gets and sets the type of operation performed by the revolve. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets and sets the entity used to define the axis of revolution. + /// The axis can be a sketch line, construction axis, or linear edge. If it is not in + /// the same plane as the profile, it is projected onto the profile plane. + core::Ptr axis() const; + bool axis(const core::Ptr& value); + + /// Defines the extent of the revolution to be at a specified angle. + /// An angle and whether the extent is symmetric or only in one direction + /// is specified. If it's not symmetric a positive or negative angle can be + /// used to control the direction. If symmetric, the angle is the angle on one + /// side so the entire angle of the revolution will be twice the specified angle. + /// Use an angle of 360 deg or 2 pi radians to create a full revolve. + /// isSymmetric : Set to 'true' for a revolve symmetrical about the profile plane + /// angle : The ValueInput object that defines the angle of the revolution + /// Returns true if successful + bool setAngleExtent(bool isSymmetric, const core::Ptr& angle); + + /// Defines the angle of the revolve to be to applied to both sides of the profile + /// at the specified angles. + /// angleOne : The ValueInput object that defines the angle for the first side of the revolution + /// angleTwo : The ValueInput object that defines the angle for the second side of the revolution + /// Returns true if successful + bool setTwoSideAngleExtent(const core::Ptr& angleOne, const core::Ptr& angleTwo); + + /// Defines the extent of the revolve to be from the sketch or profile plane to the + /// specified "To" face. + /// toEntity : The entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For a revolve it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// directionHint : Specifies the direction of the revolve. + /// Returns true if successful. + bool setOneSideToExtent(const core::Ptr& toEntity, const core::Ptr& directionHint = NULL); + + /// Defines the extents of the revolve to be from the sketch plane to specified + /// faces in both directions. If the matchShape argument is true, the faces to revolve to + /// are extended to fully intersect the revolve. + /// toEntityOne : The first entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For a revolve it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// toEntityTwo : The second entity that defines the "to" extent. The valid types of entities can vary depending on + /// the type of feature this is being used with. For a revolve it can be a BRepBody, BRepFace, + /// BRepVertex, ConstructionPlane, or ConstructionPoint. + /// Returns true if successful. + bool setTwoSideToExtent(const core::Ptr& toEntityOne, const core::Ptr& toEntityTwo); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs to be + /// specified when the Revolve is created based on geometry (e.g. a profile and/or face(s)) + /// in another component AND (the Revolve) is not in the root component. + /// The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// Specifies if the revolution should be created as a solid or surface. If + /// it's a surface then there aren't any end caps and it's open. This is + /// initialized to true so a solid will be created if it's not changed. + bool isSolid() const; + bool isSolid(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// Gets and sets the list of bodies that will participate in the feature when the operation is a cut or intersection. + /// If this property has not been set, the default behavior is that all bodies that are intersected by the + /// feature will participate. + /// This property can return null in the case where the feature has not been fully defined so that + /// possible intersecting bodies can be computed. + std::vector> participantBodies() const; + bool participantBodies(const std::vector>& value); + + ADSK_FUSION_REVOLVEFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_REVOLVEFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_REVOLVEFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REVOLVEFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* profile_raw() const = 0; + virtual bool profile_raw(core::Base* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual core::Base* axis_raw() const = 0; + virtual bool axis_raw(core::Base* value) = 0; + virtual bool setAngleExtent_raw(bool isSymmetric, core::ValueInput* angle) = 0; + virtual bool setTwoSideAngleExtent_raw(core::ValueInput* angleOne, core::ValueInput* angleTwo) = 0; + virtual bool setOneSideToExtent_raw(core::Base* toEntity, core::Vector3D* directionHint) = 0; + virtual bool setTwoSideToExtent_raw(core::Base* toEntityOne, core::Base* toEntityTwo) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual bool isSolid_raw() const = 0; + virtual bool isSolid_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual BRepBody** participantBodies_raw(size_t& return_size) const = 0; + virtual bool participantBodies_raw(BRepBody** value, size_t value_size) = 0; +}; + +// Inline wrappers + +inline core::Ptr RevolveFeatureInput::profile() const +{ + core::Ptr res = profile_raw(); + return res; +} + +inline bool RevolveFeatureInput::profile(const core::Ptr& value) +{ + return profile_raw(value.get()); +} + +inline FeatureOperations RevolveFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool RevolveFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr RevolveFeatureInput::axis() const +{ + core::Ptr res = axis_raw(); + return res; +} + +inline bool RevolveFeatureInput::axis(const core::Ptr& value) +{ + return axis_raw(value.get()); +} + +inline bool RevolveFeatureInput::setAngleExtent(bool isSymmetric, const core::Ptr& angle) +{ + bool res = setAngleExtent_raw(isSymmetric, angle.get()); + return res; +} + +inline bool RevolveFeatureInput::setTwoSideAngleExtent(const core::Ptr& angleOne, const core::Ptr& angleTwo) +{ + bool res = setTwoSideAngleExtent_raw(angleOne.get(), angleTwo.get()); + return res; +} + +inline bool RevolveFeatureInput::setOneSideToExtent(const core::Ptr& toEntity, const core::Ptr& directionHint) +{ + bool res = setOneSideToExtent_raw(toEntity.get(), directionHint.get()); + return res; +} + +inline bool RevolveFeatureInput::setTwoSideToExtent(const core::Ptr& toEntityOne, const core::Ptr& toEntityTwo) +{ + bool res = setTwoSideToExtent_raw(toEntityOne.get(), toEntityTwo.get()); + return res; +} + +inline core::Ptr RevolveFeatureInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool RevolveFeatureInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline bool RevolveFeatureInput::isSolid() const +{ + bool res = isSolid_raw(); + return res; +} + +inline bool RevolveFeatureInput::isSolid(bool value) +{ + return isSolid_raw(value); +} + +inline core::Ptr RevolveFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool RevolveFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline std::vector> RevolveFeatureInput::participantBodies() const +{ + std::vector> res; + size_t s; + + BRepBody** p= participantBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool RevolveFeatureInput::participantBodies(const std::vector>& value) +{ + BRepBody** value_ = new BRepBody*[value.size()]; + for(size_t i=0; i + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_REVOLVEFEATURES_CPP__ +# define ADSK_FUSION_REVOLVEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_REVOLVEFEATURES_API +# endif +#else +# define ADSK_FUSION_REVOLVEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class RevolveFeature; + class RevolveFeatureInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing revolve features in a design +/// and supports the ability to create new revolve features. +class RevolveFeatures : public core::Base { +public: + + /// Function that returns the specified revolve feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of revolve features in the collection. + size_t count() const; + + /// Creates a new RevolveFeatureInput object that is used to specify the input needed + /// to create a new revolve feature. + /// profile : The profile argument can be a single Profile, a single + /// planar face, or an ObjectCollection consisting of multiple profiles and planar faces. + /// When an ObjectCollection is used all of the profiles and faces must be co-planar. + /// To create a surface (non-solid) revolution, you can use the createOpenProfile and createBRepEdgeProfile + /// methods of the Component object to create an open profile. You also need to set the isSolid property + /// of the returned RevolveFeatureInput property to False. + /// axis : The axis can be a sketch line, construction axis, or linear edge. If it is not in + /// the same plane as the profile, it is projected onto the profile plane. + /// operation : The operation type to perform. + /// Returns the newly created RevolveFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& profile, const core::Ptr& axis, FeatureOperations operation) const; + + /// Creates a new revolve feature based on the information provided by the provided + /// RevolveFeatureInput object. + /// To create a new revolve, use the createInput function to create a new input object + /// and then use the methods and properties on that object to define the required input + /// for a revolve. Once the information is defined on the input object you can pass it + /// to the Add method to create the revolve. + /// input : The RevolveFeatureInput object that specifies the input needed to create a new extrude + /// Returns the newly created RevolveFeature or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified revolve feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef RevolveFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_REVOLVEFEATURES_API static const char* classType(); + ADSK_FUSION_REVOLVEFEATURES_API const char* objectType() const override; + ADSK_FUSION_REVOLVEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_REVOLVEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual RevolveFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual RevolveFeatureInput* createInput_raw(core::Base* profile, core::Base* axis, FeatureOperations operation) const = 0; + virtual RevolveFeature* add_raw(RevolveFeatureInput* input) = 0; + virtual RevolveFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr RevolveFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t RevolveFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr RevolveFeatures::createInput(const core::Ptr& profile, const core::Ptr& axis, FeatureOperations operation) const +{ + core::Ptr res = createInput_raw(profile.get(), axis.get(), operation); + return res; +} + +inline core::Ptr RevolveFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr RevolveFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void RevolveFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_REVOLVEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RibFeature.h b/usr/autodesk/CPP/include/Fusion/Features/RibFeature.h new file mode 100644 index 0000000..985c865 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RibFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RIBFEATURE_CPP__ +# define ADSK_FUSION_RIBFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_RIBFEATURE_API +# endif +#else +# define ADSK_FUSION_RIBFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing Rib feature in a design. +class RibFeature : public Feature { +public: + + ADSK_FUSION_RIBFEATURE_API static const char* classType(); + ADSK_FUSION_RIBFEATURE_API const char* objectType() const override; + ADSK_FUSION_RIBFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RIBFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RIBFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RibFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/RibFeatures.h new file mode 100644 index 0000000..80fc226 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RibFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RIBFEATURES_CPP__ +# define ADSK_FUSION_RIBFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_RIBFEATURES_API +# endif +#else +# define ADSK_FUSION_RIBFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class RibFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing rib features in a design. +class RibFeatures : public core::Base { +public: + + /// Function that returns the specified Rib feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified Rib feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of Rib features in the collection. + size_t count() const; + + typedef RibFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_RIBFEATURES_API static const char* classType(); + ADSK_FUSION_RIBFEATURES_API const char* objectType() const override; + ADSK_FUSION_RIBFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RIBFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual RibFeature* item_raw(size_t index) const = 0; + virtual RibFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr RibFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr RibFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t RibFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void RibFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RIBFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RuleFilletFeature.h b/usr/autodesk/CPP/include/Fusion/Features/RuleFilletFeature.h new file mode 100644 index 0000000..42bffc4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RuleFilletFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RULEFILLETFEATURE_CPP__ +# define ADSK_FUSION_RULEFILLETFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_RULEFILLETFEATURE_API +# endif +#else +# define ADSK_FUSION_RULEFILLETFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing rule fillet feature in a design. +class RuleFilletFeature : public Feature { +public: + + ADSK_FUSION_RULEFILLETFEATURE_API static const char* classType(); + ADSK_FUSION_RULEFILLETFEATURE_API const char* objectType() const override; + ADSK_FUSION_RULEFILLETFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RULEFILLETFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RULEFILLETFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RuleFilletFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/RuleFilletFeatures.h new file mode 100644 index 0000000..976485a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RuleFilletFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RULEFILLETFEATURES_CPP__ +# define ADSK_FUSION_RULEFILLETFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_RULEFILLETFEATURES_API +# endif +#else +# define ADSK_FUSION_RULEFILLETFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class RuleFilletFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing rule fillet features in a design. +class RuleFilletFeatures : public core::Base { +public: + + /// Function that returns the specified rule fillet feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified rule fillet feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of rule fillet features in the collection. + size_t count() const; + + typedef RuleFilletFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_RULEFILLETFEATURES_API static const char* classType(); + ADSK_FUSION_RULEFILLETFEATURES_API const char* objectType() const override; + ADSK_FUSION_RULEFILLETFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RULEFILLETFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual RuleFilletFeature* item_raw(size_t index) const = 0; + virtual RuleFilletFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr RuleFilletFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr RuleFilletFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t RuleFilletFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void RuleFilletFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RULEFILLETFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RuledSurfaceFeature.h b/usr/autodesk/CPP/include/Fusion/Features/RuledSurfaceFeature.h new file mode 100644 index 0000000..f307f92 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RuledSurfaceFeature.h @@ -0,0 +1,205 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RULEDSURFACEFEATURE_CPP__ +# define ADSK_FUSION_RULEDSURFACEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_RULEDSURFACEFEATURE_API +# endif +#else +# define ADSK_FUSION_RULEDSURFACEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing RuledSurface feature in a design. +class RuledSurfaceFeature : public Feature { +public: + + /// Gets and sets the Profile object that defines the sketch geometry or edges that define the shape of + /// the ruled surface. The Component.createBRepEdgeProfile method is useful to create a profile defined from edges. + /// In many cases the RuledSurface operation results in the profile being consumed so it is no longer available + /// after the feature is created. In this case, you need to reposition the timeline marker to just before this feature, + /// when the profile still exists. + core::Ptr profile() const; + bool profile(const core::Ptr& value); + + /// Returns the parameter controlling the Ruled Surface distance. You can edit the distance + /// by editing the value of the parameter object. + core::Ptr distance() const; + + /// Returns the parameter controlling the Ruled Surface angle. You can edit the angle + /// by editing the value of the parameter object. + core::Ptr angle() const; + + /// Gets and sets the type of ruled surface. To set this to DirectionRuledSurfaceType, + /// use the direction property to set the direction entity, which will automatically set + /// this to DirectionRuledSurfaceType. + RuledSurfaceTypes ruledSurfaceType() const; + bool ruledSurfaceType(RuledSurfaceTypes value); + + /// Gets and sets the entity that defines the direction when the ruled surface type is DirectionRuledSurfaceType. + /// The direction is specified by providing a linear or planar entity. For example, a linear edge, construction axis, + /// planar face, or construction plane can be used as input. + /// If this property is set when the ruledSurfaceType is not DirectionRuledSurfaceType, the type will automatically be + /// changed to DirectionRuledSurfaceType. If you get this property when the direction is not DirectionRuledSurfaceType, + /// it will return null. + core::Ptr direction() const; + bool direction(const core::Ptr& value); + + /// Gets and sets if the other face is used for creation of the Ruled Surface. + /// When creating a ruled surface using the edges of a solid or the interior edges + /// of a surface the angle of the ruled surface is measured with respect to the + /// face the selected edge is bounding. For a solid, or an interior edge on a surface, + /// the edge connects to two faces. This setting toggles which of the two faces will + /// be used for measuring the angle. + bool alternateFace() const; + bool alternateFace(bool value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Gets and sets the corner type for the ruled surface, indicating if the corners will be rounded or mitered. + /// The default value is rounded. + RuledSurfaceCornerTypes cornerType() const; + bool cornerType(RuledSurfaceCornerTypes value); + + ADSK_FUSION_RULEDSURFACEFEATURE_API static const char* classType(); + ADSK_FUSION_RULEDSURFACEFEATURE_API const char* objectType() const override; + ADSK_FUSION_RULEDSURFACEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RULEDSURFACEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* profile_raw() const = 0; + virtual bool profile_raw(core::Base* value) = 0; + virtual ModelParameter* distance_raw() const = 0; + virtual ModelParameter* angle_raw() const = 0; + virtual RuledSurfaceTypes ruledSurfaceType_raw() const = 0; + virtual bool ruledSurfaceType_raw(RuledSurfaceTypes value) = 0; + virtual core::Base* direction_raw() const = 0; + virtual bool direction_raw(core::Base* value) = 0; + virtual bool alternateFace_raw() const = 0; + virtual bool alternateFace_raw(bool value) = 0; + virtual RuledSurfaceFeature* nativeObject_raw() const = 0; + virtual RuledSurfaceFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual RuledSurfaceCornerTypes cornerType_raw() const = 0; + virtual bool cornerType_raw(RuledSurfaceCornerTypes value) = 0; +}; + +// Inline wrappers + +inline core::Ptr RuledSurfaceFeature::profile() const +{ + core::Ptr res = profile_raw(); + return res; +} + +inline bool RuledSurfaceFeature::profile(const core::Ptr& value) +{ + return profile_raw(value.get()); +} + +inline core::Ptr RuledSurfaceFeature::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline core::Ptr RuledSurfaceFeature::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline RuledSurfaceTypes RuledSurfaceFeature::ruledSurfaceType() const +{ + RuledSurfaceTypes res = ruledSurfaceType_raw(); + return res; +} + +inline bool RuledSurfaceFeature::ruledSurfaceType(RuledSurfaceTypes value) +{ + return ruledSurfaceType_raw(value); +} + +inline core::Ptr RuledSurfaceFeature::direction() const +{ + core::Ptr res = direction_raw(); + return res; +} + +inline bool RuledSurfaceFeature::direction(const core::Ptr& value) +{ + return direction_raw(value.get()); +} + +inline bool RuledSurfaceFeature::alternateFace() const +{ + bool res = alternateFace_raw(); + return res; +} + +inline bool RuledSurfaceFeature::alternateFace(bool value) +{ + return alternateFace_raw(value); +} + +inline core::Ptr RuledSurfaceFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr RuledSurfaceFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline RuledSurfaceCornerTypes RuledSurfaceFeature::cornerType() const +{ + RuledSurfaceCornerTypes res = cornerType_raw(); + return res; +} + +inline bool RuledSurfaceFeature::cornerType(RuledSurfaceCornerTypes value) +{ + return cornerType_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RULEDSURFACEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RuledSurfaceFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/RuledSurfaceFeatureInput.h new file mode 100644 index 0000000..73c502c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RuledSurfaceFeatureInput.h @@ -0,0 +1,252 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RULEDSURFACEFEATUREINPUT_CPP__ +# define ADSK_FUSION_RULEDSURFACEFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_RULEDSURFACEFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_RULEDSURFACEFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class Occurrence; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a Ruled Surface feature. +class RuledSurfaceFeatureInput : public core::Base { +public: + + /// Gets and sets the Profile object that defines the sketch geometry or edges that define the shape of + /// the ruled surface. The Component.createBRepEdgeProfile method is useful to create a profile defined from edges. + core::Ptr profile() const; + bool profile(const core::Ptr& value); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs to be + /// specified when the Ruled Surface is created based on geometry (e.g. a profile) + /// in another component AND (the Ruled Surface) is not in the root component. + /// The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// Gets and sets the ValueInput object that defines the Ruled Surface distance. If the value input is + /// a real value it will define the distance in centimeters. + core::Ptr distance() const; + bool distance(const core::Ptr& value); + + /// Gets and sets the ValueInput object that defines the Ruled Surface angle. + /// If the input is a real value, the units are radians. + core::Ptr angle() const; + bool angle(const core::Ptr& value); + + /// Gets and sets the type of ruled surface to create. To set this to DirectionRuledSurfaceType, + /// use the direction property to set the direction entity, which will automatically set + /// this to DirectionRuledSurfaceType. + RuledSurfaceTypes ruledSurfaceType() const; + bool ruledSurfaceType(RuledSurfaceTypes value); + + /// Gets and sets the entity that defines the direction when the ruled surface type is DirectionRuledSurfaceType. + /// The direction is specified by providing a linear or planar entity. For example, a linear edge, construction axis, + /// planar face, or construction plane can be used as input. + /// If this property is set when the ruledSurfaceType is not DirectionRuledSurfaceType, the type will automatically be + /// changed to DirectionRuledSurfaceType. If you get this property when the direction is not DirectionRuledSurfaceType, + /// it will return null. + core::Ptr direction() const; + bool direction(const core::Ptr& value); + + /// Gets and sets if the other face is used for creation of the Ruled Surface. + /// When creating a ruled surface using the edges of a solid or the interior edges + /// of a surface the angle of the ruled surface is measured with respect to the + /// face the selected edge is bounding. For a solid, or an interior edge on a surface, + /// the edge connects to two faces. This setting toggles which of the two faces will + /// be used for measuring the angle. + bool alternateFace() const; + bool alternateFace(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// Gets and sets the type of operation performed by the ruled surface. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets and sets the corner type for the ruled surface, indicating if the corners will be rounded or mitered. + /// The default value is rounded. + RuledSurfaceCornerTypes cornerType() const; + bool cornerType(RuledSurfaceCornerTypes value); + + ADSK_FUSION_RULEDSURFACEFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_RULEDSURFACEFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_RULEDSURFACEFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RULEDSURFACEFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* profile_raw() const = 0; + virtual bool profile_raw(core::Base* value) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual core::ValueInput* distance_raw() const = 0; + virtual bool distance_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* angle_raw() const = 0; + virtual bool angle_raw(core::ValueInput* value) = 0; + virtual RuledSurfaceTypes ruledSurfaceType_raw() const = 0; + virtual bool ruledSurfaceType_raw(RuledSurfaceTypes value) = 0; + virtual core::Base* direction_raw() const = 0; + virtual bool direction_raw(core::Base* value) = 0; + virtual bool alternateFace_raw() const = 0; + virtual bool alternateFace_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual RuledSurfaceCornerTypes cornerType_raw() const = 0; + virtual bool cornerType_raw(RuledSurfaceCornerTypes value) = 0; +}; + +// Inline wrappers + +inline core::Ptr RuledSurfaceFeatureInput::profile() const +{ + core::Ptr res = profile_raw(); + return res; +} + +inline bool RuledSurfaceFeatureInput::profile(const core::Ptr& value) +{ + return profile_raw(value.get()); +} + +inline core::Ptr RuledSurfaceFeatureInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool RuledSurfaceFeatureInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline core::Ptr RuledSurfaceFeatureInput::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline bool RuledSurfaceFeatureInput::distance(const core::Ptr& value) +{ + return distance_raw(value.get()); +} + +inline core::Ptr RuledSurfaceFeatureInput::angle() const +{ + core::Ptr res = angle_raw(); + return res; +} + +inline bool RuledSurfaceFeatureInput::angle(const core::Ptr& value) +{ + return angle_raw(value.get()); +} + +inline RuledSurfaceTypes RuledSurfaceFeatureInput::ruledSurfaceType() const +{ + RuledSurfaceTypes res = ruledSurfaceType_raw(); + return res; +} + +inline bool RuledSurfaceFeatureInput::ruledSurfaceType(RuledSurfaceTypes value) +{ + return ruledSurfaceType_raw(value); +} + +inline core::Ptr RuledSurfaceFeatureInput::direction() const +{ + core::Ptr res = direction_raw(); + return res; +} + +inline bool RuledSurfaceFeatureInput::direction(const core::Ptr& value) +{ + return direction_raw(value.get()); +} + +inline bool RuledSurfaceFeatureInput::alternateFace() const +{ + bool res = alternateFace_raw(); + return res; +} + +inline bool RuledSurfaceFeatureInput::alternateFace(bool value) +{ + return alternateFace_raw(value); +} + +inline core::Ptr RuledSurfaceFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool RuledSurfaceFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline FeatureOperations RuledSurfaceFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool RuledSurfaceFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline RuledSurfaceCornerTypes RuledSurfaceFeatureInput::cornerType() const +{ + RuledSurfaceCornerTypes res = cornerType_raw(); + return res; +} + +inline bool RuledSurfaceFeatureInput::cornerType(RuledSurfaceCornerTypes value) +{ + return cornerType_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RULEDSURFACEFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/RuledSurfaceFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/RuledSurfaceFeatures.h new file mode 100644 index 0000000..7858f2d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/RuledSurfaceFeatures.h @@ -0,0 +1,138 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RULEDSURFACEFEATURES_CPP__ +# define ADSK_FUSION_RULEDSURFACEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_RULEDSURFACEFEATURES_API +# endif +#else +# define ADSK_FUSION_RULEDSURFACEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class RuledSurfaceFeature; + class RuledSurfaceFeatureInput; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Ruled Surface features in a component +/// and supports the ability to create new Ruled Surface features. +class RuledSurfaceFeatures : public core::Base { +public: + + /// Function that returns the specified ruled surface feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of RuledSurface features in the collection. + size_t count() const; + + /// Creates a RuledSurfaceFeatureInput object that defines the input needed to create a ruled surface feature. Use the input + /// object to define the input to create the desired feature and then use the Add method, passing in the RuledSurfaceFeatureInput object. + /// profile : A Profile object that defines the sketch geometry or edges that define the shape of the ruled surface. The Component.createBRepEdgeProfile + /// method is useful to create a profile defined from edges. + /// distance : ValueInput object that defines the extension distance of the Ruled Surface.. + /// angle : ValueInput object that defines angle to use when creating the Ruled Surface. When the input is a real value, the units are radians. + /// ruledSurfaceType : The Ruled Surface type (TangentRuledSurfaceType, NormalRuledSurfaceType, or DirectionRuledSurfaceType). + /// direction : If the ruled surface type is DirectionRuledSurfaceType, you must specify the direction. The direction is specified by + /// providing a linear or planar entity. For example, a linear edge, construction axis, planar face, or construction plane can be used as input. + /// Returns the newly created RuledSurfaceFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& profile, const core::Ptr& distance, const core::Ptr& angle, RuledSurfaceTypes ruledSurfaceType, const core::Ptr& direction = NULL) const; + + /// Creates a new RuledSurface feature. + /// input : An RuledSurfaceFeatureInput object that defines the desired RuledSurface feature. Use the createInput + /// method to create a new RuledSurfaceFeatureInput object and then use methods on it + /// (the RuledSurfaceFeatureInput object) to define the desired options for the ruled surface feature. + /// Returns the newly created RuledSurfaceFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified RuledSurface feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef RuledSurfaceFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_RULEDSURFACEFEATURES_API static const char* classType(); + ADSK_FUSION_RULEDSURFACEFEATURES_API const char* objectType() const override; + ADSK_FUSION_RULEDSURFACEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RULEDSURFACEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual RuledSurfaceFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual RuledSurfaceFeatureInput* createInput_raw(core::Base* profile, core::ValueInput* distance, core::ValueInput* angle, RuledSurfaceTypes ruledSurfaceType, core::Base* direction) const = 0; + virtual RuledSurfaceFeature* add_raw(RuledSurfaceFeatureInput* input) = 0; + virtual RuledSurfaceFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr RuledSurfaceFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t RuledSurfaceFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr RuledSurfaceFeatures::createInput(const core::Ptr& profile, const core::Ptr& distance, const core::Ptr& angle, RuledSurfaceTypes ruledSurfaceType, const core::Ptr& direction) const +{ + core::Ptr res = createInput_raw(profile.get(), distance.get(), angle.get(), ruledSurfaceType, direction.get()); + return res; +} + +inline core::Ptr RuledSurfaceFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr RuledSurfaceFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void RuledSurfaceFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RULEDSURFACEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ScaleFeature.h b/usr/autodesk/CPP/include/Fusion/Features/ScaleFeature.h new file mode 100644 index 0000000..5da2c2f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ScaleFeature.h @@ -0,0 +1,216 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SCALEFEATURE_CPP__ +# define ADSK_FUSION_SCALEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_SCALEFEATURE_API +# endif +#else +# define ADSK_FUSION_SCALEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing scale feature in a design. +class ScaleFeature : public Feature { +public: + + /// Gets and sets the input entities. + /// This collection can contain sketches, BRep bodies and T-Spline bodies in parametric modeling. + /// It can contain sketches, BRep bodies, T-Spline bodies, mesh bodies, root component and occurrences in non-parametric modeling. + /// If the scaling is non-uniform (the isUniform property is false), this collection cannot contain sketches or components. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the point as reference to scale. This can be a BRepVertex, a SketchPoint or a ConstructionPoint. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr point() const; + bool point(const core::Ptr& value); + + /// Calling this method will change to a uniform scale. + /// The isUniform is set to true if successful. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// scaleFactor : A ValueInput object that defines the scale factor. + /// Returns true if successful. + bool setToUniform(const core::Ptr& scaleFactor); + + /// Calling this method will change to a non-uniform scale. + /// Fails of the inputEntities collection contains sketches or components. + /// The isUniform is set to false if successful. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// xScale : A ValueInput object that defines the scale in the X direction. + /// yScale : A ValueInput object that defines the scale in the Y direction. + /// zScale : A ValueInput object that defines the scale in the Z direction. + /// Returns true if successful. + bool setToNonUniform(const core::Ptr& xScale, const core::Ptr& yScale, const core::Ptr& zScale); + + /// Gets if it's uniform scale. + bool isUniform() const; + + /// Returns the parameter that controls the uniform scale factor. This will return null in the case + /// where isUniform is false or the feature is non-parametric. You can use the properties and + /// methods on the ModelParameter object to get and set the value. + core::Ptr scaleFactor() const; + + /// Returns the parameter that controls the X scale factor. This will return null in the case + /// where isUniform is false or the feature is non-parametric. You can use the properties and + /// methods on the ModelParameter object to get and set the value. + core::Ptr xScale() const; + + /// Returns the parameter that controls the Y scale factor. This will return null in the case + /// where isUniform is false or the feature is non-parametric. You can use the properties and + /// methods on the ModelParameter object to get and set the value. + core::Ptr yScale() const; + + /// Returns the parameter that controls the Z scale factor. This will return null in the case + /// where isUniform is false or the feature is non-parametric. You can use the properties and + /// methods on the ModelParameter object to get and set the value. + core::Ptr zScale() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SCALEFEATURE_API static const char* classType(); + ADSK_FUSION_SCALEFEATURE_API const char* objectType() const override; + ADSK_FUSION_SCALEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SCALEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual core::Base* point_raw() const = 0; + virtual bool point_raw(core::Base* value) = 0; + virtual bool setToUniform_raw(core::ValueInput* scaleFactor) = 0; + virtual bool setToNonUniform_raw(core::ValueInput* xScale, core::ValueInput* yScale, core::ValueInput* zScale) = 0; + virtual bool isUniform_raw() const = 0; + virtual ModelParameter* scaleFactor_raw() const = 0; + virtual ModelParameter* xScale_raw() const = 0; + virtual ModelParameter* yScale_raw() const = 0; + virtual ModelParameter* zScale_raw() const = 0; + virtual ScaleFeature* nativeObject_raw() const = 0; + virtual ScaleFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ScaleFeature::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool ScaleFeature::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr ScaleFeature::point() const +{ + core::Ptr res = point_raw(); + return res; +} + +inline bool ScaleFeature::point(const core::Ptr& value) +{ + return point_raw(value.get()); +} + +inline bool ScaleFeature::setToUniform(const core::Ptr& scaleFactor) +{ + bool res = setToUniform_raw(scaleFactor.get()); + return res; +} + +inline bool ScaleFeature::setToNonUniform(const core::Ptr& xScale, const core::Ptr& yScale, const core::Ptr& zScale) +{ + bool res = setToNonUniform_raw(xScale.get(), yScale.get(), zScale.get()); + return res; +} + +inline bool ScaleFeature::isUniform() const +{ + bool res = isUniform_raw(); + return res; +} + +inline core::Ptr ScaleFeature::scaleFactor() const +{ + core::Ptr res = scaleFactor_raw(); + return res; +} + +inline core::Ptr ScaleFeature::xScale() const +{ + core::Ptr res = xScale_raw(); + return res; +} + +inline core::Ptr ScaleFeature::yScale() const +{ + core::Ptr res = yScale_raw(); + return res; +} + +inline core::Ptr ScaleFeature::zScale() const +{ + core::Ptr res = zScale_raw(); + return res; +} + +inline core::Ptr ScaleFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ScaleFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SCALEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ScaleFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/ScaleFeatureInput.h new file mode 100644 index 0000000..3c5fd75 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ScaleFeatureInput.h @@ -0,0 +1,192 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SCALEFEATUREINPUT_CPP__ +# define ADSK_FUSION_SCALEFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_SCALEFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_SCALEFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a scale +/// feature. +class ScaleFeatureInput : public core::Base { +public: + + /// Gets and sets the input entities. + /// This collection can contain sketches, BRep bodies and T-Spline bodies in parametric modeling. + /// It can contain sketches, BRep bodies, T-Spline bodies, mesh bodies, root component and occurrences in non-parametric modeling. + /// If the scaling is non-uniform (the isUniform property is false), this collection cannot contain sketches or components. + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets the origin point of the scale. This can be a BRepVertex, a SketchPoint or a ConstructionPoint. + core::Ptr point() const; + bool point(const core::Ptr& value); + + /// Gets and sets the scale factor used for a uniform scale. + /// Setting this value will cause the isUniform property to be set to true. + core::Ptr scaleFactor() const; + bool scaleFactor(const core::Ptr& value); + + /// Gets if the scale is uniform. + bool isUniform() const; + + /// Sets the scale factor for the x, y, z directions to define a non-uniform scale. + /// Calling this method will cause the isUniform property to be set to false. + /// This will fail if the inputEntities collection contains sketches or components. + /// xScale : A ValueInput object that defines the scale in the X direction. + /// yScale : A ValueInput object that defines the scale in the Y direction. + /// zScale : A ValueInput object that defines the scale in the Z direction. + /// Returns true if successful. + bool setToNonUniform(const core::Ptr& xScale, const core::Ptr& yScale, const core::Ptr& zScale); + + /// Gets the scale in X direction. + core::Ptr xScale() const; + + /// Gets the scale in Y direction. + core::Ptr yScale() const; + + /// Gets the scale in Z direction. + core::Ptr zScale() const; + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_SCALEFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_SCALEFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_SCALEFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SCALEFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual core::Base* point_raw() const = 0; + virtual bool point_raw(core::Base* value) = 0; + virtual core::ValueInput* scaleFactor_raw() const = 0; + virtual bool scaleFactor_raw(core::ValueInput* value) = 0; + virtual bool isUniform_raw() const = 0; + virtual bool setToNonUniform_raw(core::ValueInput* xScale, core::ValueInput* yScale, core::ValueInput* zScale) = 0; + virtual core::ValueInput* xScale_raw() const = 0; + virtual core::ValueInput* yScale_raw() const = 0; + virtual core::ValueInput* zScale_raw() const = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ScaleFeatureInput::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool ScaleFeatureInput::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline core::Ptr ScaleFeatureInput::point() const +{ + core::Ptr res = point_raw(); + return res; +} + +inline bool ScaleFeatureInput::point(const core::Ptr& value) +{ + return point_raw(value.get()); +} + +inline core::Ptr ScaleFeatureInput::scaleFactor() const +{ + core::Ptr res = scaleFactor_raw(); + return res; +} + +inline bool ScaleFeatureInput::scaleFactor(const core::Ptr& value) +{ + return scaleFactor_raw(value.get()); +} + +inline bool ScaleFeatureInput::isUniform() const +{ + bool res = isUniform_raw(); + return res; +} + +inline bool ScaleFeatureInput::setToNonUniform(const core::Ptr& xScale, const core::Ptr& yScale, const core::Ptr& zScale) +{ + bool res = setToNonUniform_raw(xScale.get(), yScale.get(), zScale.get()); + return res; +} + +inline core::Ptr ScaleFeatureInput::xScale() const +{ + core::Ptr res = xScale_raw(); + return res; +} + +inline core::Ptr ScaleFeatureInput::yScale() const +{ + core::Ptr res = yScale_raw(); + return res; +} + +inline core::Ptr ScaleFeatureInput::zScale() const +{ + core::Ptr res = zScale_raw(); + return res; +} + +inline core::Ptr ScaleFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool ScaleFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SCALEFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ScaleFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/ScaleFeatures.h new file mode 100644 index 0000000..1fb9c67 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ScaleFeatures.h @@ -0,0 +1,138 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SCALEFEATURES_CPP__ +# define ADSK_FUSION_SCALEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_SCALEFEATURES_API +# endif +#else +# define ADSK_FUSION_SCALEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ScaleFeature; + class ScaleFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing scale features in a component +/// and supports the ability to create new scale features. +class ScaleFeatures : public core::Base { +public: + + /// Function that returns the specified scale feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of scale features in the collection. + size_t count() const; + + /// Creates a ScaleFeatureInput object. Use properties and methods on this object + /// to define the scale you want to create and then use the Add method, passing in + /// the ScaleFeatureInput object. + /// inputEntities : This collection can contain sketches, BRep bodies and T-Spline bodies in parametric modeling. + /// It can contain sketches, BRep bodies, T-Spline bodies, mesh bodies, root component and occurrences in non-parametric modeling. + /// point : Input a point as reference to scale. This can be a BRepVertex, a SketchPoint or a ConstructionPoint. + /// scaleFactor : The ValueInput object that defines the scale factor for uniform scale. + /// Returns the newly created ScaleFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& inputEntities, const core::Ptr& point, const core::Ptr& scaleFactor) const; + + /// Creates a new scale feature. + /// input : A ScaleFeatureInput object that defines the desired scale. Use the createInput + /// method to create a new ScaleFeatureInput object and then use methods on it + /// (the ScaleFeatureInput object) to define the scale. + /// Returns the newly created ScaleFeature object or null if the creation failed. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified scale feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef ScaleFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SCALEFEATURES_API static const char* classType(); + ADSK_FUSION_SCALEFEATURES_API const char* objectType() const override; + ADSK_FUSION_SCALEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SCALEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ScaleFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual ScaleFeatureInput* createInput_raw(core::ObjectCollection* inputEntities, core::Base* point, core::ValueInput* scaleFactor) const = 0; + virtual ScaleFeature* add_raw(ScaleFeatureInput* input) = 0; + virtual ScaleFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ScaleFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ScaleFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ScaleFeatures::createInput(const core::Ptr& inputEntities, const core::Ptr& point, const core::Ptr& scaleFactor) const +{ + core::Ptr res = createInput_raw(inputEntities.get(), point.get(), scaleFactor.get()); + return res; +} + +inline core::Ptr ScaleFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ScaleFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void ScaleFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SCALEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ShellFeature.h b/usr/autodesk/CPP/include/Fusion/Features/ShellFeature.h new file mode 100644 index 0000000..49314b3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ShellFeature.h @@ -0,0 +1,161 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SHELLFEATURE_CPP__ +# define ADSK_FUSION_SHELLFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_SHELLFEATURE_API +# endif +#else +# define ADSK_FUSION_SHELLFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing shell feature in a design. +class ShellFeature : public Feature { +public: + + /// Method that sets faces to remove and bodies to preform shell. Return false if any faces are input, and the owning bodies of the faces are also input. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// inputEntities : The collection contains the faces to remove and the bodies to perform shell. + /// Fails if any faces are input, and the owning bodies of the faces are also input. + /// isTangentChain : A boolean value for setting whether or not faces that are tangentially connected to + /// the input faces (if any) will also be included. It defaults to true. + /// Returns true if successful + bool setInputEntities(const core::Ptr& inputEntities, bool isTangentChain = true); + + /// Method that sets the inside and outside thicknesses of the shell. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// insideThickness : ValueInput object that defines the inside thickness. If set to null, the inside thickness is removed. + /// outsideThickness : ValueInput object that defines the outside thickness. If set to null, the outside thickness is removed. + /// Returns true if successful + bool setThicknesses(const core::Ptr& insideThickness, const core::Ptr& outsideThickness); + + /// Gets the input faces/bodies. + core::Ptr inputEntities() const; + + /// Gets if any faces that are tangentially connected to any of + /// the input faces will also be included in setting InputEntities. + bool isTangentChain() const; + + /// Gets the inside thickness. + /// Edit the thickness through ModelParameter. + /// This property returns nothing in the case where the feature is non-parametric. + core::Ptr insideThickness() const; + + /// Gets the outside thickness. + /// Edit the thickness through ModelParameter. + /// This property returns nothing in the case where the feature is non-parametric. + core::Ptr outsideThickness() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SHELLFEATURE_API static const char* classType(); + ADSK_FUSION_SHELLFEATURE_API const char* objectType() const override; + ADSK_FUSION_SHELLFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SHELLFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setInputEntities_raw(core::ObjectCollection* inputEntities, bool isTangentChain) = 0; + virtual bool setThicknesses_raw(core::ValueInput* insideThickness, core::ValueInput* outsideThickness) = 0; + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool isTangentChain_raw() const = 0; + virtual ModelParameter* insideThickness_raw() const = 0; + virtual ModelParameter* outsideThickness_raw() const = 0; + virtual ShellFeature* nativeObject_raw() const = 0; + virtual ShellFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline bool ShellFeature::setInputEntities(const core::Ptr& inputEntities, bool isTangentChain) +{ + bool res = setInputEntities_raw(inputEntities.get(), isTangentChain); + return res; +} + +inline bool ShellFeature::setThicknesses(const core::Ptr& insideThickness, const core::Ptr& outsideThickness) +{ + bool res = setThicknesses_raw(insideThickness.get(), outsideThickness.get()); + return res; +} + +inline core::Ptr ShellFeature::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool ShellFeature::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline core::Ptr ShellFeature::insideThickness() const +{ + core::Ptr res = insideThickness_raw(); + return res; +} + +inline core::Ptr ShellFeature::outsideThickness() const +{ + core::Ptr res = outsideThickness_raw(); + return res; +} + +inline core::Ptr ShellFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ShellFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SHELLFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ShellFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/ShellFeatureInput.h new file mode 100644 index 0000000..95cf071 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ShellFeatureInput.h @@ -0,0 +1,173 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SHELLFEATUREINPUT_CPP__ +# define ADSK_FUSION_SHELLFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_SHELLFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_SHELLFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a shell +/// feature. +class ShellFeatureInput : public core::Base { +public: + + /// Gets and sets the input faces/bodies. + /// If IsTangentChain is true, all the faces that are tangentially connected to the input faces (if any) will also be included. + /// Fails if any faces are input, and the owning bodies of the faces are also input. + core::Ptr inputEntities() const; + bool inputEntities(const core::Ptr& value); + + /// Gets and sets if any faces that are tangentially connected to any of + /// the input faces will also be included in setting InputEntities. It defaults to true. + bool isTangentChain() const; + bool isTangentChain(bool value); + + /// Gets and sets the inside thickness. + core::Ptr insideThickness() const; + bool insideThickness(const core::Ptr& value); + + /// Gets and sets the outside thickness. + core::Ptr outsideThickness() const; + bool outsideThickness(const core::Ptr& value); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs to be + /// specified when the shell is created based on geometry (e.g. a profile and/or face(s)) + /// in another component AND (the shell) is not in the root component. + /// The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_SHELLFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_SHELLFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_SHELLFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SHELLFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputEntities_raw() const = 0; + virtual bool inputEntities_raw(core::ObjectCollection* value) = 0; + virtual bool isTangentChain_raw() const = 0; + virtual bool isTangentChain_raw(bool value) = 0; + virtual core::ValueInput* insideThickness_raw() const = 0; + virtual bool insideThickness_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* outsideThickness_raw() const = 0; + virtual bool outsideThickness_raw(core::ValueInput* value) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ShellFeatureInput::inputEntities() const +{ + core::Ptr res = inputEntities_raw(); + return res; +} + +inline bool ShellFeatureInput::inputEntities(const core::Ptr& value) +{ + return inputEntities_raw(value.get()); +} + +inline bool ShellFeatureInput::isTangentChain() const +{ + bool res = isTangentChain_raw(); + return res; +} + +inline bool ShellFeatureInput::isTangentChain(bool value) +{ + return isTangentChain_raw(value); +} + +inline core::Ptr ShellFeatureInput::insideThickness() const +{ + core::Ptr res = insideThickness_raw(); + return res; +} + +inline bool ShellFeatureInput::insideThickness(const core::Ptr& value) +{ + return insideThickness_raw(value.get()); +} + +inline core::Ptr ShellFeatureInput::outsideThickness() const +{ + core::Ptr res = outsideThickness_raw(); + return res; +} + +inline bool ShellFeatureInput::outsideThickness(const core::Ptr& value) +{ + return outsideThickness_raw(value.get()); +} + +inline core::Ptr ShellFeatureInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool ShellFeatureInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline core::Ptr ShellFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool ShellFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SHELLFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ShellFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/ShellFeatures.h new file mode 100644 index 0000000..b4c043f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ShellFeatures.h @@ -0,0 +1,136 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SHELLFEATURES_CPP__ +# define ADSK_FUSION_SHELLFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_SHELLFEATURES_API +# endif +#else +# define ADSK_FUSION_SHELLFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ShellFeature; + class ShellFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing shell features in a component +/// and supports the ability to create new shell features. +class ShellFeatures : public core::Base { +public: + + /// Function that returns the specified shell feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of shell features in the collection. + size_t count() const; + + /// Creates a ShellFeatureInput object. Use properties and methods on this object + /// to define the shell you want to create and then use the Add method, passing in + /// the ShellFeatureInput object. + /// inputEntities : The collection contains the faces to remove and the bodies to perform shell. + /// Fails if any faces are input, and the owning bodies of the faces are also input. + /// isTangentChain : A boolean value for setting whether or not faces that are tangentially connected to + /// the input faces (if any) will also be included. It defaults to true. + /// Returns the newly created ShellFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& inputEntities, bool isTangentChain = true) const; + + /// Creates a new shell feature. + /// input : A ShellFeatureInput object that defines the desired shell. Use the createInput + /// method to create a new ShellFeatureInput object and then use methods on it + /// (the ShellFeatureInput object) to define the shell. + /// Returns the newly created ShellFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified shell feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef ShellFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SHELLFEATURES_API static const char* classType(); + ADSK_FUSION_SHELLFEATURES_API const char* objectType() const override; + ADSK_FUSION_SHELLFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SHELLFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ShellFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual ShellFeatureInput* createInput_raw(core::ObjectCollection* inputEntities, bool isTangentChain) const = 0; + virtual ShellFeature* add_raw(ShellFeatureInput* input) = 0; + virtual ShellFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ShellFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ShellFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ShellFeatures::createInput(const core::Ptr& inputEntities, bool isTangentChain) const +{ + core::Ptr res = createInput_raw(inputEntities.get(), isTangentChain); + return res; +} + +inline core::Ptr ShellFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ShellFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void ShellFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SHELLFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SilhouetteSplitFeature.h b/usr/autodesk/CPP/include/Fusion/Features/SilhouetteSplitFeature.h new file mode 100644 index 0000000..881a2f4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SilhouetteSplitFeature.h @@ -0,0 +1,130 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SILHOUETTESPLITFEATURE_CPP__ +# define ADSK_FUSION_SILHOUETTESPLITFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_SILHOUETTESPLITFEATURE_API +# endif +#else +# define ADSK_FUSION_SILHOUETTESPLITFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing silhouette split feature in a design. +class SilhouetteSplitFeature : public Feature { +public: + + /// Gets and sets the entity that defines the silhouette view direction, which can be a + /// construction axis, linear BRepEdge, planar BRepFace or a construction plane. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr viewDirection() const; + bool viewDirection(const core::Ptr& value); + + /// Gets and sets the solid body to split. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr targetBody() const; + bool targetBody(const core::Ptr& value); + + /// Gets the type of silhouette split operation. + SilhouetteSplitOperations operation() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SILHOUETTESPLITFEATURE_API static const char* classType(); + ADSK_FUSION_SILHOUETTESPLITFEATURE_API const char* objectType() const override; + ADSK_FUSION_SILHOUETTESPLITFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SILHOUETTESPLITFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* viewDirection_raw() const = 0; + virtual bool viewDirection_raw(core::Base* value) = 0; + virtual BRepBody* targetBody_raw() const = 0; + virtual bool targetBody_raw(BRepBody* value) = 0; + virtual SilhouetteSplitOperations operation_raw() const = 0; + virtual SilhouetteSplitFeature* nativeObject_raw() const = 0; + virtual SilhouetteSplitFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SilhouetteSplitFeature::viewDirection() const +{ + core::Ptr res = viewDirection_raw(); + return res; +} + +inline bool SilhouetteSplitFeature::viewDirection(const core::Ptr& value) +{ + return viewDirection_raw(value.get()); +} + +inline core::Ptr SilhouetteSplitFeature::targetBody() const +{ + core::Ptr res = targetBody_raw(); + return res; +} + +inline bool SilhouetteSplitFeature::targetBody(const core::Ptr& value) +{ + return targetBody_raw(value.get()); +} + +inline SilhouetteSplitOperations SilhouetteSplitFeature::operation() const +{ + SilhouetteSplitOperations res = operation_raw(); + return res; +} + +inline core::Ptr SilhouetteSplitFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SilhouetteSplitFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SILHOUETTESPLITFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SilhouetteSplitFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/SilhouetteSplitFeatureInput.h new file mode 100644 index 0000000..1a83245 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SilhouetteSplitFeatureInput.h @@ -0,0 +1,129 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SILHOUETTESPLITFEATUREINPUT_CPP__ +# define ADSK_FUSION_SILHOUETTESPLITFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_SILHOUETTESPLITFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_SILHOUETTESPLITFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepBody; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a silhouette split feature. +class SilhouetteSplitFeatureInput : public core::Base { +public: + + /// Gets and sets the solid body to split. + core::Ptr targetBody() const; + bool targetBody(const core::Ptr& value); + + /// Gets and sets the entity that defines the silhouette view direction, which can be a + /// construction axis, linear BRepEdge, planar BRepFace or a construction plane. + core::Ptr viewDirection() const; + bool viewDirection(const core::Ptr& value); + + /// Gets and sets the type of silhouette split operation to perform. + SilhouetteSplitOperations operation() const; + bool operation(SilhouetteSplitOperations value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_SILHOUETTESPLITFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_SILHOUETTESPLITFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_SILHOUETTESPLITFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SILHOUETTESPLITFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepBody* targetBody_raw() const = 0; + virtual bool targetBody_raw(BRepBody* value) = 0; + virtual core::Base* viewDirection_raw() const = 0; + virtual bool viewDirection_raw(core::Base* value) = 0; + virtual SilhouetteSplitOperations operation_raw() const = 0; + virtual bool operation_raw(SilhouetteSplitOperations value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr SilhouetteSplitFeatureInput::targetBody() const +{ + core::Ptr res = targetBody_raw(); + return res; +} + +inline bool SilhouetteSplitFeatureInput::targetBody(const core::Ptr& value) +{ + return targetBody_raw(value.get()); +} + +inline core::Ptr SilhouetteSplitFeatureInput::viewDirection() const +{ + core::Ptr res = viewDirection_raw(); + return res; +} + +inline bool SilhouetteSplitFeatureInput::viewDirection(const core::Ptr& value) +{ + return viewDirection_raw(value.get()); +} + +inline SilhouetteSplitOperations SilhouetteSplitFeatureInput::operation() const +{ + SilhouetteSplitOperations res = operation_raw(); + return res; +} + +inline bool SilhouetteSplitFeatureInput::operation(SilhouetteSplitOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr SilhouetteSplitFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool SilhouetteSplitFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SILHOUETTESPLITFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SilhouetteSplitFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/SilhouetteSplitFeatures.h new file mode 100644 index 0000000..ccceeee --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SilhouetteSplitFeatures.h @@ -0,0 +1,134 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SILHOUETTESPLITFEATURES_CPP__ +# define ADSK_FUSION_SILHOUETTESPLITFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_SILHOUETTESPLITFEATURES_API +# endif +#else +# define ADSK_FUSION_SILHOUETTESPLITFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class SilhouetteSplitFeature; + class SilhouetteSplitFeatureInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Silhouette Split features in a component +/// and supports the ability to create new Silhouette Split features. +class SilhouetteSplitFeatures : public core::Base { +public: + + /// Function that returns the specified silhouette split feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of Silhouette Split features in the collection. + size_t count() const; + + /// Creates a SilhouetteSplitFeatureInput object. Use properties and methods on this object + /// to define the silhouette split you want to create and then use the Add method, passing in + /// the SilhouetteSplitFeatureInput object. + /// viewDirection : A construction axis, linear BRepEdge, planar BRepFace or a construction plane that defines the view direction + /// where the silhouette is calculated. + /// targetBody : Input the single solid body to split + /// operation : The type of silhouette split operation to perform. + /// Returns the newly created SilhouetteSplitFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& viewDirection, const core::Ptr& targetBody, SilhouetteSplitOperations operation) const; + + /// Creates a new silhouette split feature. + /// input : A SilhouetteSplitFeatureInput object that defines the desired silhouette split feature. Use the createInput + /// method to create a new SilhouetteSplitFeatureInput object and then use methods on it + /// (the SilhouetteSplitFeatureInput object) to define the silhouette split. + /// Returns the newly created SilhouetteSplitFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified silhouette split feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef SilhouetteSplitFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SILHOUETTESPLITFEATURES_API static const char* classType(); + ADSK_FUSION_SILHOUETTESPLITFEATURES_API const char* objectType() const override; + ADSK_FUSION_SILHOUETTESPLITFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SILHOUETTESPLITFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SilhouetteSplitFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SilhouetteSplitFeatureInput* createInput_raw(core::Base* viewDirection, BRepBody* targetBody, SilhouetteSplitOperations operation) const = 0; + virtual SilhouetteSplitFeature* add_raw(SilhouetteSplitFeatureInput* input) = 0; + virtual SilhouetteSplitFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SilhouetteSplitFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SilhouetteSplitFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SilhouetteSplitFeatures::createInput(const core::Ptr& viewDirection, const core::Ptr& targetBody, SilhouetteSplitOperations operation) const +{ + core::Ptr res = createInput_raw(viewDirection.get(), targetBody.get(), operation); + return res; +} + +inline core::Ptr SilhouetteSplitFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr SilhouetteSplitFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void SilhouetteSplitFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SILHOUETTESPLITFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SketchPointHolePositionDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/SketchPointHolePositionDefinition.h new file mode 100644 index 0000000..39d4c5e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SketchPointHolePositionDefinition.h @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "HolePositionDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHPOINTHOLEPOSITIONDEFINITION_CPP__ +# define ADSK_FUSION_SKETCHPOINTHOLEPOSITIONDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHPOINTHOLEPOSITIONDEFINITION_API +# endif +#else +# define ADSK_FUSION_SKETCHPOINTHOLEPOSITIONDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchPoint; +}} + +namespace adsk { namespace fusion { + +/// Provides positioning information for a hole that is positioned by a sketch point. +class SketchPointHolePositionDefinition : public HolePositionDefinition { +public: + + /// Returns the sketch point that defines the center of the hole. + core::Ptr sketchPoint() const; + + ADSK_FUSION_SKETCHPOINTHOLEPOSITIONDEFINITION_API static const char* classType(); + ADSK_FUSION_SKETCHPOINTHOLEPOSITIONDEFINITION_API const char* objectType() const override; + ADSK_FUSION_SKETCHPOINTHOLEPOSITIONDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHPOINTHOLEPOSITIONDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* sketchPoint_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchPointHolePositionDefinition::sketchPoint() const +{ + core::Ptr res = sketchPoint_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHPOINTHOLEPOSITIONDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SketchPointsHolePositionDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/SketchPointsHolePositionDefinition.h new file mode 100644 index 0000000..0a2af96 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SketchPointsHolePositionDefinition.h @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "HolePositionDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHPOINTSHOLEPOSITIONDEFINITION_CPP__ +# define ADSK_FUSION_SKETCHPOINTSHOLEPOSITIONDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHPOINTSHOLEPOSITIONDEFINITION_API +# endif +#else +# define ADSK_FUSION_SKETCHPOINTSHOLEPOSITIONDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Provides positioning information for a hole that is positioned by a sketch point. +class SketchPointsHolePositionDefinition : public HolePositionDefinition { +public: + + /// Returns the sketch point that defines the center of the hole. + core::Ptr sketchPoints() const; + + ADSK_FUSION_SKETCHPOINTSHOLEPOSITIONDEFINITION_API static const char* classType(); + ADSK_FUSION_SKETCHPOINTSHOLEPOSITIONDEFINITION_API const char* objectType() const override; + ADSK_FUSION_SKETCHPOINTSHOLEPOSITIONDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHPOINTSHOLEPOSITIONDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* sketchPoints_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchPointsHolePositionDefinition::sketchPoints() const +{ + core::Ptr res = sketchPoints_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHPOINTSHOLEPOSITIONDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SphereFeature.h b/usr/autodesk/CPP/include/Fusion/Features/SphereFeature.h new file mode 100644 index 0000000..9966d6e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SphereFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SPHEREFEATURE_CPP__ +# define ADSK_FUSION_SPHEREFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_SPHEREFEATURE_API +# endif +#else +# define ADSK_FUSION_SPHEREFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing sphere feature in a design. +class SphereFeature : public Feature { +public: + + ADSK_FUSION_SPHEREFEATURE_API static const char* classType(); + ADSK_FUSION_SPHEREFEATURE_API const char* objectType() const override; + ADSK_FUSION_SPHEREFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SPHEREFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SPHEREFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SphereFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/SphereFeatures.h new file mode 100644 index 0000000..e1dd5fa --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SphereFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SPHEREFEATURES_CPP__ +# define ADSK_FUSION_SPHEREFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_SPHEREFEATURES_API +# endif +#else +# define ADSK_FUSION_SPHEREFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SphereFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing torus features in a design. +class SphereFeatures : public core::Base { +public: + + /// Function that returns the specified sphere feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified sphere feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of sphere features in the collection. + size_t count() const; + + typedef SphereFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SPHEREFEATURES_API static const char* classType(); + ADSK_FUSION_SPHEREFEATURES_API const char* objectType() const override; + ADSK_FUSION_SPHEREFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SPHEREFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SphereFeature* item_raw(size_t index) const = 0; + virtual SphereFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SphereFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr SphereFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t SphereFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void SphereFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SPHEREFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SplitBodyFeature.h b/usr/autodesk/CPP/include/Fusion/Features/SplitBodyFeature.h new file mode 100644 index 0000000..a0a14af --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SplitBodyFeature.h @@ -0,0 +1,142 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SPLITBODYFEATURE_CPP__ +# define ADSK_FUSION_SPLITBODYFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_SPLITBODYFEATURE_API +# endif +#else +# define ADSK_FUSION_SPLITBODYFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing split body feature in a design. +class SplitBodyFeature : public Feature { +public: + + /// Gets and sets the input solid or open bodies that are split. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr splitBodies() const; + bool splitBodies(const core::Ptr& value); + + /// Sets the splitting tool used for the feature. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// splittingTool : Input entity that defines the splitting tool. The splitting tool is a single entity that can be either a solid body, + /// open body, construction plane, face, or sketch curve that partially or fully intersects the body to split. + /// isSplittingToolExtended : A boolean value for setting whether or not the splittingTool is to be automatically extended (if possible) so as to + /// completely intersect the facesToSplit. + /// Returns true if successful. + bool setSplittingTool(const core::Ptr& splittingTool, bool isSplittingToolExtended); + + /// Gets the entity that defines the splitting tool. The splitting tool is a single entity that can be either a + /// solid body, open body, plane, sketch curve or face that partially or fully intersects the bodyToSplit. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr splittingTool() const; + + /// Gets whether or not the splitting tool is to be automatically extended (if possible) so as to + /// completely intersect the bodyToSplit. + bool isSplittingToolExtended() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SPLITBODYFEATURE_API static const char* classType(); + ADSK_FUSION_SPLITBODYFEATURE_API const char* objectType() const override; + ADSK_FUSION_SPLITBODYFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SPLITBODYFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* splitBodies_raw() const = 0; + virtual bool splitBodies_raw(core::ObjectCollection* value) = 0; + virtual bool setSplittingTool_raw(core::Base* splittingTool, bool isSplittingToolExtended) = 0; + virtual core::Base* splittingTool_raw() const = 0; + virtual bool isSplittingToolExtended_raw() const = 0; + virtual SplitBodyFeature* nativeObject_raw() const = 0; + virtual SplitBodyFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SplitBodyFeature::splitBodies() const +{ + core::Ptr res = splitBodies_raw(); + return res; +} + +inline bool SplitBodyFeature::splitBodies(const core::Ptr& value) +{ + return splitBodies_raw(value.get()); +} + +inline bool SplitBodyFeature::setSplittingTool(const core::Ptr& splittingTool, bool isSplittingToolExtended) +{ + bool res = setSplittingTool_raw(splittingTool.get(), isSplittingToolExtended); + return res; +} + +inline core::Ptr SplitBodyFeature::splittingTool() const +{ + core::Ptr res = splittingTool_raw(); + return res; +} + +inline bool SplitBodyFeature::isSplittingToolExtended() const +{ + bool res = isSplittingToolExtended_raw(); + return res; +} + +inline core::Ptr SplitBodyFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SplitBodyFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SPLITBODYFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SplitBodyFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/SplitBodyFeatureInput.h new file mode 100644 index 0000000..d710b34 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SplitBodyFeatureInput.h @@ -0,0 +1,130 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SPLITBODYFEATUREINPUT_CPP__ +# define ADSK_FUSION_SPLITBODYFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_SPLITBODYFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_SPLITBODYFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a split body feature. +class SplitBodyFeatureInput : public core::Base { +public: + + /// Gets and sets the input solid or open bodies to be split. This can be a + /// single BRepBody or an ObjectCollection if multiple bodies are to be split. + core::Ptr splitBodies() const; + bool splitBodies(const core::Ptr& value); + + /// Gets and sets the entity that defines the splitting tool. The splitting tool is a single + /// entity that can be either a solid or open BRepBody, construction plane, profile, or a face. + core::Ptr splittingTool() const; + bool splittingTool(const core::Ptr& value); + + /// Gets and sets whether or not the splitting tool is to be automatically extended (if possible) so as to + /// completely intersect the bodyToSplit. + bool isSplittingToolExtended() const; + bool isSplittingToolExtended(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_SPLITBODYFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_SPLITBODYFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_SPLITBODYFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SPLITBODYFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* splitBodies_raw() const = 0; + virtual bool splitBodies_raw(core::Base* value) = 0; + virtual core::Base* splittingTool_raw() const = 0; + virtual bool splittingTool_raw(core::Base* value) = 0; + virtual bool isSplittingToolExtended_raw() const = 0; + virtual bool isSplittingToolExtended_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr SplitBodyFeatureInput::splitBodies() const +{ + core::Ptr res = splitBodies_raw(); + return res; +} + +inline bool SplitBodyFeatureInput::splitBodies(const core::Ptr& value) +{ + return splitBodies_raw(value.get()); +} + +inline core::Ptr SplitBodyFeatureInput::splittingTool() const +{ + core::Ptr res = splittingTool_raw(); + return res; +} + +inline bool SplitBodyFeatureInput::splittingTool(const core::Ptr& value) +{ + return splittingTool_raw(value.get()); +} + +inline bool SplitBodyFeatureInput::isSplittingToolExtended() const +{ + bool res = isSplittingToolExtended_raw(); + return res; +} + +inline bool SplitBodyFeatureInput::isSplittingToolExtended(bool value) +{ + return isSplittingToolExtended_raw(value); +} + +inline core::Ptr SplitBodyFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool SplitBodyFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SPLITBODYFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SplitBodyFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/SplitBodyFeatures.h new file mode 100644 index 0000000..3ab31fe --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SplitBodyFeatures.h @@ -0,0 +1,135 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SPLITBODYFEATURES_CPP__ +# define ADSK_FUSION_SPLITBODYFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_SPLITBODYFEATURES_API +# endif +#else +# define ADSK_FUSION_SPLITBODYFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SplitBodyFeature; + class SplitBodyFeatureInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing split body features in a component +/// and supports the ability to create new split body features. +class SplitBodyFeatures : public core::Base { +public: + + /// Function that returns the specified split body feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of split body features in the collection. + size_t count() const; + + /// Creates a SplitBodyFeatureInput object. Use properties and methods on this object + /// to define the split body you want to create and then use the Add method, passing in + /// the SplitBodyFeatureInput object. + /// splitBodies : Input solid body or open bodies to be split. This can be a single BRepBody or an ObjectCollection if multiple + /// bodies are to be split. + /// splittingTool : Input entity that defines the splitting tool. The splitting tool is a single entity that can be either a solid or open BRepBody, + /// construction plane, profile, or a face. + /// isSplittingToolExtended : A boolean value for setting whether or not the splitting tool is to be automatically extended (if possible) so as to + /// completely intersect the bodyToSplit. + /// Returns the newly created SplitBodyFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& splitBodies, const core::Ptr& splittingTool, bool isSplittingToolExtended) const; + + /// Creates a new split body feature. + /// input : A SplitBodyFeatureInput object that defines the desired split body feature. Use the createInput + /// method to create a new SplitBodyFeatureInput object and then use methods on it + /// (the SplitBodyFeatureInput object) to define the split body. + /// Returns the newly created SplitBodyFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified split body feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef SplitBodyFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SPLITBODYFEATURES_API static const char* classType(); + ADSK_FUSION_SPLITBODYFEATURES_API const char* objectType() const override; + ADSK_FUSION_SPLITBODYFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SPLITBODYFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SplitBodyFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SplitBodyFeatureInput* createInput_raw(core::Base* splitBodies, core::Base* splittingTool, bool isSplittingToolExtended) const = 0; + virtual SplitBodyFeature* add_raw(SplitBodyFeatureInput* input) = 0; + virtual SplitBodyFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SplitBodyFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SplitBodyFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SplitBodyFeatures::createInput(const core::Ptr& splitBodies, const core::Ptr& splittingTool, bool isSplittingToolExtended) const +{ + core::Ptr res = createInput_raw(splitBodies.get(), splittingTool.get(), isSplittingToolExtended); + return res; +} + +inline core::Ptr SplitBodyFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr SplitBodyFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void SplitBodyFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SPLITBODYFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SplitFaceFeature.h b/usr/autodesk/CPP/include/Fusion/Features/SplitFaceFeature.h new file mode 100644 index 0000000..fc85bb1 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SplitFaceFeature.h @@ -0,0 +1,225 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SPLITFACEFEATURE_CPP__ +# define ADSK_FUSION_SPLITFACEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_SPLITFACEFEATURE_API +# endif +#else +# define ADSK_FUSION_SPLITFACEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing split face feature in a design. +class SplitFaceFeature : public Feature { +public: + + /// Gets and sets the faces to be split. + /// The collection can contain one or more faces selected from solid and/or open bodies. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr facesToSplit() const; + bool facesToSplit(const core::Ptr& value); + + /// Sets the splitting tool used for the feature. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// splittingTool : Input entity that defines the splitting tool. The splitting tool is a single entity that can be either a solid body, + /// open body, construction plane, face, or sketch curve that partially or fully intersects the facesToSplit. + /// The input for this argument can be one of the valid types or an ObjectCollection in the case where multiple splitting + /// tools are being defined. + /// isSplittingToolExtended : A boolean value for setting whether or not the splittingTool is to be automatically extended (if possible) so as to + /// completely intersect the facesToSplit. + /// Returns true if successful. + bool setSplittingTool(const core::Ptr& splittingTool, bool isSplittingToolExtended); + + /// Gets the entity(s) that define the splitting tool(s). The splitting tool can consist of one or more of + /// the following: BRepBody, ConstructionPlane, BRepFace, sketch curve that extends or can + /// be extended beyond the extents of the face. To set the splitting tool, use one of the set methods to + /// also define the split type. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr splittingTool() const; + + /// Gets whether or not the setting to automatically extend the splittingTool was set when the feature was created. + /// This property is valid only when the splitType property returns surfaceIntersectionSplitType. + bool isSplittingToolExtended() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Set the split type to be a surface to surface intersection. If the split tool is a curve + /// it will be extruded into a surface to use in the split. If it's a surface, the surface will + /// be used and optionally extended to fully intersect the faces to be split. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// splittingTool : Input entity(s) that defines the splitting tool. The splitting tool can be a single entity or an ObjectCollection + /// containing solid and/or open bodies, construction planes, faces, or sketch curves that partially or fully intersect + /// the faces that are being split. + /// isSplittingToolExtended : Specifies if the splitting tool should be extended so that is fully intersects the faces to be split. + /// Returns true is setting the split type was successful. + bool setAsSurfaceIntersectionSplitType(const core::Ptr& splittingTool, bool isSplittingToolExtended); + + /// Sets the split type to project the splitting tool along the direction defined by the + /// specified entity. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// splittingTool : Input entity(s) that defines the splitting tool. The splitting tool can be a single entity or an ObjectCollection + /// containing faces or sketch curves. If faces are input, the edges of the face are used as the splitting tool. + /// directionEntity : An entity that defines the direction of projection of the splitting tool. This can be + /// a linear BRepEdge, SketchLine, ConstructionLine, or a planar face where the face + /// normal is used. + /// Returns true is setting the split type was successful. + bool setAsAlongVectorSplitType(const core::Ptr& splittingTool, const core::Ptr& directionEntity); + + /// Sets the split type to be a curve that defined by projecting the splitting curve to the + /// closest point on the surface. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// splittingTool : Input entity(s) that defines the splitting tool. The splitting tool can be a single entity or an ObjectCollection + /// containing faces or sketch curves. If faces are input, the edges of the face are used as the splitting tool. + /// Returns true if setting the closest point split type was successful. + bool setAsClosestPointSplitType(const core::Ptr& splittingTool); + + /// Gets the direction entity when the split type is along a vector. If the split type + /// is not alongVectorSplitType this property will return null. + /// To set the direction entity use the setAsAlongVectorSplitType method. + core::Ptr directionEntity() const; + + /// Returns the type of split type currently defined. To change the split type, use + /// one of the set methods. + SplitFaceSplitTypes splitType() const; + + ADSK_FUSION_SPLITFACEFEATURE_API static const char* classType(); + ADSK_FUSION_SPLITFACEFEATURE_API const char* objectType() const override; + ADSK_FUSION_SPLITFACEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SPLITFACEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* facesToSplit_raw() const = 0; + virtual bool facesToSplit_raw(core::ObjectCollection* value) = 0; + virtual bool setSplittingTool_raw(core::Base* splittingTool, bool isSplittingToolExtended) = 0; + virtual core::ObjectCollection* splittingTool_raw() const = 0; + virtual bool isSplittingToolExtended_raw() const = 0; + virtual SplitFaceFeature* nativeObject_raw() const = 0; + virtual SplitFaceFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual bool setAsSurfaceIntersectionSplitType_raw(core::Base* splittingTool, bool isSplittingToolExtended) = 0; + virtual bool setAsAlongVectorSplitType_raw(core::Base* splittingTool, core::Base* directionEntity) = 0; + virtual bool setAsClosestPointSplitType_raw(core::Base* splittingTool) = 0; + virtual core::Base* directionEntity_raw() const = 0; + virtual SplitFaceSplitTypes splitType_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SplitFaceFeature::facesToSplit() const +{ + core::Ptr res = facesToSplit_raw(); + return res; +} + +inline bool SplitFaceFeature::facesToSplit(const core::Ptr& value) +{ + return facesToSplit_raw(value.get()); +} + +inline bool SplitFaceFeature::setSplittingTool(const core::Ptr& splittingTool, bool isSplittingToolExtended) +{ + bool res = setSplittingTool_raw(splittingTool.get(), isSplittingToolExtended); + return res; +} + +inline core::Ptr SplitFaceFeature::splittingTool() const +{ + core::Ptr res = splittingTool_raw(); + return res; +} + +inline bool SplitFaceFeature::isSplittingToolExtended() const +{ + bool res = isSplittingToolExtended_raw(); + return res; +} + +inline core::Ptr SplitFaceFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SplitFaceFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline bool SplitFaceFeature::setAsSurfaceIntersectionSplitType(const core::Ptr& splittingTool, bool isSplittingToolExtended) +{ + bool res = setAsSurfaceIntersectionSplitType_raw(splittingTool.get(), isSplittingToolExtended); + return res; +} + +inline bool SplitFaceFeature::setAsAlongVectorSplitType(const core::Ptr& splittingTool, const core::Ptr& directionEntity) +{ + bool res = setAsAlongVectorSplitType_raw(splittingTool.get(), directionEntity.get()); + return res; +} + +inline bool SplitFaceFeature::setAsClosestPointSplitType(const core::Ptr& splittingTool) +{ + bool res = setAsClosestPointSplitType_raw(splittingTool.get()); + return res; +} + +inline core::Ptr SplitFaceFeature::directionEntity() const +{ + core::Ptr res = directionEntity_raw(); + return res; +} + +inline SplitFaceSplitTypes SplitFaceFeature::splitType() const +{ + SplitFaceSplitTypes res = splitType_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SPLITFACEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SplitFaceFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/SplitFaceFeatureInput.h new file mode 100644 index 0000000..38eec01 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SplitFaceFeatureInput.h @@ -0,0 +1,185 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SPLITFACEFEATUREINPUT_CPP__ +# define ADSK_FUSION_SPLITFACEFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_SPLITFACEFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_SPLITFACEFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a split face feature. +class SplitFaceFeatureInput : public core::Base { +public: + + /// Gets and sets the faces to be split. + /// The collection can contain one or more faces selected from solid and/or open bodies. + core::Ptr facesToSplit() const; + bool facesToSplit(const core::Ptr& value); + + /// Gets and sets the entity(s) that define the splitting tool(s). The splitting tool can be a single entity or an + /// ObjectCollection containing solid and/or open bodies, construction planes, faces, or sketch curves that partially + /// or fully intersect the faces that are being split. + core::Ptr splittingTool() const; + bool splittingTool(const core::Ptr& value); + + /// Gets and sets whether or not the splittingTool is to be automatically extended (if possible) so as to + /// completely intersect the facesToSplit. + bool isSplittingToolExtended() const; + bool isSplittingToolExtended(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// Sets the split type to project the splitting tool along the direction defined by the + /// specified entity. + /// directionEntity : An entity that defines the direction of projection of the splitting tool. This can be + /// a linear BRepEdge, SketchLine, ConstructionLine, or a planar face where the face + /// normal is used. + /// Returns true is setting the split type was successful. + bool setAlongVectorSplitType(const core::Ptr& directionEntity); + + /// Sets the split type to be a curve that defined by projecting the splitting curve to the + /// closest point on the surface. + /// Returns true is setting the split type was successful. + bool setClosestPointSplitType(); + + /// Set the split type to be a surface to surface intersection. If the split tool is a curve + /// it will be extruded into a surface to use in the split. If it's a surface, the surface will + /// be used and optionally extended to fully intersect the faces to be split. + /// isSplittingToolExtended : Specifies if the splitting tool should be extended so that is fully intersects the faces to be split. + /// Returns true is setting the split type was successful. + bool setSurfaceIntersectionSplitType(bool isSplittingToolExtended); + + /// Returns the type of split type currently defined. + SplitFaceSplitTypes splitType() const; + + ADSK_FUSION_SPLITFACEFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_SPLITFACEFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_SPLITFACEFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SPLITFACEFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* facesToSplit_raw() const = 0; + virtual bool facesToSplit_raw(core::ObjectCollection* value) = 0; + virtual core::Base* splittingTool_raw() const = 0; + virtual bool splittingTool_raw(core::Base* value) = 0; + virtual bool isSplittingToolExtended_raw() const = 0; + virtual bool isSplittingToolExtended_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual bool setAlongVectorSplitType_raw(core::Base* directionEntity) = 0; + virtual bool setClosestPointSplitType_raw() = 0; + virtual bool setSurfaceIntersectionSplitType_raw(bool isSplittingToolExtended) = 0; + virtual SplitFaceSplitTypes splitType_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SplitFaceFeatureInput::facesToSplit() const +{ + core::Ptr res = facesToSplit_raw(); + return res; +} + +inline bool SplitFaceFeatureInput::facesToSplit(const core::Ptr& value) +{ + return facesToSplit_raw(value.get()); +} + +inline core::Ptr SplitFaceFeatureInput::splittingTool() const +{ + core::Ptr res = splittingTool_raw(); + return res; +} + +inline bool SplitFaceFeatureInput::splittingTool(const core::Ptr& value) +{ + return splittingTool_raw(value.get()); +} + +inline bool SplitFaceFeatureInput::isSplittingToolExtended() const +{ + bool res = isSplittingToolExtended_raw(); + return res; +} + +inline bool SplitFaceFeatureInput::isSplittingToolExtended(bool value) +{ + return isSplittingToolExtended_raw(value); +} + +inline core::Ptr SplitFaceFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool SplitFaceFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline bool SplitFaceFeatureInput::setAlongVectorSplitType(const core::Ptr& directionEntity) +{ + bool res = setAlongVectorSplitType_raw(directionEntity.get()); + return res; +} + +inline bool SplitFaceFeatureInput::setClosestPointSplitType() +{ + bool res = setClosestPointSplitType_raw(); + return res; +} + +inline bool SplitFaceFeatureInput::setSurfaceIntersectionSplitType(bool isSplittingToolExtended) +{ + bool res = setSurfaceIntersectionSplitType_raw(isSplittingToolExtended); + return res; +} + +inline SplitFaceSplitTypes SplitFaceFeatureInput::splitType() const +{ + SplitFaceSplitTypes res = splitType_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SPLITFACEFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SplitFaceFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/SplitFaceFeatures.h new file mode 100644 index 0000000..7418aab --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SplitFaceFeatures.h @@ -0,0 +1,143 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SPLITFACEFEATURES_CPP__ +# define ADSK_FUSION_SPLITFACEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_SPLITFACEFEATURES_API +# endif +#else +# define ADSK_FUSION_SPLITFACEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SplitFaceFeature; + class SplitFaceFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing split face features in a component +/// and supports the ability to create new split face features. +class SplitFaceFeatures : public core::Base { +public: + + /// Function that returns the specified split face feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of split face features in the collection. + size_t count() const; + + /// Creates a SplitFaceFeatureInput object. Use properties and methods on this object + /// to define the split face you want to create and then use the Add method, passing in + /// the SplitFaceFeatureInput object. + /// A newly created SplitFaceFeatureInput object defaults to creating a split face feature + /// using the "Split with Surface" option. You can use functions on the SplitFaceFeatureInput + /// object to define a different type of split type. + /// facesToSplit : Input the faces to be split. The collection can contain one or more faces from solid and/or open bodies. + /// splittingTool : Input entity(s) that defines the splitting tool. The splitting tool can be a single entity or an ObjectCollection + /// containing solid and/or open bodies, construction planes, faces, or sketch curves that partially or fully intersect + /// the faces that are being split. + /// isSplittingToolExtended : A boolean value for setting whether or not the splittingTool is to be automatically extended (if possible) so as to + /// completely intersect the faces that are to be split. This is only used when the split type is "split with surface" + /// which is the default type when a new createInput is created. Use functions on the returned SplitFaceFeatureInput + /// to define a different type of split type. + /// Returns the newly created SplitFaceFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& facesToSplit, const core::Ptr& splittingTool, bool isSplittingToolExtended) const; + + /// Creates a new split face feature. + /// input : A SplitFaceFeatureInput object that defines the desired split face feature. Use the createInput + /// method to create a new SplitFaceFeatureInput object and then use methods on it + /// (the SplitFaceFeatureInput object) to define the split face. + /// Returns the newly created SplitFaceFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified split face feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef SplitFaceFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SPLITFACEFEATURES_API static const char* classType(); + ADSK_FUSION_SPLITFACEFEATURES_API const char* objectType() const override; + ADSK_FUSION_SPLITFACEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SPLITFACEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SplitFaceFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SplitFaceFeatureInput* createInput_raw(core::ObjectCollection* facesToSplit, core::Base* splittingTool, bool isSplittingToolExtended) const = 0; + virtual SplitFaceFeature* add_raw(SplitFaceFeatureInput* input) = 0; + virtual SplitFaceFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SplitFaceFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SplitFaceFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SplitFaceFeatures::createInput(const core::Ptr& facesToSplit, const core::Ptr& splittingTool, bool isSplittingToolExtended) const +{ + core::Ptr res = createInput_raw(facesToSplit.get(), splittingTool.get(), isSplittingToolExtended); + return res; +} + +inline core::Ptr SplitFaceFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr SplitFaceFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void SplitFaceFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SPLITFACEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/StitchFeature.h b/usr/autodesk/CPP/include/Fusion/Features/StitchFeature.h new file mode 100644 index 0000000..bdb64bd --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/StitchFeature.h @@ -0,0 +1,137 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_STITCHFEATURE_CPP__ +# define ADSK_FUSION_STITCHFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_STITCHFEATURE_API +# endif +#else +# define ADSK_FUSION_STITCHFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing stitch feature in a design. +class StitchFeature : public Feature { +public: + + /// Gets and sets the surfaces to stitch together. In some cases the stitch operation results in + /// faces being merged so the original faces are no longer available after the feature is created. + /// in this case you need to reposition the timeline marker to just before this feature + /// when the faces do exist. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr stitchSurfaces() const; + bool stitchSurfaces(const core::Ptr& value); + + /// Returns the parameter controlling the tolerance. You can edit the tolerance + /// by editing the value of the parameter object. + core::Ptr tolerance() const; + + /// Gets and sets the feature operation to perform. This property value is ignored if the stitched result does not + /// form a solid body. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_STITCHFEATURE_API static const char* classType(); + ADSK_FUSION_STITCHFEATURE_API const char* objectType() const override; + ADSK_FUSION_STITCHFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_STITCHFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* stitchSurfaces_raw() const = 0; + virtual bool stitchSurfaces_raw(core::ObjectCollection* value) = 0; + virtual ModelParameter* tolerance_raw() const = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual StitchFeature* nativeObject_raw() const = 0; + virtual StitchFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr StitchFeature::stitchSurfaces() const +{ + core::Ptr res = stitchSurfaces_raw(); + return res; +} + +inline bool StitchFeature::stitchSurfaces(const core::Ptr& value) +{ + return stitchSurfaces_raw(value.get()); +} + +inline core::Ptr StitchFeature::tolerance() const +{ + core::Ptr res = tolerance_raw(); + return res; +} + +inline FeatureOperations StitchFeature::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool StitchFeature::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr StitchFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr StitchFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_STITCHFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/StitchFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/StitchFeatureInput.h new file mode 100644 index 0000000..c156289 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/StitchFeatureInput.h @@ -0,0 +1,132 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_STITCHFEATUREINPUT_CPP__ +# define ADSK_FUSION_STITCHFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_STITCHFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_STITCHFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a stitch feature. +class StitchFeatureInput : public core::Base { +public: + + /// Gets and sets the surfaces to stitch together. + core::Ptr stitchSurfaces() const; + bool stitchSurfaces(const core::Ptr& value); + + /// Gets and sets the ValueInput object that defines the stitching tolerance. It must define a length. + core::Ptr tolerance() const; + bool tolerance(const core::Ptr& value); + + /// Gets and sets the feature operation to perform. This property value is only valid if the isSolid property returns + /// true. Otherwise the value of this property is ignored. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_STITCHFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_STITCHFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_STITCHFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_STITCHFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* stitchSurfaces_raw() const = 0; + virtual bool stitchSurfaces_raw(core::ObjectCollection* value) = 0; + virtual core::ValueInput* tolerance_raw() const = 0; + virtual bool tolerance_raw(core::ValueInput* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr StitchFeatureInput::stitchSurfaces() const +{ + core::Ptr res = stitchSurfaces_raw(); + return res; +} + +inline bool StitchFeatureInput::stitchSurfaces(const core::Ptr& value) +{ + return stitchSurfaces_raw(value.get()); +} + +inline core::Ptr StitchFeatureInput::tolerance() const +{ + core::Ptr res = tolerance_raw(); + return res; +} + +inline bool StitchFeatureInput::tolerance(const core::Ptr& value) +{ + return tolerance_raw(value.get()); +} + +inline FeatureOperations StitchFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool StitchFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr StitchFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool StitchFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_STITCHFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/StitchFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/StitchFeatures.h new file mode 100644 index 0000000..c714610 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/StitchFeatures.h @@ -0,0 +1,140 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_STITCHFEATURES_CPP__ +# define ADSK_FUSION_STITCHFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_STITCHFEATURES_API +# endif +#else +# define ADSK_FUSION_STITCHFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class StitchFeature; + class StitchFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Stitch features in a component +/// and supports the ability to create new Stitch features. +class StitchFeatures : public core::Base { +public: + + /// Function that returns the specified stitch feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of Stitch features in the collection. + size_t count() const; + + /// Creates a StitchFeatureInput object. Use properties and methods on this object + /// to define the stitch feature you want to create and then use the Add method, passing in + /// the StitchFeatureInput object. + /// stitchSurfaces : The surfaces (open BRepBodies) to stitch together. + /// Stitching surfaces can form multiple closed volumes resulting in multiple solids. + /// Stitch Surfaces can form multiple BRepShells (entirely connected set of entities) that would result in a + /// single non-solid BRepBody. + /// tolerance : ValueInput object that defines the stitching tolerance. It must define a distance value. + /// operation : Specifies the operation type for the result when the final result is a closed solid. Otherwise + /// this argument is ignored. + /// Returns the newly created StitchFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& stitchSurfaces, const core::Ptr& tolerance, FeatureOperations operation = adsk::fusion::NewBodyFeatureOperation) const; + + /// Creates a new stitch feature. + /// input : A StitchFeatureInput object that defines the desired stitch feature. Use the createInput + /// method to create a new StitchFeatureInput object and then use methods on it + /// (the StitchFeatureInput object) to define the stitch feature. + /// Returns the newly created StitchFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified stitch feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef StitchFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_STITCHFEATURES_API static const char* classType(); + ADSK_FUSION_STITCHFEATURES_API const char* objectType() const override; + ADSK_FUSION_STITCHFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_STITCHFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual StitchFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual StitchFeatureInput* createInput_raw(core::ObjectCollection* stitchSurfaces, core::ValueInput* tolerance, FeatureOperations operation) const = 0; + virtual StitchFeature* add_raw(StitchFeatureInput* input) = 0; + virtual StitchFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr StitchFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t StitchFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr StitchFeatures::createInput(const core::Ptr& stitchSurfaces, const core::Ptr& tolerance, FeatureOperations operation) const +{ + core::Ptr res = createInput_raw(stitchSurfaces.get(), tolerance.get(), operation); + return res; +} + +inline core::Ptr StitchFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr StitchFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void StitchFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_STITCHFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SurfaceDeleteFaceFeature.h b/usr/autodesk/CPP/include/Fusion/Features/SurfaceDeleteFaceFeature.h new file mode 100644 index 0000000..8ba80b7 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SurfaceDeleteFaceFeature.h @@ -0,0 +1,120 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SURFACEDELETEFACEFEATURE_CPP__ +# define ADSK_FUSION_SURFACEDELETEFACEFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_SURFACEDELETEFACEFEATURE_API +# endif +#else +# define ADSK_FUSION_SURFACEDELETEFACEFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing Surface Delete Face feature in a design. +/// The SurfaceDeleteFaceFeature and DeleteFaceFeature differ in that the SurfaceDeleteFaceFeature +/// can delete any face without any restrictions. If the body is a solid, it will become a surface +/// when the first face is deleted. The specified face is deleted without any other changes being +/// made to the body. The DeleteFaceFeature deletes the specified face and also modifies the other faces +/// in the body to heal or fill in the area of the deleted face. This means that a solid body will +/// remain solid. +class SurfaceDeleteFaceFeature : public Feature { +public: + + /// Gets and sets the set of faces that are deleted by this feature. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + std::vector> deletedFaces() const; + bool deletedFaces(const std::vector>& value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SURFACEDELETEFACEFEATURE_API static const char* classType(); + ADSK_FUSION_SURFACEDELETEFACEFEATURE_API const char* objectType() const override; + ADSK_FUSION_SURFACEDELETEFACEFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SURFACEDELETEFACEFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace** deletedFaces_raw(size_t& return_size) const = 0; + virtual bool deletedFaces_raw(BRepFace** value, size_t value_size) = 0; + virtual SurfaceDeleteFaceFeature* nativeObject_raw() const = 0; + virtual SurfaceDeleteFaceFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline std::vector> SurfaceDeleteFaceFeature::deletedFaces() const +{ + std::vector> res; + size_t s; + + BRepFace** p= deletedFaces_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool SurfaceDeleteFaceFeature::deletedFaces(const std::vector>& value) +{ + BRepFace** value_ = new BRepFace*[value.size()]; + for(size_t i=0; i SurfaceDeleteFaceFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SurfaceDeleteFaceFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SURFACEDELETEFACEFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SurfaceDeleteFaceFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/SurfaceDeleteFaceFeatures.h new file mode 100644 index 0000000..619f18e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SurfaceDeleteFaceFeatures.h @@ -0,0 +1,121 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SURFACEDELETEFACEFEATURES_CPP__ +# define ADSK_FUSION_SURFACEDELETEFACEFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_SURFACEDELETEFACEFEATURES_API +# endif +#else +# define ADSK_FUSION_SURFACEDELETEFACEFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SurfaceDeleteFaceFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing SurfaceDeleteFaceFeature features in a component +/// and supports the ability to create new SurfaceDeleteFaceFeature features. +/// The SurfaceDeleteFaceFeature and DeleteFaceFeature differ in that the SurfaceDeleteFaceFeature +/// can delete any face without any restrictions. If the body is a solid, it will become a surface +/// when the first face is deleted. The specified face is deleted without any other changes being +/// made to the body. The DeleteFaceFeature deletes the specified face and also modifies the other faces +/// in the body to heal or fill in the area of the deleted face. This means that a solid body will +/// remain solid. +class SurfaceDeleteFaceFeatures : public core::Base { +public: + + /// Function that returns the specified SurfaceDeleteFaceFeature object using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified SurfaceDeleteFaceFeature object using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of SurfaceDeleteFaceFeature objects in the collection. + size_t count() const; + + /// Creates a new SurfaceDeleteFaceFeature feature. This deletes the specified faces + /// from their bodies without any attempt to heal the openings. This is equivalent + /// to selecting and deleting faces when in the Patch workspace. + /// facesToDelete : A single BRepFace or an ObjectCollection containing multiple BRepFace objects. + /// Returns the newly created SurfaceDeleteFaceFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& facesToDelete); + + typedef SurfaceDeleteFaceFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SURFACEDELETEFACEFEATURES_API static const char* classType(); + ADSK_FUSION_SURFACEDELETEFACEFEATURES_API const char* objectType() const override; + ADSK_FUSION_SURFACEDELETEFACEFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SURFACEDELETEFACEFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SurfaceDeleteFaceFeature* item_raw(size_t index) const = 0; + virtual SurfaceDeleteFaceFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual SurfaceDeleteFaceFeature* add_raw(core::Base* facesToDelete) = 0; +}; + +// Inline wrappers + +inline core::Ptr SurfaceDeleteFaceFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr SurfaceDeleteFaceFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t SurfaceDeleteFaceFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SurfaceDeleteFaceFeatures::add(const core::Ptr& facesToDelete) +{ + core::Ptr res = add_raw(facesToDelete.get()); + return res; +} + +template inline void SurfaceDeleteFaceFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SURFACEDELETEFACEFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SweepFeature.h b/usr/autodesk/CPP/include/Fusion/Features/SweepFeature.h new file mode 100644 index 0000000..ab5a093 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SweepFeature.h @@ -0,0 +1,366 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SWEEPFEATURE_CPP__ +# define ADSK_FUSION_SWEEPFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_SWEEPFEATURE_API +# endif +#else +# define ADSK_FUSION_SWEEPFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepFaces; + class ModelParameter; + class Occurrence; + class Path; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing sweep feature in a design. +class SweepFeature : public Feature { +public: + + /// Gets and sets the profiles or planar faces used to define the shape of the sweep. + /// This property can return or be set with a single Profile, a single planar face, or + /// an ObjectCollection consisting of multiple profiles and planar faces. When an + /// ObjectCollection is used all of the profiles and faces must be co-planar. + /// This property returns nothing in the case where the feature is non-parametric. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr profile() const; + bool profile(const core::Ptr& value); + + /// Gets and sets the type of operation performed by the sweep. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets and sets the path to create the sweep. + /// This property returns nothing in the case where the feature is non-parametric. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr path() const; + bool path(const core::Ptr& value); + + /// Gets the distance for the first side. + /// This property returns nothing in the case where the feature is non-parametric. + core::Ptr distanceOne() const; + + /// Gets the distance for the second side. + /// Returns nothing if the path is only on one side of the profile or if the sweep definition includes a guide rail. + /// It's always the distance against the normal of the profile if available. + /// This property returns nothing in the case where the feature is non-parametric. + core::Ptr distanceTwo() const; + + /// Gets and sets the sweep orientation. It defaults to PerpendicularOrientationType. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + SweepOrientationTypes orientation() const; + bool orientation(SweepOrientationTypes value); + + /// Property that returns the set of that cap one end of the sweep that are coincident with the sketch plane. + /// In the cases where there aren't any start faces this property will return Nothing. + core::Ptr startFaces() const; + + /// Property that returns the set of that cap one end of the sweep that are coincident with the sketch plane. + /// The end faces are those not coincident to the sketch plane of the feature's profile. + /// In the case of a symmetric revolution these faces are the ones on the negative normal side of the sketch plane. + /// In the cases where there aren't any end faces this property will return Nothing. + core::Ptr endFaces() const; + + /// Property that returns a object that provides access to all of the faces created around the perimeter of the feature. + core::Ptr sideFaces() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Indicates if this feature was initially created as a solid or a surface. + bool isSolid() const; + + /// Gets and sets the guide rail to create the sweep. This can be set to null + /// to have a path only sweep. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr guideRail() const; + bool guideRail(const core::Ptr& value); + + /// Gets and sets if the direction of the sweep is flipped. + /// This property only applies to sweep features that include a guide rail and whose path runs on both + /// sides of the profile. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isDirectionFlipped() const; + bool isDirectionFlipped(bool value); + + /// Gets and sets the sweep profile scaling option. It defaults to SweepProfileScaleOption. This + /// property is only used when a guide rail has been specified. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + SweepProfileScalingOptions profileScaling() const; + bool profileScaling(SweepProfileScalingOptions value); + + /// Gets and sets the list of bodies that will participate in the feature when the operation is a cut or intersection. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + std::vector> participantBodies() const; + bool participantBodies(const std::vector>& value); + + /// Gets the ModelParameter that defines the taper angle of the sweep feature. + /// The value of the angle can be edited by using the properties on the ModelParameter object to edit the parameter. + core::Ptr taperAngle() const; + + /// Gets the ModelParameter that defines the twist angle of the sweep feature. + /// The value of the angle can be edited by using the properties on the ModelParameter object to edit the parameter. + core::Ptr twistAngle() const; + + /// Gets and sets the sweep extent type. It defaults to PerpendicularToPathExtentType. + /// This property is ignored when a guide rail has not been specified. + SweepExtentTypes extent() const; + bool extent(SweepExtentTypes value); + + ADSK_FUSION_SWEEPFEATURE_API static const char* classType(); + ADSK_FUSION_SWEEPFEATURE_API const char* objectType() const override; + ADSK_FUSION_SWEEPFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SWEEPFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* profile_raw() const = 0; + virtual bool profile_raw(core::Base* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual Path* path_raw() const = 0; + virtual bool path_raw(Path* value) = 0; + virtual ModelParameter* distanceOne_raw() const = 0; + virtual ModelParameter* distanceTwo_raw() const = 0; + virtual SweepOrientationTypes orientation_raw() const = 0; + virtual bool orientation_raw(SweepOrientationTypes value) = 0; + virtual BRepFaces* startFaces_raw() const = 0; + virtual BRepFaces* endFaces_raw() const = 0; + virtual BRepFaces* sideFaces_raw() const = 0; + virtual SweepFeature* nativeObject_raw() const = 0; + virtual SweepFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual bool isSolid_raw() const = 0; + virtual Path* guideRail_raw() const = 0; + virtual bool guideRail_raw(Path* value) = 0; + virtual bool isDirectionFlipped_raw() const = 0; + virtual bool isDirectionFlipped_raw(bool value) = 0; + virtual SweepProfileScalingOptions profileScaling_raw() const = 0; + virtual bool profileScaling_raw(SweepProfileScalingOptions value) = 0; + virtual BRepBody** participantBodies_raw(size_t& return_size) const = 0; + virtual bool participantBodies_raw(BRepBody** value, size_t value_size) = 0; + virtual ModelParameter* taperAngle_raw() const = 0; + virtual ModelParameter* twistAngle_raw() const = 0; + virtual SweepExtentTypes extent_raw() const = 0; + virtual bool extent_raw(SweepExtentTypes value) = 0; +}; + +// Inline wrappers + +inline core::Ptr SweepFeature::profile() const +{ + core::Ptr res = profile_raw(); + return res; +} + +inline bool SweepFeature::profile(const core::Ptr& value) +{ + return profile_raw(value.get()); +} + +inline FeatureOperations SweepFeature::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool SweepFeature::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr SweepFeature::path() const +{ + core::Ptr res = path_raw(); + return res; +} + +inline bool SweepFeature::path(const core::Ptr& value) +{ + return path_raw(value.get()); +} + +inline core::Ptr SweepFeature::distanceOne() const +{ + core::Ptr res = distanceOne_raw(); + return res; +} + +inline core::Ptr SweepFeature::distanceTwo() const +{ + core::Ptr res = distanceTwo_raw(); + return res; +} + +inline SweepOrientationTypes SweepFeature::orientation() const +{ + SweepOrientationTypes res = orientation_raw(); + return res; +} + +inline bool SweepFeature::orientation(SweepOrientationTypes value) +{ + return orientation_raw(value); +} + +inline core::Ptr SweepFeature::startFaces() const +{ + core::Ptr res = startFaces_raw(); + return res; +} + +inline core::Ptr SweepFeature::endFaces() const +{ + core::Ptr res = endFaces_raw(); + return res; +} + +inline core::Ptr SweepFeature::sideFaces() const +{ + core::Ptr res = sideFaces_raw(); + return res; +} + +inline core::Ptr SweepFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SweepFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline bool SweepFeature::isSolid() const +{ + bool res = isSolid_raw(); + return res; +} + +inline core::Ptr SweepFeature::guideRail() const +{ + core::Ptr res = guideRail_raw(); + return res; +} + +inline bool SweepFeature::guideRail(const core::Ptr& value) +{ + return guideRail_raw(value.get()); +} + +inline bool SweepFeature::isDirectionFlipped() const +{ + bool res = isDirectionFlipped_raw(); + return res; +} + +inline bool SweepFeature::isDirectionFlipped(bool value) +{ + return isDirectionFlipped_raw(value); +} + +inline SweepProfileScalingOptions SweepFeature::profileScaling() const +{ + SweepProfileScalingOptions res = profileScaling_raw(); + return res; +} + +inline bool SweepFeature::profileScaling(SweepProfileScalingOptions value) +{ + return profileScaling_raw(value); +} + +inline std::vector> SweepFeature::participantBodies() const +{ + std::vector> res; + size_t s; + + BRepBody** p= participantBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool SweepFeature::participantBodies(const std::vector>& value) +{ + BRepBody** value_ = new BRepBody*[value.size()]; + for(size_t i=0; i SweepFeature::taperAngle() const +{ + core::Ptr res = taperAngle_raw(); + return res; +} + +inline core::Ptr SweepFeature::twistAngle() const +{ + core::Ptr res = twistAngle_raw(); + return res; +} + +inline SweepExtentTypes SweepFeature::extent() const +{ + SweepExtentTypes res = extent_raw(); + return res; +} + +inline bool SweepFeature::extent(SweepExtentTypes value) +{ + return extent_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SWEEPFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SweepFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/SweepFeatureInput.h new file mode 100644 index 0000000..7196741 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SweepFeatureInput.h @@ -0,0 +1,381 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SWEEPFEATUREINPUT_CPP__ +# define ADSK_FUSION_SWEEPFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_SWEEPFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_SWEEPFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepBody; + class Occurrence; + class Path; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a sweep +/// feature. +class SweepFeatureInput : public core::Base { +public: + + /// Gets and sets the profiles or planar faces used to define the shape of the sweep. + /// This property can return or be set with a single Profile, a single planar face, or + /// an ObjectCollection consisting of multiple profiles and planar faces. When an + /// ObjectCollection is used all of the profiles and faces must be co-planar. + core::Ptr profile() const; + bool profile(const core::Ptr& value); + + /// Gets and sets the type of operation performed by the sweep. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Gets and sets the path to create the sweep. + core::Ptr path() const; + bool path(const core::Ptr& value); + + /// Gets and sets the distance for the first side. + /// The distance is a value from 0 to 1 indicating the position along the path where 0 + /// is at the start and 1 is at the end. The value is default to 1.0. + core::Ptr distanceOne() const; + bool distanceOne(const core::Ptr& value); + + /// Gets and sets the distance for the second side. + /// The distance is a value from 0 to 1 indicating the position along the path where 0 + /// is at the start and 1 is at the end. The value defaults to 0 in the case where the path is closed, otherwise it defaults to 1.0. + /// It is ignored if the path is only on one side of the profile or if the sweep definition includes a guide rail. + /// It's always the distance against the normal of the profile if available. + core::Ptr distanceTwo() const; + bool distanceTwo(const core::Ptr& value); + + /// Gets and sets the sweep orientation. It defaults to PerpendicularOrientationType. + /// This property is ignored when a guide rail has been specified. + SweepOrientationTypes orientation() const; + bool orientation(SweepOrientationTypes value); + + /// In order for geometry to be transformed correctly, an Occurrence for creation needs to be + /// specified when the sweep is created based on geometry (e.g. a profile and/or face(s)) + /// in another component AND (the sweep) is not in the root component. + /// The CreationOccurrence is analogous to the active occurrence in the UI + core::Ptr creationOccurrence() const; + bool creationOccurrence(const core::Ptr& value); + + /// Specifies if the sweep should be created as a solid or surface. If + /// it's a surface then there aren't any end caps and it's open. This is + /// initialized to true so a solid will be created if it's not changed. + bool isSolid() const; + bool isSolid(bool value); + + /// Gets and sets the guide rail to create the sweep. This can be set to + /// null to remove the guide rail definition and have a single path sweep feature. + core::Ptr guideRail() const; + bool guideRail(const core::Ptr& value); + + /// Gets and sets if the direction of the sweep is flipped. + /// This property only applies to sweep features that include a guide rail and whose path runs on both + /// sides of the profile. + bool isDirectionFlipped() const; + bool isDirectionFlipped(bool value); + + /// Gets and sets the sweep profile scaling option. It defaults to SweepProfileScaleOption. + /// This property is only used when a guide rail has been specified. + SweepProfileScalingOptions profileScaling() const; + bool profileScaling(SweepProfileScalingOptions value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// Gets and sets the list of bodies that will participate in the feature when the operation is a cut or intersection. + /// If this property has not been set, the default behavior is that all bodies that are intersected by the + /// feature will participate. + /// This property can return null in the case where the feature has not been fully defined so that + /// possible intersecting bodies can be computed. + std::vector> participantBodies() const; + bool participantBodies(const std::vector>& value); + + /// Gets and sets the taper angle of the sweep. This property is initialized with a taper angle of zero. + /// A negative angle will taper the sweep inward while a positive value will taper + /// the sweep outward. This property is valid for both parametric and non-parametric extrusions. + core::Ptr taperAngle() const; + bool taperAngle(const core::Ptr& value); + + /// Gets and sets the taper angle of the sweep. This property is initialized with a taper angle of zero. + /// A negative angle will taper the sweep inward while a positive value will taper + /// the sweep outward. This property is valid for both parametric and non-parametric extrusions. + core::Ptr twistAngle() const; + bool twistAngle(const core::Ptr& value); + + /// Gets and sets the sweep extent type. It defaults to PerpendicularToPathExtentType. + /// This property is ignored when a guide rail has not been specified. + SweepExtentTypes extent() const; + bool extent(SweepExtentTypes value); + + ADSK_FUSION_SWEEPFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_SWEEPFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_SWEEPFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SWEEPFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* profile_raw() const = 0; + virtual bool profile_raw(core::Base* value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual Path* path_raw() const = 0; + virtual bool path_raw(Path* value) = 0; + virtual core::ValueInput* distanceOne_raw() const = 0; + virtual bool distanceOne_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* distanceTwo_raw() const = 0; + virtual bool distanceTwo_raw(core::ValueInput* value) = 0; + virtual SweepOrientationTypes orientation_raw() const = 0; + virtual bool orientation_raw(SweepOrientationTypes value) = 0; + virtual Occurrence* creationOccurrence_raw() const = 0; + virtual bool creationOccurrence_raw(Occurrence* value) = 0; + virtual bool isSolid_raw() const = 0; + virtual bool isSolid_raw(bool value) = 0; + virtual Path* guideRail_raw() const = 0; + virtual bool guideRail_raw(Path* value) = 0; + virtual bool isDirectionFlipped_raw() const = 0; + virtual bool isDirectionFlipped_raw(bool value) = 0; + virtual SweepProfileScalingOptions profileScaling_raw() const = 0; + virtual bool profileScaling_raw(SweepProfileScalingOptions value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual BRepBody** participantBodies_raw(size_t& return_size) const = 0; + virtual bool participantBodies_raw(BRepBody** value, size_t value_size) = 0; + virtual core::ValueInput* taperAngle_raw() const = 0; + virtual bool taperAngle_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* twistAngle_raw() const = 0; + virtual bool twistAngle_raw(core::ValueInput* value) = 0; + virtual SweepExtentTypes extent_raw() const = 0; + virtual bool extent_raw(SweepExtentTypes value) = 0; +}; + +// Inline wrappers + +inline core::Ptr SweepFeatureInput::profile() const +{ + core::Ptr res = profile_raw(); + return res; +} + +inline bool SweepFeatureInput::profile(const core::Ptr& value) +{ + return profile_raw(value.get()); +} + +inline FeatureOperations SweepFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool SweepFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline core::Ptr SweepFeatureInput::path() const +{ + core::Ptr res = path_raw(); + return res; +} + +inline bool SweepFeatureInput::path(const core::Ptr& value) +{ + return path_raw(value.get()); +} + +inline core::Ptr SweepFeatureInput::distanceOne() const +{ + core::Ptr res = distanceOne_raw(); + return res; +} + +inline bool SweepFeatureInput::distanceOne(const core::Ptr& value) +{ + return distanceOne_raw(value.get()); +} + +inline core::Ptr SweepFeatureInput::distanceTwo() const +{ + core::Ptr res = distanceTwo_raw(); + return res; +} + +inline bool SweepFeatureInput::distanceTwo(const core::Ptr& value) +{ + return distanceTwo_raw(value.get()); +} + +inline SweepOrientationTypes SweepFeatureInput::orientation() const +{ + SweepOrientationTypes res = orientation_raw(); + return res; +} + +inline bool SweepFeatureInput::orientation(SweepOrientationTypes value) +{ + return orientation_raw(value); +} + +inline core::Ptr SweepFeatureInput::creationOccurrence() const +{ + core::Ptr res = creationOccurrence_raw(); + return res; +} + +inline bool SweepFeatureInput::creationOccurrence(const core::Ptr& value) +{ + return creationOccurrence_raw(value.get()); +} + +inline bool SweepFeatureInput::isSolid() const +{ + bool res = isSolid_raw(); + return res; +} + +inline bool SweepFeatureInput::isSolid(bool value) +{ + return isSolid_raw(value); +} + +inline core::Ptr SweepFeatureInput::guideRail() const +{ + core::Ptr res = guideRail_raw(); + return res; +} + +inline bool SweepFeatureInput::guideRail(const core::Ptr& value) +{ + return guideRail_raw(value.get()); +} + +inline bool SweepFeatureInput::isDirectionFlipped() const +{ + bool res = isDirectionFlipped_raw(); + return res; +} + +inline bool SweepFeatureInput::isDirectionFlipped(bool value) +{ + return isDirectionFlipped_raw(value); +} + +inline SweepProfileScalingOptions SweepFeatureInput::profileScaling() const +{ + SweepProfileScalingOptions res = profileScaling_raw(); + return res; +} + +inline bool SweepFeatureInput::profileScaling(SweepProfileScalingOptions value) +{ + return profileScaling_raw(value); +} + +inline core::Ptr SweepFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool SweepFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline std::vector> SweepFeatureInput::participantBodies() const +{ + std::vector> res; + size_t s; + + BRepBody** p= participantBodies_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool SweepFeatureInput::participantBodies(const std::vector>& value) +{ + BRepBody** value_ = new BRepBody*[value.size()]; + for(size_t i=0; i SweepFeatureInput::taperAngle() const +{ + core::Ptr res = taperAngle_raw(); + return res; +} + +inline bool SweepFeatureInput::taperAngle(const core::Ptr& value) +{ + return taperAngle_raw(value.get()); +} + +inline core::Ptr SweepFeatureInput::twistAngle() const +{ + core::Ptr res = twistAngle_raw(); + return res; +} + +inline bool SweepFeatureInput::twistAngle(const core::Ptr& value) +{ + return twistAngle_raw(value.get()); +} + +inline SweepExtentTypes SweepFeatureInput::extent() const +{ + SweepExtentTypes res = extent_raw(); + return res; +} + +inline bool SweepFeatureInput::extent(SweepExtentTypes value) +{ + return extent_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SWEEPFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SweepFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/SweepFeatures.h new file mode 100644 index 0000000..05afd51 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SweepFeatures.h @@ -0,0 +1,135 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SWEEPFEATURES_CPP__ +# define ADSK_FUSION_SWEEPFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_SWEEPFEATURES_API +# endif +#else +# define ADSK_FUSION_SWEEPFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Path; + class SweepFeature; + class SweepFeatureInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing sweep features in a component +/// and supports the ability to create new sweep features. +class SweepFeatures : public core::Base { +public: + + /// Function that returns the specified sweep feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of sweep features in the collection. + size_t count() const; + + /// Creates a SweepFeatureInput object for defining a simple sweep feature with only a path and no guide rail. + /// Use properties and methods on this object to define the sweep you want to create and then use the Add method, + /// passing in the SweepFeatureInput object. + /// profile : The profile argument can be a single Profile, a single + /// planar face, or an ObjectCollection consisting of multiple profiles and planar faces. + /// When an ObjectCollection is used all of the profiles and faces must be co-planar. + /// path : The path to create the sweep. + /// operation : The feature operation to perform + /// Returns the newly created SweepFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& profile, const core::Ptr& path, FeatureOperations operation) const; + + /// Creates a new sweep feature. + /// input : A SweepFeatureInput object that defines the desired sweep. Use the createInput + /// method to create a new SweepFeatureInput object and then use methods on it + /// (the SweepFeatureInput object) to define the sweep. + /// Returns the newly created SweepFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified sweep feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef SweepFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SWEEPFEATURES_API static const char* classType(); + ADSK_FUSION_SWEEPFEATURES_API const char* objectType() const override; + ADSK_FUSION_SWEEPFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SWEEPFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SweepFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SweepFeatureInput* createInput_raw(core::Base* profile, Path* path, FeatureOperations operation) const = 0; + virtual SweepFeature* add_raw(SweepFeatureInput* input) = 0; + virtual SweepFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SweepFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SweepFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SweepFeatures::createInput(const core::Ptr& profile, const core::Ptr& path, FeatureOperations operation) const +{ + core::Ptr res = createInput_raw(profile.get(), path.get(), operation); + return res; +} + +inline core::Ptr SweepFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr SweepFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void SweepFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SWEEPFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/SymmetricExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/SymmetricExtentDefinition.h new file mode 100644 index 0000000..5e0c4d8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/SymmetricExtentDefinition.h @@ -0,0 +1,111 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SYMMETRICEXTENTDEFINITION_CPP__ +# define ADSK_FUSION_SYMMETRICEXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_SYMMETRICEXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_SYMMETRICEXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// A definition object that is used to define the extents of a feature to be symmetric. +class SymmetricExtentDefinition : public ExtentDefinition { +public: + + /// Statically creates a new SymmetricExtentDefinition object. This is used as input when + /// create a new feature and defining the starting condition. + /// distance : An input ValueInput objects that defines either half the extent of the extrude or the full extent, depending + /// on the value of the isFullLength argument. + /// isFullLength : An input boolean that specifies if the distance specified defines the full or half length of the extrusion. + /// Returns the newly created SymmetricExtentDefinition or null in the case of a failure. + static core::Ptr create(const core::Ptr& distance, bool isFullLength); + + /// Gets and sets if the distance defines the full extent length or half the length. A value of + /// True indicates if defines the full length. + bool isFullLength() const; + bool isFullLength(bool value); + + /// Returns the current extent distance. If the SymmetricExtentDefinition object has been created statically and isn't associated with + /// a feature this will return a ValueInput object. If the SymmetricExtentDefinition object is obtained from a feature this + /// will return a ModelParameter object. You can use properties of the parameter to edit it's value which will result in + /// the feature updating. + core::Ptr distance() const; + + /// Returns the current taper angle. If the SymmetricExtentDefinition object has been created statically and isn't associated with + /// a feature this will return a ValueInput object. If the SymmetricExtentDefinition object is obtained from a feature this + /// will return a ModelParameter object. You can use properties of the parameter to edit it's value which will result in + /// the feature updating. + core::Ptr taperAngle() const; + + ADSK_FUSION_SYMMETRICEXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_SYMMETRICEXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_SYMMETRICEXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SYMMETRICEXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_SYMMETRICEXTENTDEFINITION_API static SymmetricExtentDefinition* create_raw(core::ValueInput* distance, bool isFullLength); + virtual bool isFullLength_raw() const = 0; + virtual bool isFullLength_raw(bool value) = 0; + virtual core::Base* distance_raw() const = 0; + virtual core::Base* taperAngle_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SymmetricExtentDefinition::create(const core::Ptr& distance, bool isFullLength) +{ + core::Ptr res = create_raw(distance.get(), isFullLength); + return res; +} + +inline bool SymmetricExtentDefinition::isFullLength() const +{ + bool res = isFullLength_raw(); + return res; +} + +inline bool SymmetricExtentDefinition::isFullLength(bool value) +{ + return isFullLength_raw(value); +} + +inline core::Ptr SymmetricExtentDefinition::distance() const +{ + core::Ptr res = distance_raw(); + return res; +} + +inline core::Ptr SymmetricExtentDefinition::taperAngle() const +{ + core::Ptr res = taperAngle_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SYMMETRICEXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ThickenFeature.h b/usr/autodesk/CPP/include/Fusion/Features/ThickenFeature.h new file mode 100644 index 0000000..84777bf --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ThickenFeature.h @@ -0,0 +1,179 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_THICKENFEATURE_CPP__ +# define ADSK_FUSION_THICKENFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_THICKENFEATURE_API +# endif +#else +# define ADSK_FUSION_THICKENFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing Thicken feature in a design. +class ThickenFeature : public Feature { +public: + + /// Sets the faces and patch bodies to thicken. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// inputFaces : The faces or patch bodies to thicken. Faces need not be from the same component or body, nor do they need to be + /// connected or touching one another. + /// isChainSelection : A boolean value for setting whether or not faces that are tangentially connected to + /// the input faces (if any) will be included in the offset. The default value is true. + /// Returns true if successful + bool setInputEntities(const core::Ptr& inputFaces, bool isChainSelection = true); + + /// Gets and sets the ObjectCollection containing the face and/or patch bodies to thicken. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr inputFaces() const; + bool inputFaces(const core::Ptr& value); + + /// Returns the parameter controlling the thickness. You can edit the thickness value + /// by editing the value of the parameter object. + core::Ptr thickness() const; + + /// Gets and sets whether to add thickness symmetrically or only on one side of the face/s to thicken. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isSymmetric() const; + bool isSymmetric(bool value); + + /// Gets and sets the feature operation to perform. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Get and sets whether faces that are tangentially connected to the input faces will be included in the thicken feature. + bool isChainSelection() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_THICKENFEATURE_API static const char* classType(); + ADSK_FUSION_THICKENFEATURE_API const char* objectType() const override; + ADSK_FUSION_THICKENFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_THICKENFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setInputEntities_raw(core::ObjectCollection* inputFaces, bool isChainSelection) = 0; + virtual core::ObjectCollection* inputFaces_raw() const = 0; + virtual bool inputFaces_raw(core::ObjectCollection* value) = 0; + virtual ModelParameter* thickness_raw() const = 0; + virtual bool isSymmetric_raw() const = 0; + virtual bool isSymmetric_raw(bool value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual bool isChainSelection_raw() const = 0; + virtual ThickenFeature* nativeObject_raw() const = 0; + virtual ThickenFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline bool ThickenFeature::setInputEntities(const core::Ptr& inputFaces, bool isChainSelection) +{ + bool res = setInputEntities_raw(inputFaces.get(), isChainSelection); + return res; +} + +inline core::Ptr ThickenFeature::inputFaces() const +{ + core::Ptr res = inputFaces_raw(); + return res; +} + +inline bool ThickenFeature::inputFaces(const core::Ptr& value) +{ + return inputFaces_raw(value.get()); +} + +inline core::Ptr ThickenFeature::thickness() const +{ + core::Ptr res = thickness_raw(); + return res; +} + +inline bool ThickenFeature::isSymmetric() const +{ + bool res = isSymmetric_raw(); + return res; +} + +inline bool ThickenFeature::isSymmetric(bool value) +{ + return isSymmetric_raw(value); +} + +inline FeatureOperations ThickenFeature::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool ThickenFeature::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline bool ThickenFeature::isChainSelection() const +{ + bool res = isChainSelection_raw(); + return res; +} + +inline core::Ptr ThickenFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ThickenFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_THICKENFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ThickenFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/ThickenFeatureInput.h new file mode 100644 index 0000000..e2b10bc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ThickenFeatureInput.h @@ -0,0 +1,165 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_THICKENFEATUREINPUT_CPP__ +# define ADSK_FUSION_THICKENFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_THICKENFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_THICKENFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a Thicken feature. +class ThickenFeatureInput : public core::Base { +public: + + /// An ObjectCollection containing the face and/or patch bodies to thicken. + core::Ptr inputFaces() const; + bool inputFaces(const core::Ptr& value); + + /// Gets and sets the ValueInput object that defines the thickness distance. + core::Ptr thickness() const; + bool thickness(const core::Ptr& value); + + /// Gets and sets whether to add thickness symmetrically or only on one side of the face/s to thicken + bool isSymmetric() const; + bool isSymmetric(bool value); + + /// Gets and sets the feature operation to perform. + FeatureOperations operation() const; + bool operation(FeatureOperations value); + + /// Get and sets whether faces that are tangentially connected to the input faces will be included in the thicken feature. + bool isChainSelection() const; + bool isChainSelection(bool value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_THICKENFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_THICKENFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_THICKENFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_THICKENFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* inputFaces_raw() const = 0; + virtual bool inputFaces_raw(core::ObjectCollection* value) = 0; + virtual core::ValueInput* thickness_raw() const = 0; + virtual bool thickness_raw(core::ValueInput* value) = 0; + virtual bool isSymmetric_raw() const = 0; + virtual bool isSymmetric_raw(bool value) = 0; + virtual FeatureOperations operation_raw() const = 0; + virtual bool operation_raw(FeatureOperations value) = 0; + virtual bool isChainSelection_raw() const = 0; + virtual bool isChainSelection_raw(bool value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ThickenFeatureInput::inputFaces() const +{ + core::Ptr res = inputFaces_raw(); + return res; +} + +inline bool ThickenFeatureInput::inputFaces(const core::Ptr& value) +{ + return inputFaces_raw(value.get()); +} + +inline core::Ptr ThickenFeatureInput::thickness() const +{ + core::Ptr res = thickness_raw(); + return res; +} + +inline bool ThickenFeatureInput::thickness(const core::Ptr& value) +{ + return thickness_raw(value.get()); +} + +inline bool ThickenFeatureInput::isSymmetric() const +{ + bool res = isSymmetric_raw(); + return res; +} + +inline bool ThickenFeatureInput::isSymmetric(bool value) +{ + return isSymmetric_raw(value); +} + +inline FeatureOperations ThickenFeatureInput::operation() const +{ + FeatureOperations res = operation_raw(); + return res; +} + +inline bool ThickenFeatureInput::operation(FeatureOperations value) +{ + return operation_raw(value); +} + +inline bool ThickenFeatureInput::isChainSelection() const +{ + bool res = isChainSelection_raw(); + return res; +} + +inline bool ThickenFeatureInput::isChainSelection(bool value) +{ + return isChainSelection_raw(value); +} + +inline core::Ptr ThickenFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool ThickenFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_THICKENFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ThickenFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/ThickenFeatures.h new file mode 100644 index 0000000..028b4b2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ThickenFeatures.h @@ -0,0 +1,140 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_THICKENFEATURES_CPP__ +# define ADSK_FUSION_THICKENFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_THICKENFEATURES_API +# endif +#else +# define ADSK_FUSION_THICKENFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ThickenFeature; + class ThickenFeatureInput; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Thicken features in a component +/// and supports the ability to create new Thicken features. +class ThickenFeatures : public core::Base { +public: + + /// Function that returns the specified Thicken feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of Thicken features in the collection. + size_t count() const; + + /// Creates a ThickenFeatureInput object. Use properties and methods on this object + /// to define the Thicken feature you want to create and then use the Add method, passing in + /// the ThickenFeatureInput object to create the feature. + /// inputFaces : The faces or patch bodies to thicken. Faces need not be from the same component or body, nor do they need to be + /// connected or touching one another. + /// thickness : ValueInput object that defines the thickness. + /// isSymmetric : A boolean value for setting whether to add thickness symmetrically or only on one side of the face/s to thicken + /// operation : The feature operation to perform. + /// isChainSelection : A boolean value for setting whether or not faces that are tangentially connected to + /// the input faces (if any) will be included in the thicken. The default value is true. + /// Returns the newly created ThickenFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& inputFaces, const core::Ptr& thickness, bool isSymmetric, FeatureOperations operation, bool isChainSelection = true) const; + + /// Creates a new Thicken feature. + /// input : A FeatureInput object that defines the desired Thicken feature. Use the createInput + /// method to create a new ThickenFeatureInput object and then use methods on it + /// (the ThickenFeatureInput object) to define the Thicken feature. + /// Returns the newly created ThickenFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified thicken feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef ThickenFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_THICKENFEATURES_API static const char* classType(); + ADSK_FUSION_THICKENFEATURES_API const char* objectType() const override; + ADSK_FUSION_THICKENFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_THICKENFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ThickenFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual ThickenFeatureInput* createInput_raw(core::ObjectCollection* inputFaces, core::ValueInput* thickness, bool isSymmetric, FeatureOperations operation, bool isChainSelection) const = 0; + virtual ThickenFeature* add_raw(ThickenFeatureInput* input) = 0; + virtual ThickenFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ThickenFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ThickenFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ThickenFeatures::createInput(const core::Ptr& inputFaces, const core::Ptr& thickness, bool isSymmetric, FeatureOperations operation, bool isChainSelection) const +{ + core::Ptr res = createInput_raw(inputFaces.get(), thickness.get(), isSymmetric, operation, isChainSelection); + return res; +} + +inline core::Ptr ThickenFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ThickenFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void ThickenFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_THICKENFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ThreadDataQuery.h b/usr/autodesk/CPP/include/Fusion/Features/ThreadDataQuery.h new file mode 100644 index 0000000..8091d12 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ThreadDataQuery.h @@ -0,0 +1,267 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_THREADDATAQUERY_CPP__ +# define ADSK_FUSION_THREADDATAQUERY_API XI_EXPORT +# else +# define ADSK_FUSION_THREADDATAQUERY_API +# endif +#else +# define ADSK_FUSION_THREADDATAQUERY_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// This object provides methods to query the thread data contained in the XML files in ThreadData folder within the +/// Fusion 360 install folder. You can use the queried values to create a ThreadInfo object that is then used to +/// create a thread feature. +class ThreadDataQuery : public core::Base { +public: + + /// Returns an array/list of all the available thread types (families). + std::vector allThreadTypes() const; + + /// Returns an array/list of all the available thread sizes for a given thread type. You can + /// use the allThreadTypes property to get the available thread types. + /// threadType : Specify the thread type. + /// Returns the specified thread sizes or an empty array/list if an invalid thread type was specified. + std::vector allSizes(const std::string& threadType) const; + + /// returns an array/list of all the available thread designations for a thread type of a given size. Valid + /// thread types and sizes and be obtained by using the allThreadTypes and allSizes functions. + /// threadType : The thread type of the designation you want. + /// size : The thread size of the designation you want. + /// Returns the specified thread designations or empty array/list if an invalid thread type or size was specified. + std::vector allDesignations(const std::string& threadType, const std::string& size) const; + + /// Returns and array/list of all the available classes for a thread type of a given thread designation. + /// isInternal : Indicates if the thread is an internal or external thread. + /// threadType : The thread type of the thread class you want. + /// designation : The thread designation of the thread class you want. + /// Returns the specified thread classes or empty array/list if an invalid thread type or designation was specified. + std::vector allClasses(bool isInternal, const std::string& threadType, const std::string& designation) const; + + /// Method that returns the custom name for a given thread type. + /// threadType : The thread type you want to get the custom name for. + /// Returns the specified custom name or an empty string if an invalid thread type was specified. + std::string threadTypeCustomName(const std::string& threadType) const; + + /// Method that returns the unit for a given thread type. + /// threadType : The thread type you want to get the thread unit type for. + /// Returns the specified unit or an empty string if an invalid thread type was specified. + std::string threadTypeUnit(const std::string& threadType) const; + + /// Method that gets the recommended thread data for a given model diameter. + /// modelDiameter : The diameter of the cylinder the thread will be placed on. The units are centimeters. + /// isInternal : Indicates if the thread is an internal or external thread. + /// threadType : Specifies the thread type to query the thread data. + /// designation : The output thread designation. + /// threadClass : The output thread class. + /// Returns true if successful. + bool recommendThreadData(double modelDiameter, bool isInternal, const std::string& threadType, std::string& designation, std::string& threadClass) const; + + /// Gets the default thread type for inch threads. + std::string defaultInchThreadType() const; + + /// Gets the default thread type for metric threads. + std::string defaultMetricThreadType() const; + + ADSK_FUSION_THREADDATAQUERY_API static const char* classType(); + ADSK_FUSION_THREADDATAQUERY_API const char* objectType() const override; + ADSK_FUSION_THREADDATAQUERY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_THREADDATAQUERY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char** allThreadTypes_raw(size_t& return_size) const = 0; + virtual char** allSizes_raw(const char * threadType, size_t& return_size) const = 0; + virtual char** allDesignations_raw(const char * threadType, const char * size, size_t& return_size) const = 0; + virtual char** allClasses_raw(bool isInternal, const char * threadType, const char * designation, size_t& return_size) const = 0; + virtual char* threadTypeCustomName_raw(const char * threadType) const = 0; + virtual char* threadTypeUnit_raw(const char * threadType) const = 0; + virtual bool recommendThreadData_raw(double modelDiameter, bool isInternal, const char * threadType, char*& designation, char*& threadClass) const = 0; + virtual char* defaultInchThreadType_raw() const = 0; + virtual char* defaultMetricThreadType_raw() const = 0; +}; + +// Inline wrappers + +inline std::vector ThreadDataQuery::allThreadTypes() const +{ + std::vector res; + size_t s; + + char** p= allThreadTypes_raw(s); + if(p) + { + res.resize(s); + for(size_t i=0; i ThreadDataQuery::allSizes(const std::string& threadType) const +{ + std::vector res; + size_t s; + + char** p= allSizes_raw(threadType.c_str(), s); + if(p) + { + res.resize(s); + for(size_t i=0; i ThreadDataQuery::allDesignations(const std::string& threadType, const std::string& size) const +{ + std::vector res; + size_t s; + + char** p= allDesignations_raw(threadType.c_str(), size.c_str(), s); + if(p) + { + res.resize(s); + for(size_t i=0; i ThreadDataQuery::allClasses(bool isInternal, const std::string& threadType, const std::string& designation) const +{ + std::vector res; + size_t s; + + char** p= allClasses_raw(isInternal, threadType.c_str(), designation.c_str(), s); + if(p) + { + res.resize(s); + for(size_t i=0; i inputCylindricalFace() const; + bool inputCylindricalFace(const core::Ptr& value); + + /// Gets and sets if the thread is physical or cosmetic thread. A value of true indicates a physical thread. + /// It defaults to false. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isModeled() const; + bool isModeled(bool value); + + /// Gets and sets if this thread is the full length of the cylinder. + /// It only can be set to true. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isFullLength() const; + bool isFullLength(bool value); + + /// Sets the thread offset, length and location. + /// Calling this method will cause the isFullLength property to be set to false. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// threadOffset : A ValueInput object that defines the thread offset. + /// threadLength : A ValueInput object that defines the thread length. + /// threadLocation : Indicates where the thread length is measured from. + /// Returns true if successful. + bool setThreadOffsetLength(const core::Ptr& threadOffset, const core::Ptr& threadLength, ThreadLocations threadLocation); + + /// Gets the parameter that controls the depth of the thread. + /// Even though the parameter for the thread depth is always created and accessible through this property, + /// it is only used in the case where the isFullLength property is false. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr threadLength() const; + + /// Gets the parameter that controls the offset value of the thread. + /// The offset is the distance along the axis of the cylinder from the edge to the start of the thread, + /// it is only used in the case where the isFullLength property is false. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr threadOffset() const; + + /// Gets and sets where the thread length is measured from. + /// This property is only used in the case where the isFullLength property is false. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + ThreadLocations threadLocation() const; + bool threadLocation(ThreadLocations value); + + /// Gets and sets the thread data. + /// Also can edit the thread through the properties and methods on the ThreadInfo object. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr threadInfo() const; + bool threadInfo(const core::Ptr& value); + + /// Gets and sets if the thread is right or left-handed thread. A value of true indicates a right-handed thread. + /// It defaults to true. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isRightHanded() const; + bool isRightHanded(bool value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Gets and sets the cylindrical input faces. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr inputCylindricalFaces() const; + bool inputCylindricalFaces(const core::Ptr& value); + + ADSK_FUSION_THREADFEATURE_API static const char* classType(); + ADSK_FUSION_THREADFEATURE_API const char* objectType() const override; + ADSK_FUSION_THREADFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_THREADFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace* inputCylindricalFace_raw() const = 0; + virtual bool inputCylindricalFace_raw(BRepFace* value) = 0; + virtual bool isModeled_raw() const = 0; + virtual bool isModeled_raw(bool value) = 0; + virtual bool isFullLength_raw() const = 0; + virtual bool isFullLength_raw(bool value) = 0; + virtual bool setThreadOffsetLength_raw(core::ValueInput* threadOffset, core::ValueInput* threadLength, ThreadLocations threadLocation) = 0; + virtual ModelParameter* threadLength_raw() const = 0; + virtual ModelParameter* threadOffset_raw() const = 0; + virtual ThreadLocations threadLocation_raw() const = 0; + virtual bool threadLocation_raw(ThreadLocations value) = 0; + virtual ThreadInfo* threadInfo_raw() const = 0; + virtual bool threadInfo_raw(ThreadInfo* value) = 0; + virtual bool isRightHanded_raw() const = 0; + virtual bool isRightHanded_raw(bool value) = 0; + virtual ThreadFeature* nativeObject_raw() const = 0; + virtual ThreadFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual core::ObjectCollection* inputCylindricalFaces_raw() const = 0; + virtual bool inputCylindricalFaces_raw(core::ObjectCollection* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ThreadFeature::inputCylindricalFace() const +{ + core::Ptr res = inputCylindricalFace_raw(); + return res; +} + +inline bool ThreadFeature::inputCylindricalFace(const core::Ptr& value) +{ + return inputCylindricalFace_raw(value.get()); +} + +inline bool ThreadFeature::isModeled() const +{ + bool res = isModeled_raw(); + return res; +} + +inline bool ThreadFeature::isModeled(bool value) +{ + return isModeled_raw(value); +} + +inline bool ThreadFeature::isFullLength() const +{ + bool res = isFullLength_raw(); + return res; +} + +inline bool ThreadFeature::isFullLength(bool value) +{ + return isFullLength_raw(value); +} + +inline bool ThreadFeature::setThreadOffsetLength(const core::Ptr& threadOffset, const core::Ptr& threadLength, ThreadLocations threadLocation) +{ + bool res = setThreadOffsetLength_raw(threadOffset.get(), threadLength.get(), threadLocation); + return res; +} + +inline core::Ptr ThreadFeature::threadLength() const +{ + core::Ptr res = threadLength_raw(); + return res; +} + +inline core::Ptr ThreadFeature::threadOffset() const +{ + core::Ptr res = threadOffset_raw(); + return res; +} + +inline ThreadLocations ThreadFeature::threadLocation() const +{ + ThreadLocations res = threadLocation_raw(); + return res; +} + +inline bool ThreadFeature::threadLocation(ThreadLocations value) +{ + return threadLocation_raw(value); +} + +inline core::Ptr ThreadFeature::threadInfo() const +{ + core::Ptr res = threadInfo_raw(); + return res; +} + +inline bool ThreadFeature::threadInfo(const core::Ptr& value) +{ + return threadInfo_raw(value.get()); +} + +inline bool ThreadFeature::isRightHanded() const +{ + bool res = isRightHanded_raw(); + return res; +} + +inline bool ThreadFeature::isRightHanded(bool value) +{ + return isRightHanded_raw(value); +} + +inline core::Ptr ThreadFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ThreadFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr ThreadFeature::inputCylindricalFaces() const +{ + core::Ptr res = inputCylindricalFaces_raw(); + return res; +} + +inline bool ThreadFeature::inputCylindricalFaces(const core::Ptr& value) +{ + return inputCylindricalFaces_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_THREADFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ThreadFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/ThreadFeatureInput.h new file mode 100644 index 0000000..fa07cc8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ThreadFeatureInput.h @@ -0,0 +1,247 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_THREADFEATUREINPUT_CPP__ +# define ADSK_FUSION_THREADFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_THREADFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_THREADFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepFace; + class ThreadInfo; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a thread +/// feature. +class ThreadFeatureInput : public core::Base { +public: + + /// Gets and sets the threaded face. In the case where there are multiple faces, only the first one is returned. + /// Setting this results in a thread being applied to only a single face. + /// It is recommended that you use the inputCylindricalfaces property in order to have full access to the collection of faces + /// to be threaded. + core::Ptr inputCylindricalFace() const; + bool inputCylindricalFace(const core::Ptr& value); + + /// Gets and sets if the thread is physical or cosmetic thread. A value of true indicates a physical thread. + /// It defaults to false. + bool isModeled() const; + bool isModeled(bool value); + + /// Gets and sets if this thread is the full length of the cylinder. + /// It defaults to true. + bool isFullLength() const; + bool isFullLength(bool value); + + /// Gets and sets the thread length. + /// It is only used in the case where the isFullLength property is false. + core::Ptr threadLength() const; + bool threadLength(const core::Ptr& value); + + /// Gets and sets the thread offset. + /// The offset is the distance along the axis of the cylinder from the edge to the start of the thread. + /// It is only used in the case where the isFullLength property is false. + /// Returns nothing in the case where the feature is non-parametric. + core::Ptr threadOffset() const; + bool threadOffset(const core::Ptr& value); + + /// Gets and sets where the thread length is measured from. + /// This property is only used in the case where the isFullLength property is false. + ThreadLocations threadLocation() const; + bool threadLocation(ThreadLocations value); + + /// Gets and sets the thread data. + core::Ptr threadInfo() const; + bool threadInfo(const core::Ptr& value); + + /// Gets and sets if the thread is right or left-handed thread. A value of true indicates a right-handed thread. + /// It defaults to true. + bool isRightHanded() const; + bool isRightHanded(bool value); + + /// Gets and sets the cylindrical input faces. + core::Ptr inputCylindricalFaces() const; + bool inputCylindricalFaces(const core::Ptr& value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + ADSK_FUSION_THREADFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_THREADFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_THREADFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_THREADFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepFace* inputCylindricalFace_raw() const = 0; + virtual bool inputCylindricalFace_raw(BRepFace* value) = 0; + virtual bool isModeled_raw() const = 0; + virtual bool isModeled_raw(bool value) = 0; + virtual bool isFullLength_raw() const = 0; + virtual bool isFullLength_raw(bool value) = 0; + virtual core::ValueInput* threadLength_raw() const = 0; + virtual bool threadLength_raw(core::ValueInput* value) = 0; + virtual core::ValueInput* threadOffset_raw() const = 0; + virtual bool threadOffset_raw(core::ValueInput* value) = 0; + virtual ThreadLocations threadLocation_raw() const = 0; + virtual bool threadLocation_raw(ThreadLocations value) = 0; + virtual ThreadInfo* threadInfo_raw() const = 0; + virtual bool threadInfo_raw(ThreadInfo* value) = 0; + virtual bool isRightHanded_raw() const = 0; + virtual bool isRightHanded_raw(bool value) = 0; + virtual core::ObjectCollection* inputCylindricalFaces_raw() const = 0; + virtual bool inputCylindricalFaces_raw(core::ObjectCollection* value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ThreadFeatureInput::inputCylindricalFace() const +{ + core::Ptr res = inputCylindricalFace_raw(); + return res; +} + +inline bool ThreadFeatureInput::inputCylindricalFace(const core::Ptr& value) +{ + return inputCylindricalFace_raw(value.get()); +} + +inline bool ThreadFeatureInput::isModeled() const +{ + bool res = isModeled_raw(); + return res; +} + +inline bool ThreadFeatureInput::isModeled(bool value) +{ + return isModeled_raw(value); +} + +inline bool ThreadFeatureInput::isFullLength() const +{ + bool res = isFullLength_raw(); + return res; +} + +inline bool ThreadFeatureInput::isFullLength(bool value) +{ + return isFullLength_raw(value); +} + +inline core::Ptr ThreadFeatureInput::threadLength() const +{ + core::Ptr res = threadLength_raw(); + return res; +} + +inline bool ThreadFeatureInput::threadLength(const core::Ptr& value) +{ + return threadLength_raw(value.get()); +} + +inline core::Ptr ThreadFeatureInput::threadOffset() const +{ + core::Ptr res = threadOffset_raw(); + return res; +} + +inline bool ThreadFeatureInput::threadOffset(const core::Ptr& value) +{ + return threadOffset_raw(value.get()); +} + +inline ThreadLocations ThreadFeatureInput::threadLocation() const +{ + ThreadLocations res = threadLocation_raw(); + return res; +} + +inline bool ThreadFeatureInput::threadLocation(ThreadLocations value) +{ + return threadLocation_raw(value); +} + +inline core::Ptr ThreadFeatureInput::threadInfo() const +{ + core::Ptr res = threadInfo_raw(); + return res; +} + +inline bool ThreadFeatureInput::threadInfo(const core::Ptr& value) +{ + return threadInfo_raw(value.get()); +} + +inline bool ThreadFeatureInput::isRightHanded() const +{ + bool res = isRightHanded_raw(); + return res; +} + +inline bool ThreadFeatureInput::isRightHanded(bool value) +{ + return isRightHanded_raw(value); +} + +inline core::Ptr ThreadFeatureInput::inputCylindricalFaces() const +{ + core::Ptr res = inputCylindricalFaces_raw(); + return res; +} + +inline bool ThreadFeatureInput::inputCylindricalFaces(const core::Ptr& value) +{ + return inputCylindricalFaces_raw(value.get()); +} + +inline core::Ptr ThreadFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool ThreadFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_THREADFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ThreadFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/ThreadFeatures.h new file mode 100644 index 0000000..90ef9a3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ThreadFeatures.h @@ -0,0 +1,173 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_THREADFEATURES_CPP__ +# define ADSK_FUSION_THREADFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_THREADFEATURES_API +# endif +#else +# define ADSK_FUSION_THREADFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ThreadDataQuery; + class ThreadFeature; + class ThreadFeatureInput; + class ThreadInfo; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing thread features in a component +/// and supports the ability to create new thread features. +class ThreadFeatures : public core::Base { +public: + + /// Function that returns the specified thread feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of thread features in the collection. + size_t count() const; + + /// Property that returns the ThreadDataQuery object. When creating a thread, the type and size of the thread + /// is specified by referencing thread information defined in one of the XML files in the ThreadData folder. + /// The ThreadDataQuery is an object that supports methods to query the existing threads defined in these files. + core::Ptr threadDataQuery() const; + + /// Creates a ThreadFeatureInput object. This object is the API equivalent of the Thread feature dialog. It collects + /// the required input and once fully defined you can pass this object to the ThreadFeatures.add method to create + /// the thread feature. + /// inputCylindricalFaces : A single cylindrical BRep face or a collection of cylindrical BRep faces to thread. + /// A collection of faces must all be from either holes (for internal threading) or all from cylinders (for external threading). + /// Both internal and external threads cannot be created in the same feature. + /// The faces in a collection can come from different bodies or components. + /// threadInfo : The ThreadInfo object that defines the type and size of the thread to create. When creating a thread, the type and size + /// of the thread is specified by referencing thread information defined in one of the XML files in the ThreadData folder within + /// the Fusion 360 install folder. You can use the ThreadDataQuery object to query these XML files to find the specific thread you + /// want to create. The ThreadDataQuery object can be obtained by using the ThreadFeatures.threadDataQuery property. You then use + /// this information to create a ThreadInfo object using the ThreadFeatures.createThreadInfo method. + /// Returns the newly created ThreadFeatureInput object or null/None if the creation failed. + core::Ptr createInput(const core::Ptr& inputCylindricalFaces, const core::Ptr& threadInfo) const; + + /// Method that creates a new ThreadInfo object that can be used in creating thread features. + /// The ThreadInfo object that defines the type and size of the thread to create. When creating a thread, the type and size + /// of the thread is specified by referencing thread information defined in one of the XML files in the ThreadData folder within + /// the Fusion 360 install folder. You can use the ThreadDataQuery object to query these XML files to find the specific thread you + /// want to create. The ThreadDataQuery object can be obtained by using the ThreadFeatures.threadDataQuery property. + /// isInternal : Input Boolean that indicates if the thread is an internal or external thread. A value of true indicates an internal thread. + /// threadType : Input string that defines the thread type. + /// threadDesignation : Input string that contains the thread designation. + /// This is input as the full thread designation that will be used in a drawing for the thread call-out. + /// The nominal size and pitch information are extracted from the designation. + /// threadClass : Input string that defines the thread class. + /// Returns the newly created ThreadInfo object or null if the creation failed. + core::Ptr createThreadInfo(bool isInternal, const std::string& threadType, const std::string& threadDesignation, const std::string& threadClass) const; + + /// Creates a new thread feature. + /// input : A ThreadFeatureInput object that defines the desired thread. Use the createInput + /// method to create a new ThreadFeatureInput object and then use methods on it + /// (the ThreadFeatureInput object) to define the thread. + /// Returns the newly created ThreadFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified thread feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef ThreadFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_THREADFEATURES_API static const char* classType(); + ADSK_FUSION_THREADFEATURES_API const char* objectType() const override; + ADSK_FUSION_THREADFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_THREADFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ThreadFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual ThreadDataQuery* threadDataQuery_raw() const = 0; + virtual ThreadFeatureInput* createInput_raw(core::Base* inputCylindricalFaces, ThreadInfo* threadInfo) const = 0; + virtual ThreadInfo* createThreadInfo_raw(bool isInternal, const char * threadType, const char * threadDesignation, const char * threadClass) const = 0; + virtual ThreadFeature* add_raw(ThreadFeatureInput* input) = 0; + virtual ThreadFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ThreadFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ThreadFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ThreadFeatures::threadDataQuery() const +{ + core::Ptr res = threadDataQuery_raw(); + return res; +} + +inline core::Ptr ThreadFeatures::createInput(const core::Ptr& inputCylindricalFaces, const core::Ptr& threadInfo) const +{ + core::Ptr res = createInput_raw(inputCylindricalFaces.get(), threadInfo.get()); + return res; +} + +inline core::Ptr ThreadFeatures::createThreadInfo(bool isInternal, const std::string& threadType, const std::string& threadDesignation, const std::string& threadClass) const +{ + core::Ptr res = createThreadInfo_raw(isInternal, threadType.c_str(), threadDesignation.c_str(), threadClass.c_str()); + return res; +} + +inline core::Ptr ThreadFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr ThreadFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void ThreadFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_THREADFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ThreadInfo.h b/usr/autodesk/CPP/include/Fusion/Features/ThreadInfo.h new file mode 100644 index 0000000..ab4980c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ThreadInfo.h @@ -0,0 +1,210 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_THREADINFO_CPP__ +# define ADSK_FUSION_THREADINFO_API XI_EXPORT +# else +# define ADSK_FUSION_THREADINFO_API +# endif +#else +# define ADSK_FUSION_THREADINFO_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that define the type and size of a thread. This object is used +/// to create new thread features and to query and edit existing thread features. A new ThreadInfo object is created +/// by using the ThreadFeatures.createThreadInfo method. If the ThreadInfo object is obtained from an existing thread +/// feature, modifying properties on the ThreadInfo object will modify the feature. +class ThreadInfo : public core::Base { +public: + + /// Returns and sets the string that defines the thread type. + std::string threadType() const; + bool threadType(const std::string& value); + + /// Returns the string that defines the thread size. This is + std::string threadSize() const; + + /// Returns and sets the string that defines the thread designation. + std::string threadDesignation() const; + bool threadDesignation(const std::string& value); + + /// Returns and sets the string that defines the thread class. + std::string threadClass() const; + bool threadClass(const std::string& value); + + /// Returns and sets if the thread is an internal or external thread. A value of true indicates an internal thread. + /// It defaults to true. + bool isInternal() const; + bool isInternal(bool value); + + /// Returns the value that defines the thread angle. The units are degrees. + double threadAngle() const; + + /// Returns the value that defines the thread pitch. The units are centimeters. + double threadPitch() const; + + /// Returns the value that defines the major diameter. The units are centimeters. + double majorDiameter() const; + + /// Returns the value that defines the minor diameter. The units are centimeters. + double minorDiameter() const; + + /// Returns the value that defines the pitch diameter. The units are centimeters. + double pitchDiameter() const; + + ADSK_FUSION_THREADINFO_API static const char* classType(); + ADSK_FUSION_THREADINFO_API const char* objectType() const override; + ADSK_FUSION_THREADINFO_API void* queryInterface(const char* id) const override; + ADSK_FUSION_THREADINFO_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* threadType_raw() const = 0; + virtual bool threadType_raw(const char * value) = 0; + virtual char* threadSize_raw() const = 0; + virtual char* threadDesignation_raw() const = 0; + virtual bool threadDesignation_raw(const char * value) = 0; + virtual char* threadClass_raw() const = 0; + virtual bool threadClass_raw(const char * value) = 0; + virtual bool isInternal_raw() const = 0; + virtual bool isInternal_raw(bool value) = 0; + virtual double threadAngle_raw() const = 0; + virtual double threadPitch_raw() const = 0; + virtual double majorDiameter_raw() const = 0; + virtual double minorDiameter_raw() const = 0; + virtual double pitchDiameter_raw() const = 0; +}; + +// Inline wrappers + +inline std::string ThreadInfo::threadType() const +{ + std::string res; + + char* p= threadType_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool ThreadInfo::threadType(const std::string& value) +{ + return threadType_raw(value.c_str()); +} + +inline std::string ThreadInfo::threadSize() const +{ + std::string res; + + char* p= threadSize_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string ThreadInfo::threadDesignation() const +{ + std::string res; + + char* p= threadDesignation_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool ThreadInfo::threadDesignation(const std::string& value) +{ + return threadDesignation_raw(value.c_str()); +} + +inline std::string ThreadInfo::threadClass() const +{ + std::string res; + + char* p= threadClass_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool ThreadInfo::threadClass(const std::string& value) +{ + return threadClass_raw(value.c_str()); +} + +inline bool ThreadInfo::isInternal() const +{ + bool res = isInternal_raw(); + return res; +} + +inline bool ThreadInfo::isInternal(bool value) +{ + return isInternal_raw(value); +} + +inline double ThreadInfo::threadAngle() const +{ + double res = threadAngle_raw(); + return res; +} + +inline double ThreadInfo::threadPitch() const +{ + double res = threadPitch_raw(); + return res; +} + +inline double ThreadInfo::majorDiameter() const +{ + double res = majorDiameter_raw(); + return res; +} + +inline double ThreadInfo::minorDiameter() const +{ + double res = minorDiameter_raw(); + return res; +} + +inline double ThreadInfo::pitchDiameter() const +{ + double res = pitchDiameter_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_THREADINFO_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ThroughAllExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/ThroughAllExtentDefinition.h new file mode 100644 index 0000000..75df57d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ThroughAllExtentDefinition.h @@ -0,0 +1,80 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_THROUGHALLEXTENTDEFINITION_CPP__ +# define ADSK_FUSION_THROUGHALLEXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_THROUGHALLEXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_THROUGHALLEXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A definition object that is used to define the extents of a feature to be through all. +class ThroughAllExtentDefinition : public ExtentDefinition { +public: + + /// Statically creates a new ThroughAllExtentDefinition object. This is used as input when + /// defining the extents of a feature to be through all. + /// Returns the newly created ThroughAllExtentDefinition or null in the case of a failure. + static core::Ptr create(); + + /// Gets and sets if the direction is positive or negative. A value of true indicates it is + /// in the same direction as the z direction of the profile's sketch plane. + /// This is only used when the extrusion is only defined in a single direction from the + /// profile plane. If it's a two sided extrusion, this value is ignored. + bool isPositiveDirection() const; + bool isPositiveDirection(bool value); + + ADSK_FUSION_THROUGHALLEXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_THROUGHALLEXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_THROUGHALLEXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_THROUGHALLEXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_THROUGHALLEXTENTDEFINITION_API static ThroughAllExtentDefinition* create_raw(); + virtual bool isPositiveDirection_raw() const = 0; + virtual bool isPositiveDirection_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ThroughAllExtentDefinition::create() +{ + core::Ptr res = create_raw(); + return res; +} + +inline bool ThroughAllExtentDefinition::isPositiveDirection() const +{ + bool res = isPositiveDirection_raw(); + return res; +} + +inline bool ThroughAllExtentDefinition::isPositiveDirection(bool value) +{ + return isPositiveDirection_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_THROUGHALLEXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/ToEntityExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/ToEntityExtentDefinition.h new file mode 100644 index 0000000..8587264 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/ToEntityExtentDefinition.h @@ -0,0 +1,159 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TOENTITYEXTENTDEFINITION_CPP__ +# define ADSK_FUSION_TOENTITYEXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_TOENTITYEXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_TOENTITYEXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class ValueInput; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// A definition object that is used to define the extents of a feature to be up to a specified +/// construction plane or face. +class ToEntityExtentDefinition : public ExtentDefinition { +public: + + /// Statically creates a new ToEntityExtentDefinition object. This is used as input when + /// defining the extents of a feature to be up to a construction plane or face. + /// entity : The construction plane or face that the feature extent it up to. + /// isChained : + /// offset : A optional input value that defines an offset distance of the entity that will be used + /// for the extent. Positive and negative values can be used to offset in both directions. + /// If this argument is not provided a value of zero will be used. + /// Returns the newly created ToEntityExtentDefinition object or null if the creation failed. + static core::Ptr create(const core::Ptr& entity, bool isChained, const core::Ptr& offset = core::Ptr()); + + /// Gets and sets the entity that the feature extent is defined up to. This can be a ConstructionPlane, Profile, BrepFace, + /// BrepBody, or BRepVertex. + core::Ptr entity() const; + bool entity(const core::Ptr& value); + + /// Returns the current offset. If the EntityExtentDefinition object has been created statically and isn't associated with + /// a feature this will return a ValueInput object. If the EntityExtentDefinition object is obtained from a feature this + /// will return a ModelParameter object. You can use properties of the parameter to edit it's value which will result in + /// the feature updating. + core::Ptr offset() const; + + /// Gets and sets whether connected faces to the input entity should also be used when calculating the extent or if the + /// input entity should be extended. A value of true indicates that connected entities should be used. + bool isChained() const; + bool isChained(bool value); + + /// Gets and sets a direction that is used when the result is ambiguous. For example, if you have a profile in + /// the center of a torus and are extruding to the torus, the extrusion can go in either direction. When needed, + /// this provides the information to tell Fusion 360 which direction to go. In most cases this is not needed and + /// the property will be null. + core::Ptr directionHint() const; + bool directionHint(const core::Ptr& value); + + /// Gets and sets if the minimum or maximum solution is calculated. This is only used when the input entity is + /// a body and defines if the extrusion to go to the near side (minimum solution) of the body or the far side. + /// When a new ToEntityExtentDefinition object is created, this property defaults to True. + bool isMinimumSolution() const; + bool isMinimumSolution(bool value); + + ADSK_FUSION_TOENTITYEXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_TOENTITYEXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_TOENTITYEXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TOENTITYEXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_TOENTITYEXTENTDEFINITION_API static ToEntityExtentDefinition* create_raw(core::Base* entity, bool isChained, core::ValueInput* offset); + virtual core::Base* entity_raw() const = 0; + virtual bool entity_raw(core::Base* value) = 0; + virtual core::Base* offset_raw() const = 0; + virtual bool isChained_raw() const = 0; + virtual bool isChained_raw(bool value) = 0; + virtual core::Vector3D* directionHint_raw() const = 0; + virtual bool directionHint_raw(core::Vector3D* value) = 0; + virtual bool isMinimumSolution_raw() const = 0; + virtual bool isMinimumSolution_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr ToEntityExtentDefinition::create(const core::Ptr& entity, bool isChained, const core::Ptr& offset) +{ + core::Ptr res = create_raw(entity.get(), isChained, offset.get()); + return res; +} + +inline core::Ptr ToEntityExtentDefinition::entity() const +{ + core::Ptr res = entity_raw(); + return res; +} + +inline bool ToEntityExtentDefinition::entity(const core::Ptr& value) +{ + return entity_raw(value.get()); +} + +inline core::Ptr ToEntityExtentDefinition::offset() const +{ + core::Ptr res = offset_raw(); + return res; +} + +inline bool ToEntityExtentDefinition::isChained() const +{ + bool res = isChained_raw(); + return res; +} + +inline bool ToEntityExtentDefinition::isChained(bool value) +{ + return isChained_raw(value); +} + +inline core::Ptr ToEntityExtentDefinition::directionHint() const +{ + core::Ptr res = directionHint_raw(); + return res; +} + +inline bool ToEntityExtentDefinition::directionHint(const core::Ptr& value) +{ + return directionHint_raw(value.get()); +} + +inline bool ToEntityExtentDefinition::isMinimumSolution() const +{ + bool res = isMinimumSolution_raw(); + return res; +} + +inline bool ToEntityExtentDefinition::isMinimumSolution(bool value) +{ + return isMinimumSolution_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TOENTITYEXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/TorusFeature.h b/usr/autodesk/CPP/include/Fusion/Features/TorusFeature.h new file mode 100644 index 0000000..c9dbd6a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/TorusFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TORUSFEATURE_CPP__ +# define ADSK_FUSION_TORUSFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_TORUSFEATURE_API +# endif +#else +# define ADSK_FUSION_TORUSFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing torus feature in a design. +class TorusFeature : public Feature { +public: + + ADSK_FUSION_TORUSFEATURE_API static const char* classType(); + ADSK_FUSION_TORUSFEATURE_API const char* objectType() const override; + ADSK_FUSION_TORUSFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TORUSFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TORUSFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/TorusFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/TorusFeatures.h new file mode 100644 index 0000000..ab39069 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/TorusFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TORUSFEATURES_CPP__ +# define ADSK_FUSION_TORUSFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_TORUSFEATURES_API +# endif +#else +# define ADSK_FUSION_TORUSFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TorusFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing torus features in a design. +class TorusFeatures : public core::Base { +public: + + /// Function that returns the specified torus feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified torus feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of torus features in the collection. + size_t count() const; + + typedef TorusFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_TORUSFEATURES_API static const char* classType(); + ADSK_FUSION_TORUSFEATURES_API const char* objectType() const override; + ADSK_FUSION_TORUSFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TORUSFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual TorusFeature* item_raw(size_t index) const = 0; + virtual TorusFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr TorusFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr TorusFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t TorusFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void TorusFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TORUSFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/TrimFeature.h b/usr/autodesk/CPP/include/Fusion/Features/TrimFeature.h new file mode 100644 index 0000000..b009db6 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/TrimFeature.h @@ -0,0 +1,126 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TRIMFEATURE_CPP__ +# define ADSK_FUSION_TRIMFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_TRIMFEATURE_API +# endif +#else +# define ADSK_FUSION_TRIMFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepCells; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing trim feature in a design. +class TrimFeature : public Feature { +public: + + /// Gets and sets the entity (a patch body, B-Rep face, construction plane or sketch curve) that intersects the trim tool. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr trimTool() const; + bool trimTool(const core::Ptr& value); + + /// Gets the set of valid cells that have been calculated based on the current inputs. + /// To get this collection the model must be in the state it was when the feature + /// was initially computed, which means the timeline marker must be positioned to immediately + /// before this feature. + /// After changing any selected cells you must call the applyCellChanges method to update + /// the feature with the changes. + core::Ptr bRepCells() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// After making any changes to the set of selected cells you must call this method to + /// indicate all changes have been made and to apply those changes to the feature. + /// Returns true if the apply was successful. + bool applyCellChanges(); + + ADSK_FUSION_TRIMFEATURE_API static const char* classType(); + ADSK_FUSION_TRIMFEATURE_API const char* objectType() const override; + ADSK_FUSION_TRIMFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TRIMFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* trimTool_raw() const = 0; + virtual bool trimTool_raw(core::Base* value) = 0; + virtual BRepCells* bRepCells_raw() const = 0; + virtual TrimFeature* nativeObject_raw() const = 0; + virtual TrimFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual bool applyCellChanges_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr TrimFeature::trimTool() const +{ + core::Ptr res = trimTool_raw(); + return res; +} + +inline bool TrimFeature::trimTool(const core::Ptr& value) +{ + return trimTool_raw(value.get()); +} + +inline core::Ptr TrimFeature::bRepCells() const +{ + core::Ptr res = bRepCells_raw(); + return res; +} + +inline core::Ptr TrimFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr TrimFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline bool TrimFeature::applyCellChanges() +{ + bool res = applyCellChanges_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TRIMFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/TrimFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/TrimFeatureInput.h new file mode 100644 index 0000000..2924594 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/TrimFeatureInput.h @@ -0,0 +1,121 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TRIMFEATUREINPUT_CPP__ +# define ADSK_FUSION_TRIMFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_TRIMFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_TRIMFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BaseFeature; + class BRepCells; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a TrimFeatureInput. +class TrimFeatureInput : public core::Base { +public: + + /// Returns the collection of the valid cells that have been calculated based on the trim tool. + /// Use this collection to specify which cells to trim away. + core::Ptr bRepCells() const; + + /// Gets and sets the entity (a patch body, B-Rep face, construction plane or sketch curve) that intersects the trim tool + core::Ptr trimTool() const; + bool trimTool(const core::Ptr& value); + + /// When creating a feature that is owned by a base feature, set this property to the + /// base feature you want to associate the new feature with. By default, this is null, + /// meaning it will not be associated with a base feature. + /// Because of a current limitation, if you want to create a feature associated with a base + /// feature, you must set this property AND call the startEdit method of the base feature, + /// create the feature, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + core::Ptr targetBaseFeature() const; + bool targetBaseFeature(const core::Ptr& value); + + /// To determine the possible boundaries and allow you to choose which cells to keep, the trim + /// feature does a partial compute when the input object is created. To do this it starts a trim + /// feature transaction and completes the transaction when you call the add method. If you don't + /// call the add method it leaves Fusion 360 in a bad state and there will be undo problems and it + /// will possibly crash. If you have created a TrimFeatureInput object and don't want to finish + /// the feature creation, you need to call the cancel method on the TrimFeatureInput object to + /// safely abort the current trim feature transaction. + bool cancel(); + + ADSK_FUSION_TRIMFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_TRIMFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_TRIMFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TRIMFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual BRepCells* bRepCells_raw() const = 0; + virtual core::Base* trimTool_raw() const = 0; + virtual bool trimTool_raw(core::Base* value) = 0; + virtual BaseFeature* targetBaseFeature_raw() const = 0; + virtual bool targetBaseFeature_raw(BaseFeature* value) = 0; + virtual bool cancel_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr TrimFeatureInput::bRepCells() const +{ + core::Ptr res = bRepCells_raw(); + return res; +} + +inline core::Ptr TrimFeatureInput::trimTool() const +{ + core::Ptr res = trimTool_raw(); + return res; +} + +inline bool TrimFeatureInput::trimTool(const core::Ptr& value) +{ + return trimTool_raw(value.get()); +} + +inline core::Ptr TrimFeatureInput::targetBaseFeature() const +{ + core::Ptr res = targetBaseFeature_raw(); + return res; +} + +inline bool TrimFeatureInput::targetBaseFeature(const core::Ptr& value) +{ + return targetBaseFeature_raw(value.get()); +} + +inline bool TrimFeatureInput::cancel() +{ + bool res = cancel_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TRIMFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/TrimFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/TrimFeatures.h new file mode 100644 index 0000000..0a5084e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/TrimFeatures.h @@ -0,0 +1,137 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TRIMFEATURES_CPP__ +# define ADSK_FUSION_TRIMFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_TRIMFEATURES_API +# endif +#else +# define ADSK_FUSION_TRIMFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TrimFeature; + class TrimFeatureInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing trim features in a component +/// and supports the ability to create new trim features. +class TrimFeatures : public core::Base { +public: + + /// Function that returns the specified trim feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of trim features in the collection. + size_t count() const; + + /// Creates a TrimFeatureInput object. Use properties and methods on this object + /// to define the trim feature you want to create and then use the Add method, passing in + /// the TrimFeatureInput object. + /// To determine the possible boundaries and allow you to choose which cells to keep, the trim + /// feature does a partial compute when the input object is created. To do this it starts a trim + /// feature transaction and completes the transaction when you call the add method. If you don't call + /// the add method to finish the transaction it leaves Fusion 360 in a bad state and there will be undo + /// problems and possibly a crash. If you have created a TrimFeatureInput object and don't want to + /// finish the feature creation, you need to call the cancel method on the TrimFeatureInput object to + /// safely abort the current boundary fill transaction. + /// trimTool : A patch body, B-Rep face, construction plane or sketch curve that intersects the surface or surfaces to be trimmed + /// Returns the newly created TrimFeatureInput object or null if the creation failed. + core::Ptr createInput(const core::Ptr& trimTool) const; + + /// Creates a new trim feature. + /// input : A TrimFeatureInput object that defines the desired trim feature. Use the createInput + /// method to create a new TrimFeatureInput object and then use methods on it + /// (the TrimFeatureInput object) to define the trim feature. + /// Returns the newly created TrimFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified trim feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef TrimFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_TRIMFEATURES_API static const char* classType(); + ADSK_FUSION_TRIMFEATURES_API const char* objectType() const override; + ADSK_FUSION_TRIMFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TRIMFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual TrimFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual TrimFeatureInput* createInput_raw(core::Base* trimTool) const = 0; + virtual TrimFeature* add_raw(TrimFeatureInput* input) = 0; + virtual TrimFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr TrimFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t TrimFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr TrimFeatures::createInput(const core::Ptr& trimTool) const +{ + core::Ptr res = createInput_raw(trimTool.get()); + return res; +} + +inline core::Ptr TrimFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr TrimFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void TrimFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TRIMFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/TwoDistancesChamferEdgeSet.h b/usr/autodesk/CPP/include/Fusion/Features/TwoDistancesChamferEdgeSet.h new file mode 100644 index 0000000..8bbc958 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/TwoDistancesChamferEdgeSet.h @@ -0,0 +1,117 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ChamferEdgeSet.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TWODISTANCESCHAMFEREDGESET_CPP__ +# define ADSK_FUSION_TWODISTANCESCHAMFEREDGESET_API XI_EXPORT +# else +# define ADSK_FUSION_TWODISTANCESCHAMFEREDGESET_API +# endif +#else +# define ADSK_FUSION_TWODISTANCESCHAMFEREDGESET_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the edges and the parameters associated with a two distances chamfer. +class TwoDistancesChamferEdgeSet : public ChamferEdgeSet { +public: + + /// Gets and sets the edges that will be chamfered. This collection can contain BRepEdge, BRepFace, + /// and Feature objects. If BRepFace or Feature are objects are provided, all of the edges associated + /// with those objects will be chamfered. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr edges() const; + bool edges(const core::Ptr& value); + + /// Returns the model parameter that controls the first offset distance of the chamfer. + /// You can edit the distance by using the properties on the returned ModelParameter object. + core::Ptr distanceOne() const; + + /// Returns the model parameter that controls the first offset distance of the chamfer. + /// You can edit the distance by using the properties on the returned ModelParameter object. + core::Ptr distanceTwo() const; + + /// Gets and sets if the chamfer is flipped. This swaps the directions for distance one and two. + /// To set this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + bool isFlipped() const; + bool isFlipped(bool value); + + ADSK_FUSION_TWODISTANCESCHAMFEREDGESET_API static const char* classType(); + ADSK_FUSION_TWODISTANCESCHAMFEREDGESET_API const char* objectType() const override; + ADSK_FUSION_TWODISTANCESCHAMFEREDGESET_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TWODISTANCESCHAMFEREDGESET_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* edges_raw() const = 0; + virtual bool edges_raw(core::ObjectCollection* value) = 0; + virtual ModelParameter* distanceOne_raw() const = 0; + virtual ModelParameter* distanceTwo_raw() const = 0; + virtual bool isFlipped_raw() const = 0; + virtual bool isFlipped_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr TwoDistancesChamferEdgeSet::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline bool TwoDistancesChamferEdgeSet::edges(const core::Ptr& value) +{ + return edges_raw(value.get()); +} + +inline core::Ptr TwoDistancesChamferEdgeSet::distanceOne() const +{ + core::Ptr res = distanceOne_raw(); + return res; +} + +inline core::Ptr TwoDistancesChamferEdgeSet::distanceTwo() const +{ + core::Ptr res = distanceTwo_raw(); + return res; +} + +inline bool TwoDistancesChamferEdgeSet::isFlipped() const +{ + bool res = isFlipped_raw(); + return res; +} + +inline bool TwoDistancesChamferEdgeSet::isFlipped(bool value) +{ + return isFlipped_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TWODISTANCESCHAMFEREDGESET_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/TwoDistancesChamferTypeDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/TwoDistancesChamferTypeDefinition.h new file mode 100644 index 0000000..ccca92f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/TwoDistancesChamferTypeDefinition.h @@ -0,0 +1,74 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ChamferTypeDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TWODISTANCESCHAMFERTYPEDEFINITION_CPP__ +# define ADSK_FUSION_TWODISTANCESCHAMFERTYPEDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_TWODISTANCESCHAMFERTYPEDEFINITION_API +# endif +#else +# define ADSK_FUSION_TWODISTANCESCHAMFERTYPEDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} + +namespace adsk { namespace fusion { + +/// Provides information to create a chamfer that is defined by a two distances from the edge. +class TwoDistancesChamferTypeDefinition : public ChamferTypeDefinition { +public: + + /// Returns the parameter controlling the first distance. You can edit the distance + /// by editing the value of the parameter object. + core::Ptr distanceOne() const; + + /// Returns the parameter controlling the second distance. You can edit the distance + /// by editing the value of the parameter object. + core::Ptr distanceTwo() const; + + ADSK_FUSION_TWODISTANCESCHAMFERTYPEDEFINITION_API static const char* classType(); + ADSK_FUSION_TWODISTANCESCHAMFERTYPEDEFINITION_API const char* objectType() const override; + ADSK_FUSION_TWODISTANCESCHAMFERTYPEDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TWODISTANCESCHAMFERTYPEDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ModelParameter* distanceOne_raw() const = 0; + virtual ModelParameter* distanceTwo_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr TwoDistancesChamferTypeDefinition::distanceOne() const +{ + core::Ptr res = distanceOne_raw(); + return res; +} + +inline core::Ptr TwoDistancesChamferTypeDefinition::distanceTwo() const +{ + core::Ptr res = distanceTwo_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TWODISTANCESCHAMFERTYPEDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/TwoSidesAngleExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/TwoSidesAngleExtentDefinition.h new file mode 100644 index 0000000..d5bcb14 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/TwoSidesAngleExtentDefinition.h @@ -0,0 +1,75 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TWOSIDESANGLEEXTENTDEFINITION_CPP__ +# define ADSK_FUSION_TWOSIDESANGLEEXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_TWOSIDESANGLEEXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_TWOSIDESANGLEEXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} + +namespace adsk { namespace fusion { + +/// Defines the inputs for a TwoSidesAngleExtentDefinition object. +/// This feature extent type defines the extents of the feature using angle extents on two sides. +class TwoSidesAngleExtentDefinition : public ExtentDefinition { +public: + + /// Gets the ModelParameter that defines the angle on the first side. + /// The value of the angle can be edited by using the properties on the ModelParameter object to edit the parameter. + core::Ptr angleOne() const; + + /// Gets the ModelParameter that defines the angle on the second side. + /// The value of the angle can be edited by using the properties on the ModelParameter object to edit the parameter. + core::Ptr angleTwo() const; + + ADSK_FUSION_TWOSIDESANGLEEXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_TWOSIDESANGLEEXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_TWOSIDESANGLEEXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TWOSIDESANGLEEXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ModelParameter* angleOne_raw() const = 0; + virtual ModelParameter* angleTwo_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr TwoSidesAngleExtentDefinition::angleOne() const +{ + core::Ptr res = angleOne_raw(); + return res; +} + +inline core::Ptr TwoSidesAngleExtentDefinition::angleTwo() const +{ + core::Ptr res = angleTwo_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TWOSIDESANGLEEXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/TwoSidesDistanceExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/TwoSidesDistanceExtentDefinition.h new file mode 100644 index 0000000..a6cf249 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/TwoSidesDistanceExtentDefinition.h @@ -0,0 +1,73 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TWOSIDESDISTANCEEXTENTDEFINITION_CPP__ +# define ADSK_FUSION_TWOSIDESDISTANCEEXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_TWOSIDESDISTANCEEXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_TWOSIDESDISTANCEEXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; +}} + +namespace adsk { namespace fusion { + +/// Defines the inputs for a TwoSidesDistanceExtentDefinition object. +/// This defines a feature extent where the distance in each direction can be a different value. +class TwoSidesDistanceExtentDefinition : public ExtentDefinition { +public: + + /// Gets the ModelParameter that defines the first distance + core::Ptr distanceOne() const; + + /// Gets the ModelParameter that defines the second distance + core::Ptr distanceTwo() const; + + ADSK_FUSION_TWOSIDESDISTANCEEXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_TWOSIDESDISTANCEEXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_TWOSIDESDISTANCEEXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TWOSIDESDISTANCEEXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ModelParameter* distanceOne_raw() const = 0; + virtual ModelParameter* distanceTwo_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr TwoSidesDistanceExtentDefinition::distanceOne() const +{ + core::Ptr res = distanceOne_raw(); + return res; +} + +inline core::Ptr TwoSidesDistanceExtentDefinition::distanceTwo() const +{ + core::Ptr res = distanceTwo_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TWOSIDESDISTANCEEXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/TwoSidesToExtentDefinition.h b/usr/autodesk/CPP/include/Fusion/Features/TwoSidesToExtentDefinition.h new file mode 100644 index 0000000..060f779 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/TwoSidesToExtentDefinition.h @@ -0,0 +1,102 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExtentDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TWOSIDESTOEXTENTDEFINITION_CPP__ +# define ADSK_FUSION_TWOSIDESTOEXTENTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_TWOSIDESTOEXTENTDEFINITION_API +# endif +#else +# define ADSK_FUSION_TWOSIDESTOEXTENTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines the inputs for a TwoSidesToExtentDefinition object +/// This defines a feature extent where the extents of feature go up to faces or construction planes in both directions. +class TwoSidesToExtentDefinition : public ExtentDefinition { +public: + + /// Gets and sets the entity that defines the extent on side one. The valid types of entities can vary depending on + /// the type of feature this is being used with. + core::Ptr toEntityOne() const; + bool toEntityOne(const core::Ptr& value); + + /// Gets and sets the entity that defines the extent on side two. The valid types of entities can vary depending on + /// the type of feature this is being used with. + core::Ptr toEntityTwo() const; + bool toEntityTwo(const core::Ptr& value); + + /// Gets and sets whether the toEntity is extended to fully intersect the extrusion. + bool matchShape() const; + bool matchShape(bool value); + + ADSK_FUSION_TWOSIDESTOEXTENTDEFINITION_API static const char* classType(); + ADSK_FUSION_TWOSIDESTOEXTENTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_TWOSIDESTOEXTENTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TWOSIDESTOEXTENTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* toEntityOne_raw() const = 0; + virtual bool toEntityOne_raw(core::Base* value) = 0; + virtual core::Base* toEntityTwo_raw() const = 0; + virtual bool toEntityTwo_raw(core::Base* value) = 0; + virtual bool matchShape_raw() const = 0; + virtual bool matchShape_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr TwoSidesToExtentDefinition::toEntityOne() const +{ + core::Ptr res = toEntityOne_raw(); + return res; +} + +inline bool TwoSidesToExtentDefinition::toEntityOne(const core::Ptr& value) +{ + return toEntityOne_raw(value.get()); +} + +inline core::Ptr TwoSidesToExtentDefinition::toEntityTwo() const +{ + core::Ptr res = toEntityTwo_raw(); + return res; +} + +inline bool TwoSidesToExtentDefinition::toEntityTwo(const core::Ptr& value) +{ + return toEntityTwo_raw(value.get()); +} + +inline bool TwoSidesToExtentDefinition::matchShape() const +{ + bool res = matchShape_raw(); + return res; +} + +inline bool TwoSidesToExtentDefinition::matchShape(bool value) +{ + return matchShape_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TWOSIDESTOEXTENTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/UnfoldFeature.h b/usr/autodesk/CPP/include/Fusion/Features/UnfoldFeature.h new file mode 100644 index 0000000..33e5cce --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/UnfoldFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_UNFOLDFEATURE_CPP__ +# define ADSK_FUSION_UNFOLDFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_UNFOLDFEATURE_API +# endif +#else +# define ADSK_FUSION_UNFOLDFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing unfold feature in a design. +class UnfoldFeature : public Feature { +public: + + ADSK_FUSION_UNFOLDFEATURE_API static const char* classType(); + ADSK_FUSION_UNFOLDFEATURE_API const char* objectType() const override; + ADSK_FUSION_UNFOLDFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_UNFOLDFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_UNFOLDFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/UnfoldFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/UnfoldFeatures.h new file mode 100644 index 0000000..eff6857 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/UnfoldFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_UNFOLDFEATURES_CPP__ +# define ADSK_FUSION_UNFOLDFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_UNFOLDFEATURES_API +# endif +#else +# define ADSK_FUSION_UNFOLDFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class UnfoldFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing unfold features in a design. +class UnfoldFeatures : public core::Base { +public: + + /// Function that returns the specified unfold feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of unfold features in the collection. + size_t count() const; + + /// Function that returns the specified unfold feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef UnfoldFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_UNFOLDFEATURES_API static const char* classType(); + ADSK_FUSION_UNFOLDFEATURES_API const char* objectType() const override; + ADSK_FUSION_UNFOLDFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_UNFOLDFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual UnfoldFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual UnfoldFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr UnfoldFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t UnfoldFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr UnfoldFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void UnfoldFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_UNFOLDFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/UnstitchFeature.h b/usr/autodesk/CPP/include/Fusion/Features/UnstitchFeature.h new file mode 100644 index 0000000..a4f7358 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/UnstitchFeature.h @@ -0,0 +1,122 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_UNSTITCHFEATURE_CPP__ +# define ADSK_FUSION_UNSTITCHFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_UNSTITCHFEATURE_API +# endif +#else +# define ADSK_FUSION_UNSTITCHFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing Unstitch feature in a design. +class UnstitchFeature : public Feature { +public: + + /// Sets the faces and/or bodies to be unstiched. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// faces : The faces and/or bodies to Unstitch. Individual faces can be unstitched from solids and/or patch bodies. + /// The faces being unstitched need not all come from the same body. + /// isChainSelection : A boolean value for setting whether or not faces that are connected and adjacent to + /// the input faces will be included in the selection. The default value is true. + /// Returns true if successful. + bool setInputFaces(const core::Ptr& faces, bool isChainSelection = true) const; + + /// Gets the faces that were input to be unstitched. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr inputFaces() const; + + /// A boolean value for setting whether or not faces that are connected and adjacent to + /// the input faces will be included in the selection. The default value is true. + bool isChainSelection() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_UNSTITCHFEATURE_API static const char* classType(); + ADSK_FUSION_UNSTITCHFEATURE_API const char* objectType() const override; + ADSK_FUSION_UNSTITCHFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_UNSTITCHFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setInputFaces_raw(core::ObjectCollection* faces, bool isChainSelection) const = 0; + virtual core::ObjectCollection* inputFaces_raw() const = 0; + virtual bool isChainSelection_raw() const = 0; + virtual UnstitchFeature* nativeObject_raw() const = 0; + virtual UnstitchFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline bool UnstitchFeature::setInputFaces(const core::Ptr& faces, bool isChainSelection) const +{ + bool res = setInputFaces_raw(faces.get(), isChainSelection); + return res; +} + +inline core::Ptr UnstitchFeature::inputFaces() const +{ + core::Ptr res = inputFaces_raw(); + return res; +} + +inline bool UnstitchFeature::isChainSelection() const +{ + bool res = isChainSelection_raw(); + return res; +} + +inline core::Ptr UnstitchFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr UnstitchFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_UNSTITCHFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/UnstitchFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/UnstitchFeatures.h new file mode 100644 index 0000000..5c9750e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/UnstitchFeatures.h @@ -0,0 +1,119 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_UNSTITCHFEATURES_CPP__ +# define ADSK_FUSION_UNSTITCHFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_UNSTITCHFEATURES_API +# endif +#else +# define ADSK_FUSION_UNSTITCHFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class UnstitchFeature; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Unstitch features in a component +/// and supports the ability to create new Unstitch features. +class UnstitchFeatures : public core::Base { +public: + + /// Function that returns the specified Unstitch feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of Unstitch features in the collection. + size_t count() const; + + /// Creates a new Unstitch feature. + /// faces : The faces and/or bodies to Unstitch. Individual faces can be unstitched from solid and/or patch bodies. The faces being unstitched + /// need not all come from the same body. + /// isChainSelection : A boolean value for setting whether or not faces that are connected and adjacent to + /// the input faces will be included in the selection. The default value is true. + /// Returns the newly created UnstitchFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& faces, bool isChainSelection = true); + + /// Function that returns the specified unstitch feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef UnstitchFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_UNSTITCHFEATURES_API static const char* classType(); + ADSK_FUSION_UNSTITCHFEATURES_API const char* objectType() const override; + ADSK_FUSION_UNSTITCHFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_UNSTITCHFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual UnstitchFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual UnstitchFeature* add_raw(core::ObjectCollection* faces, bool isChainSelection) = 0; + virtual UnstitchFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr UnstitchFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t UnstitchFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr UnstitchFeatures::add(const core::Ptr& faces, bool isChainSelection) +{ + core::Ptr res = add_raw(faces.get(), isChainSelection); + return res; +} + +inline core::Ptr UnstitchFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void UnstitchFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_UNSTITCHFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/UntrimFeature.h b/usr/autodesk/CPP/include/Fusion/Features/UntrimFeature.h new file mode 100644 index 0000000..747eb95 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/UntrimFeature.h @@ -0,0 +1,183 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "Feature.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_UNTRIMFEATURE_CPP__ +# define ADSK_FUSION_UNTRIMFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_UNTRIMFEATURE_API +# endif +#else +# define ADSK_FUSION_UNTRIMFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; + class BRepLoop; + class ModelParameter; + class Occurrence; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an existing Untrim feature in a design. +class UntrimFeature : public Feature { +public: + + /// Gets the loop type that was untrimmed. To change the trim type, use one of the redefine methods. + UntrimLoopTypes untrimLoopType() const; + + /// Gets the face objects to untrim. + /// Returns null/None in the case where loops are specified instead of faces. + std::vector> facesToUntrim() const; + + /// Set the loops to be removed from a set of faces. + /// faces : An array of BRepFace objects that will have the loops of the specified types removed. + /// Only loops that do not have a connected face can be removed (the edges in the loop have a single face). + /// The array can only contain faces from surface bodies, (the isSolid property of the BRepBody returns false). + /// untrimLoopType : The loop type to be untrimmed (AllLoopUntrimType, InternalLoopUntrimType, or ExternalLoopUntrimType). + /// Returns whether the operation was successful + bool redefineLoopsFromFaces(const std::vector>& faces, UntrimLoopTypes untrimLoopType); + + /// Gets the loop objects to untrim. + /// Returns null/None in the case where faces are specified instead of loops + std::vector> loopsToUntrim() const; + + /// Set the loops to be removed. + /// loops : Input the entities that define loops to remove. + /// Only loops that do not have a connected face can be removed (the edges in the loop have a single face) + /// The array can only contain loops from surface bodies, (the isSolid property of the BRepBody returns false). + /// Returns whether the operation was successful + bool redefineLoops(const std::vector>& loops); + + /// Gets the ModelParameter that defines the extension distance used to extend external boundaries. + /// This can return null in the case where only internal boundaries have been removed. + /// The value can be edited by using the properties of the returned ModelParameter object. + core::Ptr extensionDistance() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this is not the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_UNTRIMFEATURE_API static const char* classType(); + ADSK_FUSION_UNTRIMFEATURE_API const char* objectType() const override; + ADSK_FUSION_UNTRIMFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_UNTRIMFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual UntrimLoopTypes untrimLoopType_raw() const = 0; + virtual BRepFace** facesToUntrim_raw(size_t& return_size) const = 0; + virtual bool redefineLoopsFromFaces_raw(BRepFace** faces, size_t faces_size, UntrimLoopTypes untrimLoopType) = 0; + virtual BRepLoop** loopsToUntrim_raw(size_t& return_size) const = 0; + virtual bool redefineLoops_raw(BRepLoop** loops, size_t loops_size) = 0; + virtual ModelParameter* extensionDistance_raw() const = 0; + virtual UntrimFeature* nativeObject_raw() const = 0; + virtual UntrimFeature* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline UntrimLoopTypes UntrimFeature::untrimLoopType() const +{ + UntrimLoopTypes res = untrimLoopType_raw(); + return res; +} + +inline std::vector> UntrimFeature::facesToUntrim() const +{ + std::vector> res; + size_t s; + + BRepFace** p= facesToUntrim_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool UntrimFeature::redefineLoopsFromFaces(const std::vector>& faces, UntrimLoopTypes untrimLoopType) +{ + BRepFace** faces_ = new BRepFace*[faces.size()]; + for(size_t i=0; i> UntrimFeature::loopsToUntrim() const +{ + std::vector> res; + size_t s; + + BRepLoop** p= loopsToUntrim_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool UntrimFeature::redefineLoops(const std::vector>& loops) +{ + BRepLoop** loops_ = new BRepLoop*[loops.size()]; + for(size_t i=0; i UntrimFeature::extensionDistance() const +{ + core::Ptr res = extensionDistance_raw(); + return res; +} + +inline core::Ptr UntrimFeature::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr UntrimFeature::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_UNTRIMFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/UntrimFeatureInput.h b/usr/autodesk/CPP/include/Fusion/Features/UntrimFeatureInput.h new file mode 100644 index 0000000..8506004 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/UntrimFeatureInput.h @@ -0,0 +1,163 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_UNTRIMFEATUREINPUT_CPP__ +# define ADSK_FUSION_UNTRIMFEATUREINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_UNTRIMFEATUREINPUT_API +# endif +#else +# define ADSK_FUSION_UNTRIMFEATUREINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; + class BRepLoop; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// This class defines the methods and properties that pertain to the definition of a Untrim feature. +class UntrimFeatureInput : public core::Base { +public: + + /// Gets the loop type to be untrimmed. This is only used when faces are being untrimmed and is ignored for loops. + UntrimLoopTypes untrimLoopType() const; + + /// Gets the face objects to untrim. + /// Returns null/None in the case where loops are specified instead of faces. + std::vector> facesToUntrim() const; + + /// Set the loops to be removed from a set of faces. + /// faces : An array of BRepFace objects that will have the loops of the specified types removed. + /// Only loops that do not have a connected face can be removed (the edges in the loop have a single face). + /// The array can only contain faces from surface bodies, (the isSolid property of the BRepBody returns false). + /// untrimLoopType : The loop type to be untrimmed (AllLoopUntrimType, InternalLoopUntrimType, or ExternalLoopUntrimType). + /// Returns whether the operation was successful + bool setLoopsFromFaces(const std::vector>& faces, UntrimLoopTypes untrimLoopType); + + /// Gets the loop objects to untrim. + /// Returns null/None in the case where faces are specified instead of loops + std::vector> loopsToUntrim() const; + + /// Set the loops to be removed. + /// loops : Redefines this input to remove loops from the body. If faces were previously defined, that information will be lost. + /// Only loops that do not have a connected face can be removed (the edges in the loop have a single face) + /// The array can only contain loops from surface bodies, (the isSolid property of the BRepBody returns false). + /// Returns whether the operation was successful + bool setLoops(const std::vector>& loops); + + /// Gets and sets the ValueInput object that defines the extension distance applied to faces when an + /// external boundary is removed. + core::Ptr extensionDistance() const; + bool extensionDistance(const core::Ptr& value); + + ADSK_FUSION_UNTRIMFEATUREINPUT_API static const char* classType(); + ADSK_FUSION_UNTRIMFEATUREINPUT_API const char* objectType() const override; + ADSK_FUSION_UNTRIMFEATUREINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_UNTRIMFEATUREINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual UntrimLoopTypes untrimLoopType_raw() const = 0; + virtual BRepFace** facesToUntrim_raw(size_t& return_size) const = 0; + virtual bool setLoopsFromFaces_raw(BRepFace** faces, size_t faces_size, UntrimLoopTypes untrimLoopType) = 0; + virtual BRepLoop** loopsToUntrim_raw(size_t& return_size) const = 0; + virtual bool setLoops_raw(BRepLoop** loops, size_t loops_size) = 0; + virtual core::ValueInput* extensionDistance_raw() const = 0; + virtual bool extensionDistance_raw(core::ValueInput* value) = 0; +}; + +// Inline wrappers + +inline UntrimLoopTypes UntrimFeatureInput::untrimLoopType() const +{ + UntrimLoopTypes res = untrimLoopType_raw(); + return res; +} + +inline std::vector> UntrimFeatureInput::facesToUntrim() const +{ + std::vector> res; + size_t s; + + BRepFace** p= facesToUntrim_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool UntrimFeatureInput::setLoopsFromFaces(const std::vector>& faces, UntrimLoopTypes untrimLoopType) +{ + BRepFace** faces_ = new BRepFace*[faces.size()]; + for(size_t i=0; i> UntrimFeatureInput::loopsToUntrim() const +{ + std::vector> res; + size_t s; + + BRepLoop** p= loopsToUntrim_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool UntrimFeatureInput::setLoops(const std::vector>& loops) +{ + BRepLoop** loops_ = new BRepLoop*[loops.size()]; + for(size_t i=0; i UntrimFeatureInput::extensionDistance() const +{ + core::Ptr res = extensionDistance_raw(); + return res; +} + +inline bool UntrimFeatureInput::extensionDistance(const core::Ptr& value) +{ + return extensionDistance_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_UNTRIMFEATUREINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/UntrimFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/UntrimFeatures.h new file mode 100644 index 0000000..75bee0b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/UntrimFeatures.h @@ -0,0 +1,165 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_UNTRIMFEATURES_CPP__ +# define ADSK_FUSION_UNTRIMFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_UNTRIMFEATURES_API +# endif +#else +# define ADSK_FUSION_UNTRIMFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepFace; + class BRepLoop; + class UntrimFeature; + class UntrimFeatureInput; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing Untrim features in a component +/// and supports the ability to create new Untrim features. +class UntrimFeatures : public core::Base { +public: + + /// Function that returns the specified Untrim feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of Untrim features in the collection. + size_t count() const; + + /// Creates a UntrimFeatureInput object that defines the input needed to create a untrim feature. Use the input + /// object to define the input to create the desired feature and then use the Add method, passing in the UntrimFeatureInput object. + /// faces : An array of BRepFace objects that will have the loops of the specified type removed. + /// Only loops that do not have a connected face can be removed (the edges in the loop have a single face). + /// The array can only contain faces from surface bodies, (the isSolid property of the BRepBody returns false). + /// untrimLoopType : The loop type to be untrimmed (AllLoopUntrimType, InternalLoopUntrimType, or ExternalLoopUntrimType). + /// extensionDistance : If the untrim loop type is AllLoopUntrimType or ExternalLoopUntrimType the untrimmed faces can be extended by a specified distance. + /// Returns the newly created UntrimFeatureInput object or null if the creation failed. + core::Ptr createInputFromFaces(const std::vector>& faces, UntrimLoopTypes untrimLoopType, const core::Ptr& extensionDistance = NULL) const; + + /// Creates a UntrimFeatureInput object that defines the input needed to create a untrim feature. Use the input + /// object to define the input to create the desired feature and then use the Add method, passing in the UntrimFeatureInput object. + /// loops : Input the entities that define loops to remove. + /// Only loops that do not have a connected face can be removed (the edges in the loop have a single face) + /// The array can only contain loops from surface bodies, (the isSolid property of the BRepBody returns false). + /// extensionDistance : If an external boundary is removed the untrimmed face can be extended by a specified distance. + /// Returns the newly created UntrimFeatureInput object or null if the creation failed. + core::Ptr createInputFromLoops(const std::vector>& loops, const core::Ptr& extensionDistance = NULL) const; + + /// Creates a new Untrim feature. + /// input : An UntrimFeatureInput object that defines the desired Untrim feature. Use the createInput + /// method to create a new UntrimFeatureInput object and then use methods on it + /// (the UntrimFeatureInput object) to define the desired options for the Untrim feature. + /// Returns the newly created UntrimFeature object or null if the creation failed. + core::Ptr add(const core::Ptr& input); + + /// Function that returns the specified Untrim feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + typedef UntrimFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_UNTRIMFEATURES_API static const char* classType(); + ADSK_FUSION_UNTRIMFEATURES_API const char* objectType() const override; + ADSK_FUSION_UNTRIMFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_UNTRIMFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual UntrimFeature* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual UntrimFeatureInput* createInputFromFaces_raw(BRepFace** faces, size_t faces_size, UntrimLoopTypes untrimLoopType, core::ValueInput* extensionDistance) const = 0; + virtual UntrimFeatureInput* createInputFromLoops_raw(BRepLoop** loops, size_t loops_size, core::ValueInput* extensionDistance) const = 0; + virtual UntrimFeature* add_raw(UntrimFeatureInput* input) = 0; + virtual UntrimFeature* itemByName_raw(const char * name) const = 0; +}; + +// Inline wrappers + +inline core::Ptr UntrimFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t UntrimFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr UntrimFeatures::createInputFromFaces(const std::vector>& faces, UntrimLoopTypes untrimLoopType, const core::Ptr& extensionDistance) const +{ + BRepFace** faces_ = new BRepFace*[faces.size()]; + for(size_t i=0; i res = createInputFromFaces_raw(faces_, faces.size(), untrimLoopType, extensionDistance.get()); + delete[] faces_; + return res; +} + +inline core::Ptr UntrimFeatures::createInputFromLoops(const std::vector>& loops, const core::Ptr& extensionDistance) const +{ + BRepLoop** loops_ = new BRepLoop*[loops.size()]; + for(size_t i=0; i res = createInputFromLoops_raw(loops_, loops.size(), extensionDistance.get()); + delete[] loops_; + return res; +} + +inline core::Ptr UntrimFeatures::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr UntrimFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +template inline void UntrimFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_UNTRIMFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/VariableRadiusFilletEdgeSet.h b/usr/autodesk/CPP/include/Fusion/Features/VariableRadiusFilletEdgeSet.h new file mode 100644 index 0000000..e12c28a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/VariableRadiusFilletEdgeSet.h @@ -0,0 +1,158 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "FilletEdgeSet.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_VARIABLERADIUSFILLETEDGESET_CPP__ +# define ADSK_FUSION_VARIABLERADIUSFILLETEDGESET_API XI_EXPORT +# else +# define ADSK_FUSION_VARIABLERADIUSFILLETEDGESET_API +# endif +#else +# define ADSK_FUSION_VARIABLERADIUSFILLETEDGESET_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class ParameterList; +}} +namespace adsk { namespace core { + class ObjectCollection; + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the edges and the parameters associated with a variable radius fillet. +class VariableRadiusFilletEdgeSet : public FilletEdgeSet { +public: + + /// Gets and sets the edges that will be filleted. + /// To use this property, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + core::Ptr edges() const; + bool edges(const core::Ptr& value); + + /// Returns the model parameter that controls the start radius of the fillet. You can edit + /// the start radius by using the properties on the returned ModelParameter object. + core::Ptr startRadius() const; + + /// Returns the model parameter that controls the end radius of the fillet. You can edit + /// the end radius by using the properties on the returned ModelParameter object. + core::Ptr endRadius() const; + + /// Returns a list of model parameters that control radius of the fillet at each position defined along the edge set. + /// You can edit any of these radii by using the properties on its returned ModelParameter object. This list does + /// not include the parameters for the start and end radii. Use the startRadius and endRadius properties to get those. + core::Ptr midRadii() const; + + /// Returns a list of model parameters that control the location of each mid point radius. These positions are defined + /// from 0 to 1 where 0 is at the start of the edge and 1 is at the end. You can edit any of these positions by + /// using the properties on its returned ModelParameter object. + core::Ptr midPositions() const; + + /// Creates a new mid position radius on the variable radius edge set. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// position : The position where the new radius is to be created. This is a value between 0 and 1 where 0 is at the start of the + /// edge and 1 is at the end. If the ValueInput uses a real then it is interpreted as a unitless value. If it is a string + /// then it must resolve to a unitless value. + /// radius : A ValueInput object that defines the radius at the defined position. If the ValueInput uses a real + /// then it is interpreted as centimeters. If it is a string then the units can be defined as part of + /// the string (i.e. "2 in"). If no units are specified it will be interpreted using the current + /// default units for length. + /// Returns true if successful. + bool addMidPosition(const core::Ptr& position, const core::Ptr& radius); + + /// Deletes the specified mid position from the variable radius fillet. + /// To use this method, you need to position the timeline marker to immediately before this feature. + /// This can be accomplished using the following code: thisFeature.timelineObject.rollTo(True) + /// positionIndex : The index of the mid position to delete. The points are in the order they appear along the edge + /// where the first point has an index of 0. The number of mid positions and their locations can be + /// obtained by getting the list of mid positions using the midPositions property. + /// Returns true if successful. + bool deleteMidPosition(size_t positionIndex); + + ADSK_FUSION_VARIABLERADIUSFILLETEDGESET_API static const char* classType(); + ADSK_FUSION_VARIABLERADIUSFILLETEDGESET_API const char* objectType() const override; + ADSK_FUSION_VARIABLERADIUSFILLETEDGESET_API void* queryInterface(const char* id) const override; + ADSK_FUSION_VARIABLERADIUSFILLETEDGESET_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* edges_raw() const = 0; + virtual bool edges_raw(core::ObjectCollection* value) = 0; + virtual ModelParameter* startRadius_raw() const = 0; + virtual ModelParameter* endRadius_raw() const = 0; + virtual ParameterList* midRadii_raw() const = 0; + virtual ParameterList* midPositions_raw() const = 0; + virtual bool addMidPosition_raw(core::ValueInput* position, core::ValueInput* radius) = 0; + virtual bool deleteMidPosition_raw(size_t positionIndex) = 0; +}; + +// Inline wrappers + +inline core::Ptr VariableRadiusFilletEdgeSet::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline bool VariableRadiusFilletEdgeSet::edges(const core::Ptr& value) +{ + return edges_raw(value.get()); +} + +inline core::Ptr VariableRadiusFilletEdgeSet::startRadius() const +{ + core::Ptr res = startRadius_raw(); + return res; +} + +inline core::Ptr VariableRadiusFilletEdgeSet::endRadius() const +{ + core::Ptr res = endRadius_raw(); + return res; +} + +inline core::Ptr VariableRadiusFilletEdgeSet::midRadii() const +{ + core::Ptr res = midRadii_raw(); + return res; +} + +inline core::Ptr VariableRadiusFilletEdgeSet::midPositions() const +{ + core::Ptr res = midPositions_raw(); + return res; +} + +inline bool VariableRadiusFilletEdgeSet::addMidPosition(const core::Ptr& position, const core::Ptr& radius) +{ + bool res = addMidPosition_raw(position.get(), radius.get()); + return res; +} + +inline bool VariableRadiusFilletEdgeSet::deleteMidPosition(size_t positionIndex) +{ + bool res = deleteMidPosition_raw(positionIndex); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_VARIABLERADIUSFILLETEDGESET_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/WebFeature.h b/usr/autodesk/CPP/include/Fusion/Features/WebFeature.h new file mode 100644 index 0000000..be5543f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/WebFeature.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Feature.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_WEBFEATURE_CPP__ +# define ADSK_FUSION_WEBFEATURE_API XI_EXPORT +# else +# define ADSK_FUSION_WEBFEATURE_API +# endif +#else +# define ADSK_FUSION_WEBFEATURE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Object that represents an existing web feature in a design. +class WebFeature : public Feature { +public: + + ADSK_FUSION_WEBFEATURE_API static const char* classType(); + ADSK_FUSION_WEBFEATURE_API const char* objectType() const override; + ADSK_FUSION_WEBFEATURE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_WEBFEATURE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_WEBFEATURE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Features/WebFeatures.h b/usr/autodesk/CPP/include/Fusion/Features/WebFeatures.h new file mode 100644 index 0000000..f7efc81 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Features/WebFeatures.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_WEBFEATURES_CPP__ +# define ADSK_FUSION_WEBFEATURES_API XI_EXPORT +# else +# define ADSK_FUSION_WEBFEATURES_API +# endif +#else +# define ADSK_FUSION_WEBFEATURES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class WebFeature; +}} + +namespace adsk { namespace fusion { + +/// Collection that provides access to all of the existing web features in a design. +class WebFeatures : public core::Base { +public: + + /// Function that returns the specified web feature using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified web feature using the name of the feature. + /// name : The name of the feature within the collection to return. This is the name seen in the timeline. + /// Returns the specified item or null if the specified name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// The number of web features in the collection. + size_t count() const; + + typedef WebFeature iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_WEBFEATURES_API static const char* classType(); + ADSK_FUSION_WEBFEATURES_API const char* objectType() const override; + ADSK_FUSION_WEBFEATURES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_WEBFEATURES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual WebFeature* item_raw(size_t index) const = 0; + virtual WebFeature* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr WebFeatures::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr WebFeatures::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t WebFeatures::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void WebFeatures::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_WEBFEATURES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/AreaProperties.h b/usr/autodesk/CPP/include/Fusion/Fusion/AreaProperties.h new file mode 100644 index 0000000..566cfe9 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/AreaProperties.h @@ -0,0 +1,188 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_AREAPROPERTIES_CPP__ +# define ADSK_FUSION_AREAPROPERTIES_API XI_EXPORT +# else +# define ADSK_FUSION_AREAPROPERTIES_API +# endif +#else +# define ADSK_FUSION_AREAPROPERTIES_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Point3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// The Area properties of a sketch profile or planar surface. +class AreaProperties : public core::Base { +public: + + /// Gets the area in the square centimeters. + double area() const; + + /// Gets the centroid where the units are centimeters. + /// The Location is relative to the sketch origin for a profile or relative to the world coordinate system for a planar face. + core::Ptr centroid() const; + + /// Gets the perimeter in centimeters. + /// The perimeter is the sum of the length of all the curves or edges of the profile or planar surface + double perimeter() const; + + /// Gets the angle of rotation of the principal axes. + double rotationToPrincipal() const; + + /// Returns the accuracy that was used for the calculation. + CalculationAccuracy accuracy() const; + + /// Method that returns the principal axes. + /// xAxis : The output Vector3D object that indicates the direction of the x axis. + /// yAxis : The output Vector3D object that indicates the direction of the y axis. + /// Returns true if successful + bool getPrincipalAxes(core::Ptr& xAxis, core::Ptr& yAxis) const; + + /// Method that, for a sketch, returns the moments of inertia about the sketch origin. + /// For a planar face, this method returns the moments about the world coordinate system origin. + /// Unit for returned values is kg/cm^2. + /// ixx : Output Double that returns the XX partial moment. + /// iyy : Output Double that returns the YY partial moment. + /// izz : Output Double that returns the ZZ partial moment. + /// ixy : Output Double that returns the XY partial moment. + /// iyz : Output Double that returns the YZ partial moment. + /// ixz : Output Double that returns the XZ partial moment. + /// Returns true if successful + bool getMomentsOfInertia(double& ixx, double& iyy, double& izz, double& ixy, double& iyz, double& ixz) const; + + /// Method that returns the moments of inertia about the centroid. Unit for returned values is kg/cm^2. + /// ixx : Output Double that returns the XX partial moment. + /// iyy : Output Double that returns the YY partial moment. + /// izz : Output Double that returns the ZZ partial moment. + /// ixy : Output Double that returns the XY partial moment. + /// iyz : Output Double that returns the YZ partial moment. + /// ixz : Output Double that returns the XZ partial moment. + /// Returns true if successful + bool getCentroidMomentsOfInertia(double& ixx, double& iyy, double& izz, double& ixy, double& iyz, double& ixz) const; + + /// Method that returns the moments of inertia about the principal axes. Unit for returned values is kg/cm^2. + /// i1 : Output Double that specifies the first moment of inertia. + /// i2 : Output Double that specifies the second moment of inertia. + /// i3 : Output Double that specifies the third moment of inertia. + /// Returns true if successful + bool getPrincipalMomentsOfInertia(double& i1, double& i2, double& i3) const; + + /// Method that returns the radius of gyration about the principal axes. Unit for returned values is cm. + /// kxx : Output Double that returns the X partial radius of gyration. + /// kyy : Output Double that returns the Y partial radius of gyration. + /// kzz : Output Double that returns the Z partial radius of gyration. + /// Returns true if successful + bool getRadiusOfGyration(double& kxx, double& kyy, double& kzz) const; + + ADSK_FUSION_AREAPROPERTIES_API static const char* classType(); + ADSK_FUSION_AREAPROPERTIES_API const char* objectType() const override; + ADSK_FUSION_AREAPROPERTIES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_AREAPROPERTIES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual double area_raw() const = 0; + virtual core::Point3D* centroid_raw() const = 0; + virtual double perimeter_raw() const = 0; + virtual double rotationToPrincipal_raw() const = 0; + virtual CalculationAccuracy accuracy_raw() const = 0; + virtual bool getPrincipalAxes_raw(core::Vector3D*& xAxis, core::Vector3D*& yAxis) const = 0; + virtual bool getMomentsOfInertia_raw(double& ixx, double& iyy, double& izz, double& ixy, double& iyz, double& ixz) const = 0; + virtual bool getCentroidMomentsOfInertia_raw(double& ixx, double& iyy, double& izz, double& ixy, double& iyz, double& ixz) const = 0; + virtual bool getPrincipalMomentsOfInertia_raw(double& i1, double& i2, double& i3) const = 0; + virtual bool getRadiusOfGyration_raw(double& kxx, double& kyy, double& kzz) const = 0; +}; + +// Inline wrappers + +inline double AreaProperties::area() const +{ + double res = area_raw(); + return res; +} + +inline core::Ptr AreaProperties::centroid() const +{ + core::Ptr res = centroid_raw(); + return res; +} + +inline double AreaProperties::perimeter() const +{ + double res = perimeter_raw(); + return res; +} + +inline double AreaProperties::rotationToPrincipal() const +{ + double res = rotationToPrincipal_raw(); + return res; +} + +inline CalculationAccuracy AreaProperties::accuracy() const +{ + CalculationAccuracy res = accuracy_raw(); + return res; +} + +inline bool AreaProperties::getPrincipalAxes(core::Ptr& xAxis, core::Ptr& yAxis) const +{ + core::Vector3D* xAxis_ = nullptr; + core::Vector3D* yAxis_ = nullptr; + + bool res = getPrincipalAxes_raw(xAxis_, yAxis_); + xAxis = xAxis_; + yAxis = yAxis_; + return res; +} + +inline bool AreaProperties::getMomentsOfInertia(double& ixx, double& iyy, double& izz, double& ixy, double& iyz, double& ixz) const +{ + bool res = getMomentsOfInertia_raw(ixx, iyy, izz, ixy, iyz, ixz); + return res; +} + +inline bool AreaProperties::getCentroidMomentsOfInertia(double& ixx, double& iyy, double& izz, double& ixy, double& iyz, double& ixz) const +{ + bool res = getCentroidMomentsOfInertia_raw(ixx, iyy, izz, ixy, iyz, ixz); + return res; +} + +inline bool AreaProperties::getPrincipalMomentsOfInertia(double& i1, double& i2, double& i3) const +{ + bool res = getPrincipalMomentsOfInertia_raw(i1, i2, i3); + return res; +} + +inline bool AreaProperties::getRadiusOfGyration(double& kxx, double& kyy, double& kzz) const +{ + bool res = getRadiusOfGyration_raw(kxx, kyy, kzz); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_AREAPROPERTIES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/BooleanParameterValue.h b/usr/autodesk/CPP/include/Fusion/Fusion/BooleanParameterValue.h new file mode 100644 index 0000000..805c9b0 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/BooleanParameterValue.h @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ParameterValue.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_BOOLEANPARAMETERVALUE_CPP__ +# define ADSK_FUSION_BOOLEANPARAMETERVALUE_API XI_EXPORT +# else +# define ADSK_FUSION_BOOLEANPARAMETERVALUE_API +# endif +#else +# define ADSK_FUSION_BOOLEANPARAMETERVALUE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A parameter value that is a boolean. +class BooleanParameterValue : public ParameterValue { +public: + + /// Get or set the value of the parameter. + bool value() const; + bool value(bool value); + + ADSK_FUSION_BOOLEANPARAMETERVALUE_API static const char* classType(); + ADSK_FUSION_BOOLEANPARAMETERVALUE_API const char* objectType() const override; + ADSK_FUSION_BOOLEANPARAMETERVALUE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_BOOLEANPARAMETERVALUE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool value_raw() const = 0; + virtual bool value_raw(bool value) = 0; +}; + +// Inline wrappers + +inline bool BooleanParameterValue::value() const +{ + bool res = value_raw(); + return res; +} + +inline bool BooleanParameterValue::value(bool value) +{ + return value_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_BOOLEANPARAMETERVALUE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/C3MFExportOptions.h b/usr/autodesk/CPP/include/Fusion/Fusion/C3MFExportOptions.h new file mode 100644 index 0000000..dcf5d67 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/C3MFExportOptions.h @@ -0,0 +1,239 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "ExportOptions.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_C3MFEXPORTOPTIONS_CPP__ +# define ADSK_FUSION_C3MFEXPORTOPTIONS_API XI_EXPORT +# else +# define ADSK_FUSION_C3MFEXPORTOPTIONS_API +# endif +#else +# define ADSK_FUSION_C3MFEXPORTOPTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines that a 3MF export is to be done and specifies the various options. +class C3MFExportOptions : public ExportOptions { +public: + + /// If the input is an Occurrence or the root Component, this specifies if a single file should be created containing + /// all of the bodies within that occurrence or component or if multiple files should be created; one for each body. + /// If multiple files are created, the body name is appended to the filename. The default is false. + bool isOneFilePerBody() const; + bool isOneFilePerBody(bool value); + + /// Gets and sets the current simple mesh refinement settings. Setting this property + /// will reset the surfaceDeviation, normalDeviation, maximumEdgeLength, and aspectRatio + /// to values that correspond to the specified mesh refinement. The default is MeshRefinementMedium + MeshRefinementSettings meshRefinement() const; + bool meshRefinement(MeshRefinementSettings value); + + /// Gets and sets the current surface deviation, or the distance the mesh can deviate + /// from the actual surface. This is defined in centimeter. Setting this property + /// will automatically set the meshRefinement to MeshRefinementCustom. The default is the value + /// associated with medium mesh refinement. + double surfaceDeviation() const; + bool surfaceDeviation(double value); + + /// Gets and sets the current normal deviation, or the angle the mesh normals at the vertices can deviate + /// from the actual surface normals. This is defined in radians. Setting this property + /// will automatically set the meshRefinement to MeshRefinementCustom. The default is the value + /// associated with medium mesh refinement. + double normalDeviation() const; + bool normalDeviation(double value); + + /// Gets and sets the maximum length of any mesh edge. This is defined in centimeter. Setting this property + /// will automatically set the meshRefinement to MeshRefinementCustom. The default is the value + /// associated with medium mesh refinement. + double maximumEdgeLength() const; + bool maximumEdgeLength(double value); + + /// Gets and sets the minimum aspect ratio for that triangles that are generated for the mesh. Setting this property + /// will automatically set the meshRefinement to MeshRefinementCustom. The default is the value + /// associated with medium mesh refinement. + double aspectRatio() const; + bool aspectRatio(double value); + + /// Returns a list of the known available print utilities. These strings can be used to set the PrintUtility + /// property to specify which print utility to open the 3MF file in. + std::vector availablePrintUtilities() const; + + /// Specifies which print utility to use when opening the 3MF file if the sendToPrintUtility property is true. + /// The value of this property can be one of the strings returned by the availalbePrintUtilities property, which + /// will specify one of the know print utilities. You can also specify a custom print utility by specifying + /// the full path to the print utility executable. The default value of this property is the last setting specified + /// in the user-interface. + std::string printUtility() const; + bool printUtility(const std::string& value); + + /// Gets and sets whether the created 3MF file will be sent to the print utility specified by the printUtility property. If this + /// is false a filename must be defined. + bool sendToPrintUtility() const; + bool sendToPrintUtility(bool value); + + ADSK_FUSION_C3MFEXPORTOPTIONS_API static const char* classType(); + ADSK_FUSION_C3MFEXPORTOPTIONS_API const char* objectType() const override; + ADSK_FUSION_C3MFEXPORTOPTIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_C3MFEXPORTOPTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isOneFilePerBody_raw() const = 0; + virtual bool isOneFilePerBody_raw(bool value) = 0; + virtual MeshRefinementSettings meshRefinement_raw() const = 0; + virtual bool meshRefinement_raw(MeshRefinementSettings value) = 0; + virtual double surfaceDeviation_raw() const = 0; + virtual bool surfaceDeviation_raw(double value) = 0; + virtual double normalDeviation_raw() const = 0; + virtual bool normalDeviation_raw(double value) = 0; + virtual double maximumEdgeLength_raw() const = 0; + virtual bool maximumEdgeLength_raw(double value) = 0; + virtual double aspectRatio_raw() const = 0; + virtual bool aspectRatio_raw(double value) = 0; + virtual char** availablePrintUtilities_raw(size_t& return_size) const = 0; + virtual char* printUtility_raw() const = 0; + virtual bool printUtility_raw(const char * value) = 0; + virtual bool sendToPrintUtility_raw() const = 0; + virtual bool sendToPrintUtility_raw(bool value) = 0; +}; + +// Inline wrappers + +inline bool C3MFExportOptions::isOneFilePerBody() const +{ + bool res = isOneFilePerBody_raw(); + return res; +} + +inline bool C3MFExportOptions::isOneFilePerBody(bool value) +{ + return isOneFilePerBody_raw(value); +} + +inline MeshRefinementSettings C3MFExportOptions::meshRefinement() const +{ + MeshRefinementSettings res = meshRefinement_raw(); + return res; +} + +inline bool C3MFExportOptions::meshRefinement(MeshRefinementSettings value) +{ + return meshRefinement_raw(value); +} + +inline double C3MFExportOptions::surfaceDeviation() const +{ + double res = surfaceDeviation_raw(); + return res; +} + +inline bool C3MFExportOptions::surfaceDeviation(double value) +{ + return surfaceDeviation_raw(value); +} + +inline double C3MFExportOptions::normalDeviation() const +{ + double res = normalDeviation_raw(); + return res; +} + +inline bool C3MFExportOptions::normalDeviation(double value) +{ + return normalDeviation_raw(value); +} + +inline double C3MFExportOptions::maximumEdgeLength() const +{ + double res = maximumEdgeLength_raw(); + return res; +} + +inline bool C3MFExportOptions::maximumEdgeLength(double value) +{ + return maximumEdgeLength_raw(value); +} + +inline double C3MFExportOptions::aspectRatio() const +{ + double res = aspectRatio_raw(); + return res; +} + +inline bool C3MFExportOptions::aspectRatio(double value) +{ + return aspectRatio_raw(value); +} + +inline std::vector C3MFExportOptions::availablePrintUtilities() const +{ + std::vector res; + size_t s; + + char** p= availablePrintUtilities_raw(s); + if(p) + { + res.resize(s); + for(size_t i=0; i +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CHOICEPARAMETERVALUE_CPP__ +# define ADSK_FUSION_CHOICEPARAMETERVALUE_API XI_EXPORT +# else +# define ADSK_FUSION_CHOICEPARAMETERVALUE_API +# endif +#else +# define ADSK_FUSION_CHOICEPARAMETERVALUE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A parameter value that is a list of choices. +class ChoiceParameterValue : public ParameterValue { +public: + + /// Method that returns the list of available choices. + /// names : An array of the names of the choices. These coincide with the array of possible values returned by the values argument. + /// values : An array of the possible values. These coincide with the array of names returned by the names argument. + /// Returns true if the call was successful. + bool getChoices(std::vector& names, std::vector& values); + + /// Get or set the value of the parameter. + /// This value will correspond to one of the available values of the parameter. + std::string value() const; + bool value(const std::string& value); + + ADSK_FUSION_CHOICEPARAMETERVALUE_API static const char* classType(); + ADSK_FUSION_CHOICEPARAMETERVALUE_API const char* objectType() const override; + ADSK_FUSION_CHOICEPARAMETERVALUE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CHOICEPARAMETERVALUE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool getChoices_raw(char**& names, size_t& names_size, char**& values, size_t& values_size) = 0; + virtual char* value_raw() const = 0; + virtual bool value_raw(const char * value) = 0; +}; + +// Inline wrappers + +inline bool ChoiceParameterValue::getChoices(std::vector& names, std::vector& values) +{ + char** names_ = nullptr; + size_t names_size; + char** values_ = nullptr; + size_t values_size; + + bool res = getChoices_raw(names_, names_size, values_, values_size); + if(names_) + { + names.resize( names_size); + for(size_t i=0; i< names_size; ++i) + { + char* pChar = names_[i]; + if(pChar) + names[i] = pChar; + core::DeallocateArray(pChar); + } + core::DeallocateArray(names_); + } + if(values_) + { + values.resize( values_size); + for(size_t i=0; i< values_size; ++i) + { + char* pChar = values_[i]; + if(pChar) + values[i] = pChar; + core::DeallocateArray(pChar); + } + core::DeallocateArray(values_); + } + return res; +} + +inline std::string ChoiceParameterValue::value() const +{ + std::string res; + + char* p= value_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool ChoiceParameterValue::value(const std::string& value) +{ + return value_raw(value.c_str()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CHOICEPARAMETERVALUE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/Design.h b/usr/autodesk/CPP/include/Fusion/Fusion/Design.h new file mode 100644 index 0000000..fbad98a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/Design.h @@ -0,0 +1,415 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "../../Core/Application/Product.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_DESIGN_CPP__ +# define ADSK_FUSION_DESIGN_API XI_EXPORT +# else +# define ADSK_FUSION_DESIGN_API +# endif +#else +# define ADSK_FUSION_DESIGN_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class AreaProperties; + class Component; + class Components; + class ContactSets; + class ExportManager; + class FusionUnitsManager; + class InterferenceInput; + class InterferenceResults; + class Occurrence; + class ParameterList; + class PhysicalProperties; + class Snapshots; + class Timeline; + class UserParameters; +}} +namespace adsk { namespace core { + class Appearances; + class Materials; + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Object that represents an open Fusion 360 design. This derives from the +/// Design base class and adds the Fusion 360 specific functionality. +class Design : public core::Product { +public: + + /// Gets and sets the current design type (DirectDesignType or ParametricDesignType) + /// Changing an existing design from ParametricDesignType to DirectDesignType will result in the timeline and all design + /// history being removed and further operations will not be captured in the timeline. + DesignTypes designType() const; + bool designType(DesignTypes value); + + /// Returns the root Component + core::Ptr rootComponent() const; + + /// Returns the Components collection that provides access to existing components + /// in a design + core::Ptr allComponents() const; + + /// Returns the current edit target as seen in the user interface. This edit target + /// is defined as the container object that will be added to if something is created. + /// For example, a component can be an edit target so that when new bodies are created they + /// are added to that component. A sketch can also be an edit target. + core::Ptr activeEditObject() const; + + /// Returns the component that is current being edited. This can return the root component + /// or another component within the design. + core::Ptr activeComponent() const; + + /// Returns the Snapshots object associated with this design which provides access to the + /// existing snapshots and the creation of new snapshots. + core::Ptr snapshots() const; + + /// Returns the timeline associated with this design. + core::Ptr timeline() const; + + /// Returns the collection of User Parameters in a design + core::Ptr userParameters() const; + + /// Returns a read only list of all parameters in the design. This includes + /// the user parameters and model parameters from all components in this design. The parameters from Externally Referenced components + /// are NOT included because they are in actuality, separate designs. + core::Ptr allParameters() const; + + /// Returns a specialized UnitsManager that can set the default length units and work + /// with parameters. + core::Ptr fusionUnitsManager() const; + + /// Returns the ExportManager for this design. You use the ExportManager + /// to export the current design in various formats. + core::Ptr exportManager() const; + + /// Gets whether the root component is the active edit target in the user interface. + /// This is the same as checking the state of the radio button next to the root component in the browser. + /// To activate the root component use the ActivateRootComponent method. + bool isRootComponentActive() const; + + /// Makes the root component the active component in the user interface. This is the same + /// as enabling the radio button next to the root component in the browser. + /// Returns true if the activation was successful. + bool activateRootComponent(); + + /// Returns the materials contained in this document. + core::Ptr materials() const; + + /// Returns the appearances contained in this document. + core::Ptr appearances() const; + + /// Creates an InterferenceInput object. This object collects the entities and options that are + /// used when calculating interference. To analyze interference you first create an InterferenceInput + /// supplying the entities and set any other settings and then provide this object as input to the + /// analyzeInterference method. + /// entities : An ObjectCollection containing the BRepBody and/or Occurrence entities that will be used in the + /// interference calculation. All entities must be in the context of the root component of the top-level design. + /// Returns an InterferenceInput object which you can use to set any other interference settings and then + /// use as input to the analyzeInterference method to calculate the interference. Returns null if the + /// creation failed. + core::Ptr createInterferenceInput(const core::Ptr& entities); + + /// Calculates the interference between the input bodies and/or occurrences. + /// input : An InterferenceInput that defines all of the necessary input needed to calculate the interference. + /// An InterferenceInput object is created using the createInterferenceInput method. + /// Returns an InterferenceResults object that can be used to examine the interference results. + core::Ptr analyzeInterference(const core::Ptr& input); + + /// Returns the occurrence that is currently activated, if any. This can return null in the case + /// where no occurrence is activated and the root component is active. + core::Ptr activeOccurrence() const; + + /// Returns the AreaProperties object that has properties for getting the area, perimeter, centroid, etc + /// for a collection of 2D sketch profiles and/or planar surfaces that all lie on the same plane. + /// inputs : A collection of one or more 2D sketch profile and/or planar surface input objects to perform the calculations on. + /// Supported input object types are 2D closed sketch profiles and planar surfaces. Object must all lie on the same plane. + /// Calculation results reflect the sums of the input objects (i.e. total area of multiple sketch profiles) + /// accuracy : Specifies the desired level of computational accuracy of the property calculations. + /// The default value of 'LowCalculationAccuracy' returns results within a +/- 1% error margin. + /// Returns an AreaProperties object that can be used to examine the area results. + core::Ptr areaProperties(const core::Ptr& inputs, CalculationAccuracy accuracy = adsk::fusion::LowCalculationAccuracy) const; + + /// Returns the PhysicalProperties object that has properties for getting the area, density, mass, volume, moments, etc + /// for a collection of 3D solid objects. + /// inputs : A collection of one or more 3D solid input objects to perform the calculations on. + /// Supported input object types are Components, Occurrences and BRepBodies. + /// Calculation results reflect the sums of the input objects (i.e. total volume of multiple bodies) + /// accuracy : Specifies the desired level of computational accuracy of the property calculations. + /// The default value of 'LowCalculationAccuracy' returns results within a +/- 1% error margin. + core::Ptr physicalProperties(const core::Ptr& inputs, CalculationAccuracy accuracy = adsk::fusion::LowCalculationAccuracy) const; + + /// Returns the contact sets associated with this design. + core::Ptr contactSets() const; + + /// Gets and sets whether contact analysis is enabled for all components. This + /// is the equivalent of the "Disable Contact / Enable Contact" command. If this + /// if True then any contact analysis defined (either all or contact sets) is enabled. + /// if False, then no contact analysis is performed. + bool isContactAnalysisEnabled() const; + bool isContactAnalysisEnabled(bool value); + + /// Gets and sets whether contact analysis is done using contact sets + /// or between all bodies, independent of any contact sets. If True and + /// the isContactAnalysisEnabled property is True then contact analysis + /// is performed using contact sets. If False and isContactAnalysisEnabled + /// is True, then contact analysis is performed between all bodies. If + /// isContactAnalysisEnabled is False then no contact analysis is performed. + bool isContactSetAnalysis() const; + bool isContactSetAnalysis(bool value); + + /// Returns the entities associated with the provided token. The return is an + /// array of entities. In most cases an array containing a single entity will be returned but + /// there are cases where more than one entity can be returned. An example of this + /// is where a token is obtained from a face and subsequent modeling operations cause + /// the face to be split into two or more pieces. All of the faces that represent + /// the original face will be returned with the first face being the most logical + /// match to the original face. + /// entityToken : The input entity token you want to find the matching entity for. + /// Returns an array of entities associated with the provided token, or an empty array + /// in the case where there are no matches. + std::vector> findEntityByToken(const std::string& entityToken); + + /// Forces a recompute of the entire design. This is the equivalent of the "Compute All" + /// command. + /// Returns true if the compute completed. This doesn't indicate if all the items in the + /// timeline successfully computed or not. You need to check the health state of each item + /// in the timeline to determine if everything successfully computed or not. + bool computeAll(); + + ADSK_FUSION_DESIGN_API static const char* classType(); + ADSK_FUSION_DESIGN_API const char* objectType() const override; + ADSK_FUSION_DESIGN_API void* queryInterface(const char* id) const override; + ADSK_FUSION_DESIGN_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual DesignTypes designType_raw() const = 0; + virtual bool designType_raw(DesignTypes value) = 0; + virtual Component* rootComponent_raw() const = 0; + virtual Components* allComponents_raw() const = 0; + virtual core::Base* activeEditObject_raw() const = 0; + virtual Component* activeComponent_raw() const = 0; + virtual Snapshots* snapshots_raw() const = 0; + virtual Timeline* timeline_raw() const = 0; + virtual UserParameters* userParameters_raw() const = 0; + virtual ParameterList* allParameters_raw() const = 0; + virtual FusionUnitsManager* fusionUnitsManager_raw() const = 0; + virtual ExportManager* exportManager_raw() const = 0; + virtual bool isRootComponentActive_raw() const = 0; + virtual bool activateRootComponent_raw() = 0; + virtual core::Materials* materials_raw() const = 0; + virtual core::Appearances* appearances_raw() const = 0; + virtual InterferenceInput* createInterferenceInput_raw(core::ObjectCollection* entities) = 0; + virtual InterferenceResults* analyzeInterference_raw(InterferenceInput* input) = 0; + virtual Occurrence* activeOccurrence_raw() const = 0; + virtual AreaProperties* areaProperties_raw(core::ObjectCollection* inputs, CalculationAccuracy accuracy) const = 0; + virtual PhysicalProperties* physicalProperties_raw(core::ObjectCollection* inputs, CalculationAccuracy accuracy) const = 0; + virtual ContactSets* contactSets_raw() const = 0; + virtual bool isContactAnalysisEnabled_raw() const = 0; + virtual bool isContactAnalysisEnabled_raw(bool value) = 0; + virtual bool isContactSetAnalysis_raw() const = 0; + virtual bool isContactSetAnalysis_raw(bool value) = 0; + virtual core::Base** findEntityByToken_raw(const char * entityToken, size_t& return_size) = 0; + virtual bool computeAll_raw() = 0; +}; + +// Inline wrappers + +inline DesignTypes Design::designType() const +{ + DesignTypes res = designType_raw(); + return res; +} + +inline bool Design::designType(DesignTypes value) +{ + return designType_raw(value); +} + +inline core::Ptr Design::rootComponent() const +{ + core::Ptr res = rootComponent_raw(); + return res; +} + +inline core::Ptr Design::allComponents() const +{ + core::Ptr res = allComponents_raw(); + return res; +} + +inline core::Ptr Design::activeEditObject() const +{ + core::Ptr res = activeEditObject_raw(); + return res; +} + +inline core::Ptr Design::activeComponent() const +{ + core::Ptr res = activeComponent_raw(); + return res; +} + +inline core::Ptr Design::snapshots() const +{ + core::Ptr res = snapshots_raw(); + return res; +} + +inline core::Ptr Design::timeline() const +{ + core::Ptr res = timeline_raw(); + return res; +} + +inline core::Ptr Design::userParameters() const +{ + core::Ptr res = userParameters_raw(); + return res; +} + +inline core::Ptr Design::allParameters() const +{ + core::Ptr res = allParameters_raw(); + return res; +} + +inline core::Ptr Design::fusionUnitsManager() const +{ + core::Ptr res = fusionUnitsManager_raw(); + return res; +} + +inline core::Ptr Design::exportManager() const +{ + core::Ptr res = exportManager_raw(); + return res; +} + +inline bool Design::isRootComponentActive() const +{ + bool res = isRootComponentActive_raw(); + return res; +} + +inline bool Design::activateRootComponent() +{ + bool res = activateRootComponent_raw(); + return res; +} + +inline core::Ptr Design::materials() const +{ + core::Ptr res = materials_raw(); + return res; +} + +inline core::Ptr Design::appearances() const +{ + core::Ptr res = appearances_raw(); + return res; +} + +inline core::Ptr Design::createInterferenceInput(const core::Ptr& entities) +{ + core::Ptr res = createInterferenceInput_raw(entities.get()); + return res; +} + +inline core::Ptr Design::analyzeInterference(const core::Ptr& input) +{ + core::Ptr res = analyzeInterference_raw(input.get()); + return res; +} + +inline core::Ptr Design::activeOccurrence() const +{ + core::Ptr res = activeOccurrence_raw(); + return res; +} + +inline core::Ptr Design::areaProperties(const core::Ptr& inputs, CalculationAccuracy accuracy) const +{ + core::Ptr res = areaProperties_raw(inputs.get(), accuracy); + return res; +} + +inline core::Ptr Design::physicalProperties(const core::Ptr& inputs, CalculationAccuracy accuracy) const +{ + core::Ptr res = physicalProperties_raw(inputs.get(), accuracy); + return res; +} + +inline core::Ptr Design::contactSets() const +{ + core::Ptr res = contactSets_raw(); + return res; +} + +inline bool Design::isContactAnalysisEnabled() const +{ + bool res = isContactAnalysisEnabled_raw(); + return res; +} + +inline bool Design::isContactAnalysisEnabled(bool value) +{ + return isContactAnalysisEnabled_raw(value); +} + +inline bool Design::isContactSetAnalysis() const +{ + bool res = isContactSetAnalysis_raw(); + return res; +} + +inline bool Design::isContactSetAnalysis(bool value) +{ + return isContactSetAnalysis_raw(value); +} + +inline std::vector> Design::findEntityByToken(const std::string& entityToken) +{ + std::vector> res; + size_t s; + + core::Base** p= findEntityByToken_raw(entityToken.c_str(), s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool Design::computeAll() +{ + bool res = computeAll_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_DESIGN_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/ExportManager.h b/usr/autodesk/CPP/include/Fusion/Fusion/ExportManager.h new file mode 100644 index 0000000..ecee95c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/ExportManager.h @@ -0,0 +1,189 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EXPORTMANAGER_CPP__ +# define ADSK_FUSION_EXPORTMANAGER_API XI_EXPORT +# else +# define ADSK_FUSION_EXPORTMANAGER_API +# endif +#else +# define ADSK_FUSION_EXPORTMANAGER_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class C3MFExportOptions; + class ExportOptions; + class FusionArchiveExportOptions; + class IGESExportOptions; + class SATExportOptions; + class SMTExportOptions; + class STEPExportOptions; + class STLExportOptions; +}} + +namespace adsk { namespace fusion { + +/// Provides support for exporting model data to various formats. +class ExportManager : public core::Base { +public: + + /// Creates an IGESExportOptions object that's used to export a design in IGES format. Creation + /// of the IGESExportOptions object does not perform the export. You must pass this object to the + /// ExportManager.execute method to perform the export. The IGESExportOptions supports any available + /// options when exporting to IGES format. + /// filename : The filename of the IGES file to be created. + /// geometry : The geometry to export. Valid geometry for this is currently a Component object. This argument is optional + /// and if not specified, it results in the root component and it entire contents being exported. + /// The created IGESExportOptions object or null if the creation failed. + core::Ptr createIGESExportOptions(const std::string& filename, const core::Ptr& geometry = NULL); + + /// Creates an STEPExportOptions object that's used to export a design in STEP format. Creation + /// of the STEPExportOptions object does not perform the export. You must pass this object to the + /// ExportManager.execute method to perform the export. The STEPExportOptions supports any available + /// options when exporting to STEP format. + /// filename : The filename of the STEP file to be created. + /// geometry : The geometry to export. Valid geometry for this is currently a Component object. This argument is optional + /// and if not specified, it results in the root component and it entire contents being exported. + /// The created STEPExportOptions object or null if the creation failed. + core::Ptr createSTEPExportOptions(const std::string& filename, const core::Ptr& geometry = NULL); + + /// Creates an SATExportOptions object that's used to export a design in SAT format. Creation + /// of the SATExportOptions object does not perform the export. You must pass this object to the + /// ExportManager.execute method to perform the export. The SATExportOptions supports any available + /// options when exporting to SAT format. + /// filename : The filename of the SAT file to be created. + /// geometry : The geometry to export. Valid geometry for this is currently a Component object. This argument is optional + /// and if not specified, it results in the root component and it entire contents being exported. + /// The created SATExportOptions object or null if the creation failed. + core::Ptr createSATExportOptions(const std::string& filename, const core::Ptr& geometry = NULL); + + /// Creates an SMTExportOptions object that's used to export a design in SMT format. Creation + /// of the SMTExportOptions object does not perform the export. You must pass this object to the + /// ExportManager.execute method to perform the export. The SMTExportOptions supports any available + /// options when exporting to SMT format. + /// filename : The filename of the SMT file to be created. + /// geometry : The geometry to export. Valid geometry for this is currently a Component object. This argument is optional + /// and if not specified, it results in the root component and it entire contents being exported. + /// The created SMTExportOptions object or null if the creation failed. + core::Ptr createSMTExportOptions(const std::string& filename, const core::Ptr& geometry = NULL); + + /// Creates an FusionArchiveExportOptions object that's used to export a design in Fusion 360 archive format. Creation + /// of the FusionArchiveExportOptions object does not perform the export. You must pass this object to the + /// ExportManager.execute method to perform the export. The FusionArchiveExportOptions supports any available + /// options when exporting to Fusion 360 archive format. + /// filename : The filename of the Fusion 360 archive file to be created. + /// geometry : The geometry to export. Valid geometry for this is currently a Component object. This argument is optional + /// and if not specified, it results in the root component and it entire contents being exported. + /// The created FusionArchiveExportOptions object or null if the creation failed. + core::Ptr createFusionArchiveExportOptions(const std::string& filename, const core::Ptr& geometry = NULL); + + /// Creates an STLExportOptions object that's used to export a design in STL format. Creation + /// of the STLExportOptions object does not perform the export. You must pass this object to the + /// ExportManager.execute method to perform the export. + /// geometry : The geometry to export. This can be a BRepBody, Occurrence, or Component object. + /// filename : The filename of the STL file to be created. This is optional and can be left out if the mesh will be opened in a mesh editor. + /// The created createSTLExportOptions object or null if the creation failed. + core::Ptr createSTLExportOptions(const core::Ptr& geometry, const std::string& filename = ""); + + /// Executes the export operation to create the file in the format specified by the input ExportOptions object. + /// exportOptions : An ExportOptions object that is created using one of the create methods on the ExportManager object. This + /// defines the type of file and any available options supported for that file type. + /// Returns true if the export was successful. + bool execute(const core::Ptr& exportOptions); + + /// Creates an C3MFExportOptions object that's used to export a design in 3MF format. Creation + /// of the C3MFExportOptions object does not perform the export. You must pass this object to the + /// ExportManager.execute method to perform the export. + /// geometry : The geometry to export. This can be a BRepBody, Occurrence, or Component object. + /// filename : The filename of the 3MF file to be created. This is optional and can be left out if the mesh will be opened in a mesh editor. + /// The created createC3MFExportOptions object or null if the creation failed. + core::Ptr createC3MFExportOptions(const core::Ptr& geometry, const std::string& filename = ""); + + ADSK_FUSION_EXPORTMANAGER_API static const char* classType(); + ADSK_FUSION_EXPORTMANAGER_API const char* objectType() const override; + ADSK_FUSION_EXPORTMANAGER_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EXPORTMANAGER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual IGESExportOptions* createIGESExportOptions_raw(const char * filename, core::Base* geometry) = 0; + virtual STEPExportOptions* createSTEPExportOptions_raw(const char * filename, core::Base* geometry) = 0; + virtual SATExportOptions* createSATExportOptions_raw(const char * filename, core::Base* geometry) = 0; + virtual SMTExportOptions* createSMTExportOptions_raw(const char * filename, core::Base* geometry) = 0; + virtual FusionArchiveExportOptions* createFusionArchiveExportOptions_raw(const char * filename, core::Base* geometry) = 0; + virtual STLExportOptions* createSTLExportOptions_raw(core::Base* geometry, const char * filename) = 0; + virtual bool execute_raw(ExportOptions* exportOptions) = 0; + virtual C3MFExportOptions* createC3MFExportOptions_raw(core::Base* geometry, const char * filename) = 0; +}; + +// Inline wrappers + +inline core::Ptr ExportManager::createIGESExportOptions(const std::string& filename, const core::Ptr& geometry) +{ + core::Ptr res = createIGESExportOptions_raw(filename.c_str(), geometry.get()); + return res; +} + +inline core::Ptr ExportManager::createSTEPExportOptions(const std::string& filename, const core::Ptr& geometry) +{ + core::Ptr res = createSTEPExportOptions_raw(filename.c_str(), geometry.get()); + return res; +} + +inline core::Ptr ExportManager::createSATExportOptions(const std::string& filename, const core::Ptr& geometry) +{ + core::Ptr res = createSATExportOptions_raw(filename.c_str(), geometry.get()); + return res; +} + +inline core::Ptr ExportManager::createSMTExportOptions(const std::string& filename, const core::Ptr& geometry) +{ + core::Ptr res = createSMTExportOptions_raw(filename.c_str(), geometry.get()); + return res; +} + +inline core::Ptr ExportManager::createFusionArchiveExportOptions(const std::string& filename, const core::Ptr& geometry) +{ + core::Ptr res = createFusionArchiveExportOptions_raw(filename.c_str(), geometry.get()); + return res; +} + +inline core::Ptr ExportManager::createSTLExportOptions(const core::Ptr& geometry, const std::string& filename) +{ + core::Ptr res = createSTLExportOptions_raw(geometry.get(), filename.c_str()); + return res; +} + +inline bool ExportManager::execute(const core::Ptr& exportOptions) +{ + bool res = execute_raw(exportOptions.get()); + return res; +} + +inline core::Ptr ExportManager::createC3MFExportOptions(const core::Ptr& geometry, const std::string& filename) +{ + core::Ptr res = createC3MFExportOptions_raw(geometry.get(), filename.c_str()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EXPORTMANAGER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/ExportOptions.h b/usr/autodesk/CPP/include/Fusion/Fusion/ExportOptions.h new file mode 100644 index 0000000..4dfc7ef --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/ExportOptions.h @@ -0,0 +1,123 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EXPORTOPTIONS_CPP__ +# define ADSK_FUSION_EXPORTOPTIONS_API XI_EXPORT +# else +# define ADSK_FUSION_EXPORTOPTIONS_API +# endif +#else +# define ADSK_FUSION_EXPORTOPTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The base class for the different export types. This class is never directly used +/// in an export because you need the specific export type to specify the type of +/// export to be performed. +class ExportOptions : public core::Base { +public: + + /// Gets and sets the filename that the exported file will be written to. This can + /// be empty in the case of STL export and sending the result to the mesh editor. + std::string filename() const; + bool filename(const std::string& value); + + /// Specifies the geometry to export. This can be an Occurrence, or the root Component. + /// For STL export, it can also be a BRepBody. For DXF export, it can be a sketch of flat pattern. + core::Ptr geometry() const; + bool geometry(const core::Ptr& value); + + ADSK_FUSION_EXPORTOPTIONS_API static const char* classType(); + ADSK_FUSION_EXPORTOPTIONS_API const char* objectType() const override; + ADSK_FUSION_EXPORTOPTIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EXPORTOPTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* filename_raw() const = 0; + virtual bool filename_raw(const char * value) = 0; + virtual core::Base* geometry_raw() const = 0; + virtual bool geometry_raw(core::Base* value) = 0; + virtual void placeholderExportOptions0() {} + virtual void placeholderExportOptions1() {} + virtual void placeholderExportOptions2() {} + virtual void placeholderExportOptions3() {} + virtual void placeholderExportOptions4() {} + virtual void placeholderExportOptions5() {} + virtual void placeholderExportOptions6() {} + virtual void placeholderExportOptions7() {} + virtual void placeholderExportOptions8() {} + virtual void placeholderExportOptions9() {} + virtual void placeholderExportOptions10() {} + virtual void placeholderExportOptions11() {} + virtual void placeholderExportOptions12() {} + virtual void placeholderExportOptions13() {} + virtual void placeholderExportOptions14() {} + virtual void placeholderExportOptions15() {} + virtual void placeholderExportOptions16() {} + virtual void placeholderExportOptions17() {} + virtual void placeholderExportOptions18() {} + virtual void placeholderExportOptions19() {} + virtual void placeholderExportOptions20() {} + virtual void placeholderExportOptions21() {} + virtual void placeholderExportOptions22() {} + virtual void placeholderExportOptions23() {} + virtual void placeholderExportOptions24() {} + virtual void placeholderExportOptions25() {} + virtual void placeholderExportOptions26() {} + virtual void placeholderExportOptions27() {} +}; + +// Inline wrappers + +inline std::string ExportOptions::filename() const +{ + std::string res; + + char* p= filename_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool ExportOptions::filename(const std::string& value) +{ + return filename_raw(value.c_str()); +} + +inline core::Ptr ExportOptions::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline bool ExportOptions::geometry(const core::Ptr& value) +{ + return geometry_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EXPORTOPTIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/FloatParameterValue.h b/usr/autodesk/CPP/include/Fusion/Fusion/FloatParameterValue.h new file mode 100644 index 0000000..217b809 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/FloatParameterValue.h @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ParameterValue.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FLOATPARAMETERVALUE_CPP__ +# define ADSK_FUSION_FLOATPARAMETERVALUE_API XI_EXPORT +# else +# define ADSK_FUSION_FLOATPARAMETERVALUE_API +# endif +#else +# define ADSK_FUSION_FLOATPARAMETERVALUE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A parameter value that is a floating point value. +class FloatParameterValue : public ParameterValue { +public: + + /// Get or set the value of the parameter. + double value() const; + bool value(double value); + + ADSK_FUSION_FLOATPARAMETERVALUE_API static const char* classType(); + ADSK_FUSION_FLOATPARAMETERVALUE_API const char* objectType() const override; + ADSK_FUSION_FLOATPARAMETERVALUE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FLOATPARAMETERVALUE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual double value_raw() const = 0; + virtual bool value_raw(double value) = 0; +}; + +// Inline wrappers + +inline double FloatParameterValue::value() const +{ + double res = value_raw(); + return res; +} + +inline bool FloatParameterValue::value(double value) +{ + return value_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FLOATPARAMETERVALUE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/FusionArchiveExportOptions.h b/usr/autodesk/CPP/include/Fusion/Fusion/FusionArchiveExportOptions.h new file mode 100644 index 0000000..5898941 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/FusionArchiveExportOptions.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExportOptions.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FUSIONARCHIVEEXPORTOPTIONS_CPP__ +# define ADSK_FUSION_FUSIONARCHIVEEXPORTOPTIONS_API XI_EXPORT +# else +# define ADSK_FUSION_FUSIONARCHIVEEXPORTOPTIONS_API +# endif +#else +# define ADSK_FUSION_FUSIONARCHIVEEXPORTOPTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines that a Fusion 360 Archive export is to be done and specifies the various options. +class FusionArchiveExportOptions : public ExportOptions { +public: + + ADSK_FUSION_FUSIONARCHIVEEXPORTOPTIONS_API static const char* classType(); + ADSK_FUSION_FUSIONARCHIVEEXPORTOPTIONS_API const char* objectType() const override; + ADSK_FUSION_FUSIONARCHIVEEXPORTOPTIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FUSIONARCHIVEEXPORTOPTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FUSIONARCHIVEEXPORTOPTIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/FusionDefaultUnitsPreferences.h b/usr/autodesk/CPP/include/Fusion/Fusion/FusionDefaultUnitsPreferences.h new file mode 100644 index 0000000..fdc4236 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/FusionDefaultUnitsPreferences.h @@ -0,0 +1,66 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "../../Core/Application/DefaultUnitsPreferences.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FUSIONDEFAULTUNITSPREFERENCES_CPP__ +# define ADSK_FUSION_FUSIONDEFAULTUNITSPREFERENCES_API XI_EXPORT +# else +# define ADSK_FUSION_FUSIONDEFAULTUNITSPREFERENCES_API +# endif +#else +# define ADSK_FUSION_FUSIONDEFAULTUNITSPREFERENCES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Fusion 360 Default Units for Design Preferences +class FusionDefaultUnitsPreferences : public core::DefaultUnitsPreferences { +public: + + /// Gets and sets the default units for length when creating a new Fusion 360 file. + DistanceUnits distanceDisplayUnits() const; + bool distanceDisplayUnits(DistanceUnits value); + + ADSK_FUSION_FUSIONDEFAULTUNITSPREFERENCES_API static const char* classType(); + ADSK_FUSION_FUSIONDEFAULTUNITSPREFERENCES_API const char* objectType() const override; + ADSK_FUSION_FUSIONDEFAULTUNITSPREFERENCES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FUSIONDEFAULTUNITSPREFERENCES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual DistanceUnits distanceDisplayUnits_raw() const = 0; + virtual bool distanceDisplayUnits_raw(DistanceUnits value) = 0; +}; + +// Inline wrappers + +inline DistanceUnits FusionDefaultUnitsPreferences::distanceDisplayUnits() const +{ + DistanceUnits res = distanceDisplayUnits_raw(); + return res; +} + +inline bool FusionDefaultUnitsPreferences::distanceDisplayUnits(DistanceUnits value) +{ + return distanceDisplayUnits_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FUSIONDEFAULTUNITSPREFERENCES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/FusionDocument.h b/usr/autodesk/CPP/include/Fusion/Fusion/FusionDocument.h new file mode 100644 index 0000000..a5a7f91 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/FusionDocument.h @@ -0,0 +1,62 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Application/Document.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FUSIONDOCUMENT_CPP__ +# define ADSK_FUSION_FUSIONDOCUMENT_API XI_EXPORT +# else +# define ADSK_FUSION_FUSIONDOCUMENT_API +# endif +#else +# define ADSK_FUSION_FUSIONDOCUMENT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Design; +}} + +namespace adsk { namespace fusion { + +/// Object that represents a Fusion 360 specific document. +class FusionDocument : public core::Document { +public: + + /// Returns the design associated with this Fusion 360 document. + core::Ptr design() const; + + ADSK_FUSION_FUSIONDOCUMENT_API static const char* classType(); + ADSK_FUSION_FUSIONDOCUMENT_API const char* objectType() const override; + ADSK_FUSION_FUSIONDOCUMENT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FUSIONDOCUMENT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Design* design_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr FusionDocument::design() const +{ + core::Ptr res = design_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FUSIONDOCUMENT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/FusionProductPreferences.h b/usr/autodesk/CPP/include/Fusion/Fusion/FusionProductPreferences.h new file mode 100644 index 0000000..88e33a4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/FusionProductPreferences.h @@ -0,0 +1,204 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "../../Core/Application/ProductPreferences.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FUSIONPRODUCTPREFERENCES_CPP__ +# define ADSK_FUSION_FUSIONPRODUCTPREFERENCES_API XI_EXPORT +# else +# define ADSK_FUSION_FUSIONPRODUCTPREFERENCES_API +# endif +#else +# define ADSK_FUSION_FUSIONPRODUCTPREFERENCES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Fusion 360 General Design Preferences +class FusionProductPreferences : public core::ProductPreferences { +public: + + /// Gets and sets the Active Component Visibility option + bool isActiveComponentVisibilityUsed() const; + bool isActiveComponentVisibilityUsed(bool value); + + /// Gets and sets the Design History (default design type) setting + DefaultDesignTypeOptions defaultDesignType() const; + bool defaultDesignType(DefaultDesignTypeOptions value); + + /// Gets and sets the Default workspace setting. (Model, Sculpt or Patch) + DefaultWorkspaces defaultWorkspace() const; + bool defaultWorkspace(DefaultWorkspaces value); + + /// Gets and sets the Animate joint preview option + bool isJointPreviewAnimated() const; + bool isJointPreviewAnimated(bool value); + + /// Gets and sets the Allow 3D sketching of lines and splines option + /// which controls if 3D sketching is allowed or if sketching is forced to + /// be on the x-y plane of the sketch. + bool is3DSketchingAllowed() const; + bool is3DSketchingAllowed(bool value); + + /// Gets and sets the Show ghosted result body option + bool isGhostedResultBodyShown() const; + bool isGhostedResultBodyShown(bool value); + + /// Gets and sets if dimension value is edited when the dimension is created. + bool isDimensionEditedWhenCreated() const; + bool isDimensionEditedWhenCreated(bool value); + + /// Gets and sets if the view is re-oriented to view the newly created sketch. + bool isAutoLookAtSketch() const; + bool isAutoLookAtSketch(bool value); + + /// Gets and Sets if geometry, not in the active sketch plane, is to be automatically projected. + bool isAutoProjectGeometry() const; + bool isAutoProjectGeometry(bool value); + + ADSK_FUSION_FUSIONPRODUCTPREFERENCES_API static const char* classType(); + ADSK_FUSION_FUSIONPRODUCTPREFERENCES_API const char* objectType() const override; + ADSK_FUSION_FUSIONPRODUCTPREFERENCES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FUSIONPRODUCTPREFERENCES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isActiveComponentVisibilityUsed_raw() const = 0; + virtual bool isActiveComponentVisibilityUsed_raw(bool value) = 0; + virtual DefaultDesignTypeOptions defaultDesignType_raw() const = 0; + virtual bool defaultDesignType_raw(DefaultDesignTypeOptions value) = 0; + virtual DefaultWorkspaces defaultWorkspace_raw() const = 0; + virtual bool defaultWorkspace_raw(DefaultWorkspaces value) = 0; + virtual bool isJointPreviewAnimated_raw() const = 0; + virtual bool isJointPreviewAnimated_raw(bool value) = 0; + virtual bool is3DSketchingAllowed_raw() const = 0; + virtual bool is3DSketchingAllowed_raw(bool value) = 0; + virtual bool isGhostedResultBodyShown_raw() const = 0; + virtual bool isGhostedResultBodyShown_raw(bool value) = 0; + virtual bool isDimensionEditedWhenCreated_raw() const = 0; + virtual bool isDimensionEditedWhenCreated_raw(bool value) = 0; + virtual bool isAutoLookAtSketch_raw() const = 0; + virtual bool isAutoLookAtSketch_raw(bool value) = 0; + virtual bool isAutoProjectGeometry_raw() const = 0; + virtual bool isAutoProjectGeometry_raw(bool value) = 0; +}; + +// Inline wrappers + +inline bool FusionProductPreferences::isActiveComponentVisibilityUsed() const +{ + bool res = isActiveComponentVisibilityUsed_raw(); + return res; +} + +inline bool FusionProductPreferences::isActiveComponentVisibilityUsed(bool value) +{ + return isActiveComponentVisibilityUsed_raw(value); +} + +inline DefaultDesignTypeOptions FusionProductPreferences::defaultDesignType() const +{ + DefaultDesignTypeOptions res = defaultDesignType_raw(); + return res; +} + +inline bool FusionProductPreferences::defaultDesignType(DefaultDesignTypeOptions value) +{ + return defaultDesignType_raw(value); +} + +inline DefaultWorkspaces FusionProductPreferences::defaultWorkspace() const +{ + DefaultWorkspaces res = defaultWorkspace_raw(); + return res; +} + +inline bool FusionProductPreferences::defaultWorkspace(DefaultWorkspaces value) +{ + return defaultWorkspace_raw(value); +} + +inline bool FusionProductPreferences::isJointPreviewAnimated() const +{ + bool res = isJointPreviewAnimated_raw(); + return res; +} + +inline bool FusionProductPreferences::isJointPreviewAnimated(bool value) +{ + return isJointPreviewAnimated_raw(value); +} + +inline bool FusionProductPreferences::is3DSketchingAllowed() const +{ + bool res = is3DSketchingAllowed_raw(); + return res; +} + +inline bool FusionProductPreferences::is3DSketchingAllowed(bool value) +{ + return is3DSketchingAllowed_raw(value); +} + +inline bool FusionProductPreferences::isGhostedResultBodyShown() const +{ + bool res = isGhostedResultBodyShown_raw(); + return res; +} + +inline bool FusionProductPreferences::isGhostedResultBodyShown(bool value) +{ + return isGhostedResultBodyShown_raw(value); +} + +inline bool FusionProductPreferences::isDimensionEditedWhenCreated() const +{ + bool res = isDimensionEditedWhenCreated_raw(); + return res; +} + +inline bool FusionProductPreferences::isDimensionEditedWhenCreated(bool value) +{ + return isDimensionEditedWhenCreated_raw(value); +} + +inline bool FusionProductPreferences::isAutoLookAtSketch() const +{ + bool res = isAutoLookAtSketch_raw(); + return res; +} + +inline bool FusionProductPreferences::isAutoLookAtSketch(bool value) +{ + return isAutoLookAtSketch_raw(value); +} + +inline bool FusionProductPreferences::isAutoProjectGeometry() const +{ + bool res = isAutoProjectGeometry_raw(); + return res; +} + +inline bool FusionProductPreferences::isAutoProjectGeometry(bool value) +{ + return isAutoProjectGeometry_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FUSIONPRODUCTPREFERENCES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/FusionUnitsManager.h b/usr/autodesk/CPP/include/Fusion/Fusion/FusionUnitsManager.h new file mode 100644 index 0000000..f0cef8e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/FusionUnitsManager.h @@ -0,0 +1,84 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "../../Core/Application/UnitsManager.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FUSIONUNITSMANAGER_CPP__ +# define ADSK_FUSION_FUSIONUNITSMANAGER_API XI_EXPORT +# else +# define ADSK_FUSION_FUSIONUNITSMANAGER_API +# endif +#else +# define ADSK_FUSION_FUSIONUNITSMANAGER_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Design; +}} + +namespace adsk { namespace fusion { + +/// Utility class used to work with Values and control default units. +/// Internal values are held in SI units (e.g. seconds, radians, kg for time, angle, mass) +/// with the exception that all lengths are in cm rather than meter and this affects derived +/// units (e.g. velocity is cm/s, volume is cm^3). Units are specified flexibly via strings +/// (e.g. "cm", "in", "inch", "cm^3", "cm*cm*cm", "mph", "mps" "m/s"). +class FusionUnitsManager : public core::UnitsManager { +public: + + /// Returns the parent design + core::Ptr design() const; + + /// Gets and sets the default distance units for this design. + DistanceUnits distanceDisplayUnits() const; + bool distanceDisplayUnits(DistanceUnits value); + + ADSK_FUSION_FUSIONUNITSMANAGER_API static const char* classType(); + ADSK_FUSION_FUSIONUNITSMANAGER_API const char* objectType() const override; + ADSK_FUSION_FUSIONUNITSMANAGER_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FUSIONUNITSMANAGER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Design* design_raw() const = 0; + virtual DistanceUnits distanceDisplayUnits_raw() const = 0; + virtual bool distanceDisplayUnits_raw(DistanceUnits value) = 0; +}; + +// Inline wrappers + +inline core::Ptr FusionUnitsManager::design() const +{ + core::Ptr res = design_raw(); + return res; +} + +inline DistanceUnits FusionUnitsManager::distanceDisplayUnits() const +{ + DistanceUnits res = distanceDisplayUnits_raw(); + return res; +} + +inline bool FusionUnitsManager::distanceDisplayUnits(DistanceUnits value) +{ + return distanceDisplayUnits_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FUSIONUNITSMANAGER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/IGESExportOptions.h b/usr/autodesk/CPP/include/Fusion/Fusion/IGESExportOptions.h new file mode 100644 index 0000000..f4ee846 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/IGESExportOptions.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExportOptions.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_IGESEXPORTOPTIONS_CPP__ +# define ADSK_FUSION_IGESEXPORTOPTIONS_API XI_EXPORT +# else +# define ADSK_FUSION_IGESEXPORTOPTIONS_API +# endif +#else +# define ADSK_FUSION_IGESEXPORTOPTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines that an IGES export is to be done and specifies the various options. +class IGESExportOptions : public ExportOptions { +public: + + ADSK_FUSION_IGESEXPORTOPTIONS_API static const char* classType(); + ADSK_FUSION_IGESEXPORTOPTIONS_API const char* objectType() const override; + ADSK_FUSION_IGESEXPORTOPTIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_IGESEXPORTOPTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_IGESEXPORTOPTIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/IntegerParameterValue.h b/usr/autodesk/CPP/include/Fusion/Fusion/IntegerParameterValue.h new file mode 100644 index 0000000..d39a105 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/IntegerParameterValue.h @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ParameterValue.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_INTEGERPARAMETERVALUE_CPP__ +# define ADSK_FUSION_INTEGERPARAMETERVALUE_API XI_EXPORT +# else +# define ADSK_FUSION_INTEGERPARAMETERVALUE_API +# endif +#else +# define ADSK_FUSION_INTEGERPARAMETERVALUE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A parameter value that is an integer. +class IntegerParameterValue : public ParameterValue { +public: + + /// Get or set the value of the parameter. + int value() const; + bool value(int value); + + ADSK_FUSION_INTEGERPARAMETERVALUE_API static const char* classType(); + ADSK_FUSION_INTEGERPARAMETERVALUE_API const char* objectType() const override; + ADSK_FUSION_INTEGERPARAMETERVALUE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_INTEGERPARAMETERVALUE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual int value_raw() const = 0; + virtual bool value_raw(int value) = 0; +}; + +// Inline wrappers + +inline int IntegerParameterValue::value() const +{ + int res = value_raw(); + return res; +} + +inline bool IntegerParameterValue::value(int value) +{ + return value_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_INTEGERPARAMETERVALUE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/InterferenceInput.h b/usr/autodesk/CPP/include/Fusion/Fusion/InterferenceInput.h new file mode 100644 index 0000000..74b52e9 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/InterferenceInput.h @@ -0,0 +1,91 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_INTERFERENCEINPUT_CPP__ +# define ADSK_FUSION_INTERFERENCEINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_INTERFERENCEINPUT_API +# endif +#else +# define ADSK_FUSION_INTERFERENCEINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Used to gather and define the various inputs and settings needed to calculate interference. This +/// object is created using the Design.createInterferenceInput method. +class InterferenceInput : public core::Base { +public: + + /// Gets and set an ObjectCollection containing BRepBody and/or Occurrence entities that + /// will be used when checking for interference. All entities must be in the context of + /// the root component of the top-level design. + core::Ptr entities() const; + bool entities(const core::Ptr& value); + + /// Gets and sets whether any coincident faces in the input bodies are considered as interference + /// or not. This property defaults to False for a newly created InterferenceInput object. + bool areCoincidentFacesIncluded() const; + bool areCoincidentFacesIncluded(bool value); + + ADSK_FUSION_INTERFERENCEINPUT_API static const char* classType(); + ADSK_FUSION_INTERFERENCEINPUT_API const char* objectType() const override; + ADSK_FUSION_INTERFERENCEINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_INTERFERENCEINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::ObjectCollection* entities_raw() const = 0; + virtual bool entities_raw(core::ObjectCollection* value) = 0; + virtual bool areCoincidentFacesIncluded_raw() const = 0; + virtual bool areCoincidentFacesIncluded_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr InterferenceInput::entities() const +{ + core::Ptr res = entities_raw(); + return res; +} + +inline bool InterferenceInput::entities(const core::Ptr& value) +{ + return entities_raw(value.get()); +} + +inline bool InterferenceInput::areCoincidentFacesIncluded() const +{ + bool res = areCoincidentFacesIncluded_raw(); + return res; +} + +inline bool InterferenceInput::areCoincidentFacesIncluded(bool value) +{ + return areCoincidentFacesIncluded_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_INTERFERENCEINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/InterferenceResult.h b/usr/autodesk/CPP/include/Fusion/Fusion/InterferenceResult.h new file mode 100644 index 0000000..b1fc666 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/InterferenceResult.h @@ -0,0 +1,103 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_INTERFERENCERESULT_CPP__ +# define ADSK_FUSION_INTERFERENCERESULT_API XI_EXPORT +# else +# define ADSK_FUSION_INTERFERENCERESULT_API +# endif +#else +# define ADSK_FUSION_INTERFERENCERESULT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; +}} + +namespace adsk { namespace fusion { + +/// Represents the interference between bodies and/or occurrences in an interference analysis. +class InterferenceResult : public core::Base { +public: + + /// Returns the first entity involved in the interference + core::Ptr entityOne() const; + + /// Returns the second entity involved in the interference + core::Ptr entityTwo() const; + + /// Returns a transient BRepBody that represents the volume of interference. + core::Ptr interferenceBody() const; + + /// Gets and sets if this interference volume should be created as a model body. Setting + /// this to true doesn't create the body just indicates that a body is desired. Calling + /// the createBodies method on the interferenceResults object will result in the creation + /// of the model body if this property is true. + bool isCreateBody() const; + bool isCreateBody(bool value); + + ADSK_FUSION_INTERFERENCERESULT_API static const char* classType(); + ADSK_FUSION_INTERFERENCERESULT_API const char* objectType() const override; + ADSK_FUSION_INTERFERENCERESULT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_INTERFERENCERESULT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* entityOne_raw() const = 0; + virtual core::Base* entityTwo_raw() const = 0; + virtual BRepBody* interferenceBody_raw() const = 0; + virtual bool isCreateBody_raw() const = 0; + virtual bool isCreateBody_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr InterferenceResult::entityOne() const +{ + core::Ptr res = entityOne_raw(); + return res; +} + +inline core::Ptr InterferenceResult::entityTwo() const +{ + core::Ptr res = entityTwo_raw(); + return res; +} + +inline core::Ptr InterferenceResult::interferenceBody() const +{ + core::Ptr res = interferenceBody_raw(); + return res; +} + +inline bool InterferenceResult::isCreateBody() const +{ + bool res = isCreateBody_raw(); + return res; +} + +inline bool InterferenceResult::isCreateBody(bool value) +{ + return isCreateBody_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_INTERFERENCERESULT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/InterferenceResults.h b/usr/autodesk/CPP/include/Fusion/Fusion/InterferenceResults.h new file mode 100644 index 0000000..b5d72b2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/InterferenceResults.h @@ -0,0 +1,105 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_INTERFERENCERESULTS_CPP__ +# define ADSK_FUSION_INTERFERENCERESULTS_API XI_EXPORT +# else +# define ADSK_FUSION_INTERFERENCERESULTS_API +# endif +#else +# define ADSK_FUSION_INTERFERENCERESULTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class InterferenceResult; +}} +namespace adsk { namespace core { + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// Transient object used to return the result of an interference analysis. +class InterferenceResults : public core::Base { +public: + + /// Function that returns the specified interference result using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of interference results in the collection. + size_t count() const; + + /// Creates bodies in the model that represent the interference volumes. + /// This is not supported in parametric modeling. + /// allInterferenceBodies : Sets if all bodies or only individual bodies will be created as bodies in the model. + /// If False, then only interferenceResult objects whose isCreateBody property is true + /// will be created as a model body. If true, all interface volumes will be created as + /// a body regardless of the value of the isCreateBody property. + core::Ptr createBodies(bool allInterferenceBodies); + + typedef InterferenceResult iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_INTERFERENCERESULTS_API static const char* classType(); + ADSK_FUSION_INTERFERENCERESULTS_API const char* objectType() const override; + ADSK_FUSION_INTERFERENCERESULTS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_INTERFERENCERESULTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual InterferenceResult* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual core::ObjectCollection* createBodies_raw(bool allInterferenceBodies) = 0; +}; + +// Inline wrappers + +inline core::Ptr InterferenceResults::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t InterferenceResults::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr InterferenceResults::createBodies(bool allInterferenceBodies) +{ + core::Ptr res = createBodies_raw(allInterferenceBodies); + return res; +} + +template inline void InterferenceResults::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_INTERFERENCERESULTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/ModelParameter.h b/usr/autodesk/CPP/include/Fusion/Fusion/ModelParameter.h new file mode 100644 index 0000000..2ef0099 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/ModelParameter.h @@ -0,0 +1,131 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Parameter.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MODELPARAMETER_CPP__ +# define ADSK_FUSION_MODELPARAMETER_API XI_EXPORT +# else +# define ADSK_FUSION_MODELPARAMETER_API +# endif +#else +# define ADSK_FUSION_MODELPARAMETER_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class ModelParameters; +}} + +namespace adsk { namespace fusion { + +/// Represents a Model Parameter. +class ModelParameter : public Parameter { +public: + + /// Returns the Collection containing the ModelParameter. + core::Ptr modelParameters() const; + + /// Returns the Component containing the ModelParameter. + core::Ptr component() const; + + /// This property identifies what the parameter is used for. For an extrude, it + /// could be "Depth", for a work plane it could be "Offset". + std::string role() const; + + /// Returns the object that created this parameter. For example, + /// a feature, a sketch dimension, or a construction plane. + core::Ptr createdBy() const; + + ADSK_FUSION_MODELPARAMETER_API static const char* classType(); + ADSK_FUSION_MODELPARAMETER_API const char* objectType() const override; + ADSK_FUSION_MODELPARAMETER_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MODELPARAMETER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ModelParameters* modelParameters_raw() const = 0; + virtual Component* component_raw() const = 0; + virtual char* role_raw() const = 0; + virtual core::Base* createdBy_raw() const = 0; + virtual void placeholderModelParameter0() {} + virtual void placeholderModelParameter1() {} + virtual void placeholderModelParameter2() {} + virtual void placeholderModelParameter3() {} + virtual void placeholderModelParameter4() {} + virtual void placeholderModelParameter5() {} + virtual void placeholderModelParameter6() {} + virtual void placeholderModelParameter7() {} + virtual void placeholderModelParameter8() {} + virtual void placeholderModelParameter9() {} + virtual void placeholderModelParameter10() {} + virtual void placeholderModelParameter11() {} + virtual void placeholderModelParameter12() {} + virtual void placeholderModelParameter13() {} + virtual void placeholderModelParameter14() {} + virtual void placeholderModelParameter15() {} + virtual void placeholderModelParameter16() {} + virtual void placeholderModelParameter17() {} + virtual void placeholderModelParameter18() {} + virtual void placeholderModelParameter19() {} + virtual void placeholderModelParameter20() {} + virtual void placeholderModelParameter21() {} + virtual void placeholderModelParameter22() {} + virtual void placeholderModelParameter23() {} + virtual void placeholderModelParameter24() {} + virtual void placeholderModelParameter25() {} + virtual void placeholderModelParameter26() {} + virtual void placeholderModelParameter27() {} +}; + +// Inline wrappers + +inline core::Ptr ModelParameter::modelParameters() const +{ + core::Ptr res = modelParameters_raw(); + return res; +} + +inline core::Ptr ModelParameter::component() const +{ + core::Ptr res = component_raw(); + return res; +} + +inline std::string ModelParameter::role() const +{ + std::string res; + + char* p= role_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline core::Ptr ModelParameter::createdBy() const +{ + core::Ptr res = createdBy_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MODELPARAMETER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/ModelParameters.h b/usr/autodesk/CPP/include/Fusion/Fusion/ModelParameters.h new file mode 100644 index 0000000..7428841 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/ModelParameters.h @@ -0,0 +1,113 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MODELPARAMETERS_CPP__ +# define ADSK_FUSION_MODELPARAMETERS_API XI_EXPORT +# else +# define ADSK_FUSION_MODELPARAMETERS_API +# endif +#else +# define ADSK_FUSION_MODELPARAMETERS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class ModelParameter; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the Model Parameters within a component. +class ModelParameters : public core::Base { +public: + + /// Function that returns the specified Model Parameter using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection + /// has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified Model Parameter using the name of the parameter as it is + /// displayed in the parameters dialog. + /// name : The name of the Model Parameter as it is displayed in the parameters dialog + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns the number of parameters in the collection. + size_t count() const; + + /// Returns the component that owns the Model Parameters collection + core::Ptr component() const; + + typedef ModelParameter iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_MODELPARAMETERS_API static const char* classType(); + ADSK_FUSION_MODELPARAMETERS_API const char* objectType() const override; + ADSK_FUSION_MODELPARAMETERS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MODELPARAMETERS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ModelParameter* item_raw(size_t index) const = 0; + virtual ModelParameter* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual Component* component_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ModelParameters::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr ModelParameters::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t ModelParameters::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr ModelParameters::component() const +{ + core::Ptr res = component_raw(); + return res; +} + +template inline void ModelParameters::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MODELPARAMETERS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/Parameter.h b/usr/autodesk/CPP/include/Fusion/Fusion/Parameter.h new file mode 100644 index 0000000..3493c72 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/Parameter.h @@ -0,0 +1,257 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PARAMETER_CPP__ +# define ADSK_FUSION_PARAMETER_API XI_EXPORT +# else +# define ADSK_FUSION_PARAMETER_API +# endif +#else +# define ADSK_FUSION_PARAMETER_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ParameterList; +}} +namespace adsk { namespace core { + class Attributes; +}} + +namespace adsk { namespace fusion { + +/// The base class Parameter object that can represent model or user parameters. +class Parameter : public core::Base { +public: + + /// Gets and sets the real value (a double) of the parameter in database units. + /// Setting this property will set/reset the expression value for this parameter + double value() const; + bool value(double value); + + /// Gets and sets the expression (i.e. "22.064 mm") used to calculate the value of the parameter + std::string expression() const; + bool expression(const std::string& value); + + /// Gets and sets the name of the parameter. Setting the name can fail if the name + /// is not unique with respect to all other parameters in the design. + std::string name() const; + bool name(const std::string& value); + + /// The unit type associated with this parameter. An empty string is returned for parameters + /// that don't have a unit type. + std::string unit() const; + + /// The comment associated with this parameter + std::string comment() const; + bool comment(const std::string& value); + + /// Gets and sets whether this parameter is included in the Favorites list in the + /// parameters dialog + bool isFavorite() const; + bool isFavorite(bool value); + + /// Returns a list of parameters that are dependent on this parameter as a result + /// of this parameter being referenced in their equation. + core::Ptr dependentParameters() const; + + /// Gets if this parameter can be deleted. Parameters that cannot be deleted are: Model Parameters and + /// User Parameters that have dependents. + bool isDeletable() const; + + /// Returns the collection of attributes associated with this face. + core::Ptr attributes() const; + + /// Returns a token for the Parameter object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same parameter. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_PARAMETER_API static const char* classType(); + ADSK_FUSION_PARAMETER_API const char* objectType() const override; + ADSK_FUSION_PARAMETER_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PARAMETER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual double value_raw() const = 0; + virtual bool value_raw(double value) = 0; + virtual char* expression_raw() const = 0; + virtual bool expression_raw(const char * value) = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual char* unit_raw() const = 0; + virtual char* comment_raw() const = 0; + virtual bool comment_raw(const char * value) = 0; + virtual bool isFavorite_raw() const = 0; + virtual bool isFavorite_raw(bool value) = 0; + virtual ParameterList* dependentParameters_raw() const = 0; + virtual bool isDeletable_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual char* entityToken_raw() const = 0; + virtual void placeholderParameter0() {} + virtual void placeholderParameter1() {} + virtual void placeholderParameter2() {} + virtual void placeholderParameter3() {} + virtual void placeholderParameter4() {} + virtual void placeholderParameter5() {} + virtual void placeholderParameter6() {} + virtual void placeholderParameter7() {} + virtual void placeholderParameter8() {} + virtual void placeholderParameter9() {} + virtual void placeholderParameter10() {} + virtual void placeholderParameter11() {} + virtual void placeholderParameter12() {} + virtual void placeholderParameter13() {} + virtual void placeholderParameter14() {} + virtual void placeholderParameter15() {} + virtual void placeholderParameter16() {} +}; + +// Inline wrappers + +inline double Parameter::value() const +{ + double res = value_raw(); + return res; +} + +inline bool Parameter::value(double value) +{ + return value_raw(value); +} + +inline std::string Parameter::expression() const +{ + std::string res; + + char* p= expression_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Parameter::expression(const std::string& value) +{ + return expression_raw(value.c_str()); +} + +inline std::string Parameter::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Parameter::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline std::string Parameter::unit() const +{ + std::string res; + + char* p= unit_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::string Parameter::comment() const +{ + std::string res; + + char* p= comment_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Parameter::comment(const std::string& value) +{ + return comment_raw(value.c_str()); +} + +inline bool Parameter::isFavorite() const +{ + bool res = isFavorite_raw(); + return res; +} + +inline bool Parameter::isFavorite(bool value) +{ + return isFavorite_raw(value); +} + +inline core::Ptr Parameter::dependentParameters() const +{ + core::Ptr res = dependentParameters_raw(); + return res; +} + +inline bool Parameter::isDeletable() const +{ + bool res = isDeletable_raw(); + return res; +} + +inline core::Ptr Parameter::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline std::string Parameter::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PARAMETER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/ParameterList.h b/usr/autodesk/CPP/include/Fusion/Fusion/ParameterList.h new file mode 100644 index 0000000..b585378 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/ParameterList.h @@ -0,0 +1,209 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PARAMETERLIST_CPP__ +# define ADSK_FUSION_PARAMETERLIST_API XI_EXPORT +# else +# define ADSK_FUSION_PARAMETERLIST_API +# endif +#else +# define ADSK_FUSION_PARAMETERLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Parameter; +}} + +namespace adsk { namespace fusion { + +/// Transient object used to pass a set of parameters. +class ParameterList : public core::Base { +public: + + /// Function that returns the specified parameter using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the specified parameter using the name of the parameter + /// as it is displayed in the parameters dialog + /// name : The name of the parameter as it is displayed in the parameters dialog + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns the number of parameters in the collection. + size_t count() const; + + /// Adds a parameter to the list. This does not create a + /// new parameter, it adds an existing parameter to the list. + /// Note that duplicates can exist in the list. + /// parameter : The existing parameter to add to the list + /// Returns true if successful. This method will fail if the list is read-only + bool add(const core::Ptr& parameter); + + /// Method that removes a parameter from the list using the index of the item + /// in the list + /// Will fail if the list is read only. + /// index : The index of the parameter to be removed from the list + /// Returns true if successful. This method will fail if the list is read-only + bool removeByIndex(size_t index); + + /// Method that removes a parameter from the list by specifying the parameter (item) + /// to remove + /// item : The parameter item to remove from the list + /// Returns true if successful. This method will fail if the list is read-only + bool removeByItem(const core::Ptr& item); + + /// Finds the specified parameter in the list. The search can be started at a specified + /// index rather than from the beginning of the list. + /// If not found, -1 is returned. + /// parameter : The parameter to find + /// startIndex : the index in the list to start the search from + /// Returns the index of the parameter found in the list. + int find(const core::Ptr& parameter, size_t startIndex = 0) const; + + /// Indicates whether or not ParameterList collection contains a specified parameter + /// parameter : The parameter to look for in the list + /// Returns true if list contains the specified parameter + bool contains(const core::Ptr& parameter) const; + + /// Indicates if the list is read-only + /// Some lists returned by API calls (instead of lists created by the + /// user) are read only. Items cannot be added or remove from such a list. + bool isReadOnly() const; + + /// Creates a parameter list that the client can use for various purposes. + /// Use ParameterList.Add to add parameters to the list after creating it. + /// Returns a ParameterList + static core::Ptr create(); + + typedef Parameter iterable_type; + template void copyTo(OutputIterator result); + template static core::Ptr create(Container container); + template static core::Ptr create(InputIterator first, InputIterator last); + + ADSK_FUSION_PARAMETERLIST_API static const char* classType(); + ADSK_FUSION_PARAMETERLIST_API const char* objectType() const override; + ADSK_FUSION_PARAMETERLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PARAMETERLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Parameter* item_raw(size_t index) const = 0; + virtual Parameter* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual bool add_raw(Parameter* parameter) = 0; + virtual bool removeByIndex_raw(size_t index) = 0; + virtual bool removeByItem_raw(Parameter* item) = 0; + virtual int find_raw(Parameter* parameter, size_t startIndex) const = 0; + virtual bool contains_raw(Parameter* parameter) const = 0; + virtual bool isReadOnly_raw() const = 0; + ADSK_FUSION_PARAMETERLIST_API static ParameterList* create_raw(); +}; + +// Inline wrappers + +inline core::Ptr ParameterList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr ParameterList::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t ParameterList::count() const +{ + size_t res = count_raw(); + return res; +} + +inline bool ParameterList::add(const core::Ptr& parameter) +{ + bool res = add_raw(parameter.get()); + return res; +} + +inline bool ParameterList::removeByIndex(size_t index) +{ + bool res = removeByIndex_raw(index); + return res; +} + +inline bool ParameterList::removeByItem(const core::Ptr& item) +{ + bool res = removeByItem_raw(item.get()); + return res; +} + +inline int ParameterList::find(const core::Ptr& parameter, size_t startIndex) const +{ + int res = find_raw(parameter.get(), startIndex); + return res; +} + +inline bool ParameterList::contains(const core::Ptr& parameter) const +{ + bool res = contains_raw(parameter.get()); + return res; +} + +inline bool ParameterList::isReadOnly() const +{ + bool res = isReadOnly_raw(); + return res; +} + +inline core::Ptr ParameterList::create() +{ + core::Ptr res = create_raw(); + return res; +} + +template inline void ParameterList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} + +template inline core::Ptr ParameterList::create(Container container) +{ + return create(container.begin(), container.end()); +} + +template inline core::Ptr ParameterList::create(InputIterator first, InputIterator last) +{ + core::Ptr list = create(); + if (list) + for (;first != last;++first) + list->add(*first); + return list; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PARAMETERLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/ParameterValue.h b/usr/autodesk/CPP/include/Fusion/Fusion/ParameterValue.h new file mode 100644 index 0000000..b5e19a9 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/ParameterValue.h @@ -0,0 +1,75 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PARAMETERVALUE_CPP__ +# define ADSK_FUSION_PARAMETERVALUE_API XI_EXPORT +# else +# define ADSK_FUSION_PARAMETERVALUE_API +# endif +#else +# define ADSK_FUSION_PARAMETERVALUE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Base class for representing the value of a parameter. +/// Subclasses implement value handling for available parameter types. +class ParameterValue : public core::Base { +public: + + /// Get the parameter object that the value is associated with. + core::Ptr parent() const; + + ADSK_FUSION_PARAMETERVALUE_API static const char* classType(); + ADSK_FUSION_PARAMETERVALUE_API const char* objectType() const override; + ADSK_FUSION_PARAMETERVALUE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PARAMETERVALUE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* parent_raw() const = 0; + virtual void placeholderParameterValue0() {} + virtual void placeholderParameterValue1() {} + virtual void placeholderParameterValue2() {} + virtual void placeholderParameterValue3() {} + virtual void placeholderParameterValue4() {} + virtual void placeholderParameterValue5() {} + virtual void placeholderParameterValue6() {} + virtual void placeholderParameterValue7() {} + virtual void placeholderParameterValue8() {} + virtual void placeholderParameterValue9() {} + virtual void placeholderParameterValue10() {} + virtual void placeholderParameterValue11() {} + virtual void placeholderParameterValue12() {} + virtual void placeholderParameterValue13() {} + virtual void placeholderParameterValue14() {} +}; + +// Inline wrappers + +inline core::Ptr ParameterValue::parent() const +{ + core::Ptr res = parent_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PARAMETERVALUE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/PhysicalProperties.h b/usr/autodesk/CPP/include/Fusion/Fusion/PhysicalProperties.h new file mode 100644 index 0000000..da2a44d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/PhysicalProperties.h @@ -0,0 +1,195 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PHYSICALPROPERTIES_CPP__ +# define ADSK_FUSION_PHYSICALPROPERTIES_API XI_EXPORT +# else +# define ADSK_FUSION_PHYSICALPROPERTIES_API +# endif +#else +# define ADSK_FUSION_PHYSICALPROPERTIES_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Point3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// The physical properties of a Component, Occurrence or BRepBody +class PhysicalProperties : public core::Base { +public: + + /// Gets the area in square centimeters. + double area() const; + + /// Gets the density in kilograms per cubic centimeter. + double density() const; + + /// Gets the mass in kilograms. + double mass() const; + + /// Gets the volume in the cubic centimeters. + double volume() const; + + /// Returns the accuracy that was used for the calculation. + CalculationAccuracy accuracy() const; + + /// Returns the center of mass position + core::Ptr centerOfMass() const; + + /// Method that returns the principal axes. + /// xAxis : The output Vector3D object that indicates the direction of the x axis. + /// yAxis : The output Vector3D object that indicates the direction of the y axis. + /// zAxis : The output Vector3D object that indicates the direction of the z axis. + /// Returns true if successful + bool getPrincipalAxes(core::Ptr& xAxis, core::Ptr& yAxis, core::Ptr& zAxis) const; + + /// Method that returns the moments of inertia about the principal axes. Unit for returned values is kg/cm^2. + /// i1 : Output Double that specifies the first moment of inertia. + /// i2 : Output Double that specifies the second moment of inertia. + /// i3 : Output Double that specifies the third moment of inertia. + /// Returns true if successful + bool getPrincipalMomentsOfInertia(double& i1, double& i2, double& i3) const; + + /// Method that returns the radius of gyration about the principal axes. Unit for returned values is cm. + /// kx : Output Double that returns the X partial radius of gyration. + /// ky : Output Double that returns the Y partial radius of gyration. + /// kz : Output Double that returns the Z partial radius of gyration. + /// Returns true if successful + bool getRadiusOfGyration(double& kx, double& ky, double& kz) const; + + /// Gets the rotation from the world coordinate system of the target to the principal coordinate system. + /// rx : + /// ry : + /// rz : + /// Returns true if successful + bool getRotationToPrincipal(double& rx, double& ry, double& rz) const; + + /// Method that gets the moment of inertia about the world coordinate system. + /// Unit for returned values is kg/cm^2. + /// xx : Output Double that returns the XX partial moment. + /// yy : Output Double that returns the YY partial moment. + /// zz : Output Double that returns the ZZ partial moment. + /// xy : Output Double that returns the XY partial moment. + /// yz : Output Double that returns the YZ partial moment. + /// xz : Output Double that returns the XZ partial moment. + /// Returns true if successful + bool getXYZMomentsOfInertia(double& xx, double& yy, double& zz, double& xy, double& yz, double& xz) const; + + ADSK_FUSION_PHYSICALPROPERTIES_API static const char* classType(); + ADSK_FUSION_PHYSICALPROPERTIES_API const char* objectType() const override; + ADSK_FUSION_PHYSICALPROPERTIES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PHYSICALPROPERTIES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual double area_raw() const = 0; + virtual double density_raw() const = 0; + virtual double mass_raw() const = 0; + virtual double volume_raw() const = 0; + virtual CalculationAccuracy accuracy_raw() const = 0; + virtual core::Point3D* centerOfMass_raw() const = 0; + virtual bool getPrincipalAxes_raw(core::Vector3D*& xAxis, core::Vector3D*& yAxis, core::Vector3D*& zAxis) const = 0; + virtual bool getPrincipalMomentsOfInertia_raw(double& i1, double& i2, double& i3) const = 0; + virtual bool getRadiusOfGyration_raw(double& kx, double& ky, double& kz) const = 0; + virtual bool getRotationToPrincipal_raw(double& rx, double& ry, double& rz) const = 0; + virtual bool getXYZMomentsOfInertia_raw(double& xx, double& yy, double& zz, double& xy, double& yz, double& xz) const = 0; +}; + +// Inline wrappers + +inline double PhysicalProperties::area() const +{ + double res = area_raw(); + return res; +} + +inline double PhysicalProperties::density() const +{ + double res = density_raw(); + return res; +} + +inline double PhysicalProperties::mass() const +{ + double res = mass_raw(); + return res; +} + +inline double PhysicalProperties::volume() const +{ + double res = volume_raw(); + return res; +} + +inline CalculationAccuracy PhysicalProperties::accuracy() const +{ + CalculationAccuracy res = accuracy_raw(); + return res; +} + +inline core::Ptr PhysicalProperties::centerOfMass() const +{ + core::Ptr res = centerOfMass_raw(); + return res; +} + +inline bool PhysicalProperties::getPrincipalAxes(core::Ptr& xAxis, core::Ptr& yAxis, core::Ptr& zAxis) const +{ + core::Vector3D* xAxis_ = nullptr; + core::Vector3D* yAxis_ = nullptr; + core::Vector3D* zAxis_ = nullptr; + + bool res = getPrincipalAxes_raw(xAxis_, yAxis_, zAxis_); + xAxis = xAxis_; + yAxis = yAxis_; + zAxis = zAxis_; + return res; +} + +inline bool PhysicalProperties::getPrincipalMomentsOfInertia(double& i1, double& i2, double& i3) const +{ + bool res = getPrincipalMomentsOfInertia_raw(i1, i2, i3); + return res; +} + +inline bool PhysicalProperties::getRadiusOfGyration(double& kx, double& ky, double& kz) const +{ + bool res = getRadiusOfGyration_raw(kx, ky, kz); + return res; +} + +inline bool PhysicalProperties::getRotationToPrincipal(double& rx, double& ry, double& rz) const +{ + bool res = getRotationToPrincipal_raw(rx, ry, rz); + return res; +} + +inline bool PhysicalProperties::getXYZMomentsOfInertia(double& xx, double& yy, double& zz, double& xy, double& yz, double& xz) const +{ + bool res = getXYZMomentsOfInertia_raw(xx, yy, zz, xy, yz, xz); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PHYSICALPROPERTIES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/SATExportOptions.h b/usr/autodesk/CPP/include/Fusion/Fusion/SATExportOptions.h new file mode 100644 index 0000000..1954651 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/SATExportOptions.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExportOptions.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SATEXPORTOPTIONS_CPP__ +# define ADSK_FUSION_SATEXPORTOPTIONS_API XI_EXPORT +# else +# define ADSK_FUSION_SATEXPORTOPTIONS_API +# endif +#else +# define ADSK_FUSION_SATEXPORTOPTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines that a SAT export is to be done and specifies the various options. +class SATExportOptions : public ExportOptions { +public: + + ADSK_FUSION_SATEXPORTOPTIONS_API static const char* classType(); + ADSK_FUSION_SATEXPORTOPTIONS_API const char* objectType() const override; + ADSK_FUSION_SATEXPORTOPTIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SATEXPORTOPTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SATEXPORTOPTIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/SMTExportOptions.h b/usr/autodesk/CPP/include/Fusion/Fusion/SMTExportOptions.h new file mode 100644 index 0000000..b22e189 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/SMTExportOptions.h @@ -0,0 +1,71 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExportOptions.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SMTEXPORTOPTIONS_CPP__ +# define ADSK_FUSION_SMTEXPORTOPTIONS_API XI_EXPORT +# else +# define ADSK_FUSION_SMTEXPORTOPTIONS_API +# endif +#else +# define ADSK_FUSION_SMTEXPORTOPTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines that an SMT export is to be done and specifies the various options. +class SMTExportOptions : public ExportOptions { +public: + + /// Gets and set the version of the SMT format to write to. The default + /// is to use the current version of the Autodesk Shape Manager kernel + /// that Fusion 360 is using. Specifying an invalid version will result + /// in an assert. + /// Valid versions are 218 up to the current version, which is what this + /// property returns by default when a new SMTExportOptions object is + /// created. + int version() const; + bool version(int value); + + ADSK_FUSION_SMTEXPORTOPTIONS_API static const char* classType(); + ADSK_FUSION_SMTEXPORTOPTIONS_API const char* objectType() const override; + ADSK_FUSION_SMTEXPORTOPTIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SMTEXPORTOPTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual int version_raw() const = 0; + virtual bool version_raw(int value) = 0; +}; + +// Inline wrappers + +inline int SMTExportOptions::version() const +{ + int res = version_raw(); + return res; +} + +inline bool SMTExportOptions::version(int value) +{ + return version_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SMTEXPORTOPTIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/STEPExportOptions.h b/usr/autodesk/CPP/include/Fusion/Fusion/STEPExportOptions.h new file mode 100644 index 0000000..db85afb --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/STEPExportOptions.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ExportOptions.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_STEPEXPORTOPTIONS_CPP__ +# define ADSK_FUSION_STEPEXPORTOPTIONS_API XI_EXPORT +# else +# define ADSK_FUSION_STEPEXPORTOPTIONS_API +# endif +#else +# define ADSK_FUSION_STEPEXPORTOPTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines that a STEP export is to be done and specifies the various options. +class STEPExportOptions : public ExportOptions { +public: + + ADSK_FUSION_STEPEXPORTOPTIONS_API static const char* classType(); + ADSK_FUSION_STEPEXPORTOPTIONS_API const char* objectType() const override; + ADSK_FUSION_STEPEXPORTOPTIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_STEPEXPORTOPTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_STEPEXPORTOPTIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/STLExportOptions.h b/usr/autodesk/CPP/include/Fusion/Fusion/STLExportOptions.h new file mode 100644 index 0000000..accca3b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/STLExportOptions.h @@ -0,0 +1,256 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "ExportOptions.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_STLEXPORTOPTIONS_CPP__ +# define ADSK_FUSION_STLEXPORTOPTIONS_API XI_EXPORT +# else +# define ADSK_FUSION_STLEXPORTOPTIONS_API +# endif +#else +# define ADSK_FUSION_STLEXPORTOPTIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines that a STL export is to be done and specifies the various options. +class STLExportOptions : public ExportOptions { +public: + + /// Indicates if the STL file is to be an ASCII or binary STL format. The default is true. + bool isBinaryFormat() const; + bool isBinaryFormat(bool value); + + /// If the input is an Occurrence or the root Component, this specifies if a single file should be created containing + /// all of the bodies within that occurrence or component or if multiple files should be created; one for each body. + /// If multiple files are created, the body name is appended to the filename. The default is false. + bool isOneFilePerBody() const; + bool isOneFilePerBody(bool value); + + /// Gets and sets the current simple mesh refinement settings. Setting this property + /// will reset the surfaceDeviation, normalDeviation, maximumEdgeLength, and aspectRatio + /// to values that correspond to the specified mesh refinement. The default is MeshRefinementMedium + MeshRefinementSettings meshRefinement() const; + bool meshRefinement(MeshRefinementSettings value); + + /// Gets and sets the current surface deviation, or the distance the mesh can deviate + /// from the actual surface. This is defined in centimeter. Setting this property + /// will automatically set the meshRefinement to MeshRefinementCustom. The default is the value + /// associated with medium mesh refinement. + double surfaceDeviation() const; + bool surfaceDeviation(double value); + + /// Gets and sets the current normal deviation, or the angle the mesh normals at the vertices can deviate + /// from the actual surface normals. This is defined in radians. Setting this property + /// will automatically set the meshRefinement to MeshRefinementCustom. The default is the value + /// associated with medium mesh refinement. + double normalDeviation() const; + bool normalDeviation(double value); + + /// Gets and sets the maximum length of any mesh edge. This is defined in centimeter. Setting this property + /// will automatically set the meshRefinement to MeshRefinementCustom. The default is the value + /// associated with medium mesh refinement. + double maximumEdgeLength() const; + bool maximumEdgeLength(double value); + + /// Gets and sets the minimum aspect ratio for that triangles that are generated for the mesh. Setting this property + /// will automatically set the meshRefinement to MeshRefinementCustom. The default is the value + /// associated with medium mesh refinement. + double aspectRatio() const; + bool aspectRatio(double value); + + /// Returns a list of the known available print utilities. These strings can be used to set the PrintUtility + /// property to specify which print utility to open the STL file in. + std::vector availablePrintUtilities() const; + + /// Specifies which print utility to use when opening the STL file if the sendToPrintUtility property is true. + /// The value of this property can be one of the strings returned by the availalbePrintUtilities property, which + /// will specify one of the know print utilities. You can also specify a custom print utility by specifying + /// the full path to the print utility executable. The default value of this property is the last setting specified + /// in the user-interface. + std::string printUtility() const; + bool printUtility(const std::string& value); + + /// Gets and sets whether the created STL file will be sent to the print utility specified by the printUtility property. If this + /// is false a filename must be defined. + bool sendToPrintUtility() const; + bool sendToPrintUtility(bool value); + + ADSK_FUSION_STLEXPORTOPTIONS_API static const char* classType(); + ADSK_FUSION_STLEXPORTOPTIONS_API const char* objectType() const override; + ADSK_FUSION_STLEXPORTOPTIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_STLEXPORTOPTIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isBinaryFormat_raw() const = 0; + virtual bool isBinaryFormat_raw(bool value) = 0; + virtual bool isOneFilePerBody_raw() const = 0; + virtual bool isOneFilePerBody_raw(bool value) = 0; + virtual MeshRefinementSettings meshRefinement_raw() const = 0; + virtual bool meshRefinement_raw(MeshRefinementSettings value) = 0; + virtual double surfaceDeviation_raw() const = 0; + virtual bool surfaceDeviation_raw(double value) = 0; + virtual double normalDeviation_raw() const = 0; + virtual bool normalDeviation_raw(double value) = 0; + virtual double maximumEdgeLength_raw() const = 0; + virtual bool maximumEdgeLength_raw(double value) = 0; + virtual double aspectRatio_raw() const = 0; + virtual bool aspectRatio_raw(double value) = 0; + virtual char** availablePrintUtilities_raw(size_t& return_size) const = 0; + virtual char* printUtility_raw() const = 0; + virtual bool printUtility_raw(const char * value) = 0; + virtual bool sendToPrintUtility_raw() const = 0; + virtual bool sendToPrintUtility_raw(bool value) = 0; +}; + +// Inline wrappers + +inline bool STLExportOptions::isBinaryFormat() const +{ + bool res = isBinaryFormat_raw(); + return res; +} + +inline bool STLExportOptions::isBinaryFormat(bool value) +{ + return isBinaryFormat_raw(value); +} + +inline bool STLExportOptions::isOneFilePerBody() const +{ + bool res = isOneFilePerBody_raw(); + return res; +} + +inline bool STLExportOptions::isOneFilePerBody(bool value) +{ + return isOneFilePerBody_raw(value); +} + +inline MeshRefinementSettings STLExportOptions::meshRefinement() const +{ + MeshRefinementSettings res = meshRefinement_raw(); + return res; +} + +inline bool STLExportOptions::meshRefinement(MeshRefinementSettings value) +{ + return meshRefinement_raw(value); +} + +inline double STLExportOptions::surfaceDeviation() const +{ + double res = surfaceDeviation_raw(); + return res; +} + +inline bool STLExportOptions::surfaceDeviation(double value) +{ + return surfaceDeviation_raw(value); +} + +inline double STLExportOptions::normalDeviation() const +{ + double res = normalDeviation_raw(); + return res; +} + +inline bool STLExportOptions::normalDeviation(double value) +{ + return normalDeviation_raw(value); +} + +inline double STLExportOptions::maximumEdgeLength() const +{ + double res = maximumEdgeLength_raw(); + return res; +} + +inline bool STLExportOptions::maximumEdgeLength(double value) +{ + return maximumEdgeLength_raw(value); +} + +inline double STLExportOptions::aspectRatio() const +{ + double res = aspectRatio_raw(); + return res; +} + +inline bool STLExportOptions::aspectRatio(double value) +{ + return aspectRatio_raw(value); +} + +inline std::vector STLExportOptions::availablePrintUtilities() const +{ + std::vector res; + size_t s; + + char** p= availablePrintUtilities_raw(s); + if(p) + { + res.resize(s); + for(size_t i=0; i + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SNAPSHOT_CPP__ +# define ADSK_FUSION_SNAPSHOT_API XI_EXPORT +# else +# define ADSK_FUSION_SNAPSHOT_API +# endif +#else +# define ADSK_FUSION_SNAPSHOT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TimelineObject; +}} + +namespace adsk { namespace fusion { + +/// Object that represents a Snapshot in the timeline +class Snapshot : public core::Base { +public: + + /// Gets and sets the name of the snapshot as seen in the timeline. + std::string name() const; + bool name(const std::string& value); + + /// Returns the timeline object associated with this snapshot. + core::Ptr timelineObject() const; + + /// Deletes this snapshot. + /// Returns true if the delete was successful. + bool deleteMe(); + + ADSK_FUSION_SNAPSHOT_API static const char* classType(); + ADSK_FUSION_SNAPSHOT_API const char* objectType() const override; + ADSK_FUSION_SNAPSHOT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SNAPSHOT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual bool deleteMe_raw() = 0; +}; + +// Inline wrappers + +inline std::string Snapshot::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Snapshot::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline core::Ptr Snapshot::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline bool Snapshot::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SNAPSHOT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/Snapshots.h b/usr/autodesk/CPP/include/Fusion/Fusion/Snapshots.h new file mode 100644 index 0000000..f1cdf21 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/Snapshots.h @@ -0,0 +1,122 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SNAPSHOTS_CPP__ +# define ADSK_FUSION_SNAPSHOTS_API XI_EXPORT +# else +# define ADSK_FUSION_SNAPSHOTS_API +# endif +#else +# define ADSK_FUSION_SNAPSHOTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Snapshot; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the Snapshots within a design and provides +/// methods to create new Snapshots. +class Snapshots : public core::Base { +public: + + /// Creates a new snapshot. Creating a snapshot is only valid when the HasPendingTransforms property returns true. + /// Returns the newly created snapshot. + core::Ptr add(); + + /// Function that returns the specified snapshot in the collection using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of items in the collection. + size_t count() const; + + /// Indicates if there are any changes that have been made than can be snapshot. + bool hasPendingSnapshot() const; + + /// Reverts and changes that have been made that can be snapshot. This effectively + /// reverts the design back to the last snapshot. This is only valid when the + /// HasPendingSnapshot property returns true. + /// Returns true if the revert was successful. + bool revertPendingSnapshot(); + + typedef Snapshot iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SNAPSHOTS_API static const char* classType(); + ADSK_FUSION_SNAPSHOTS_API const char* objectType() const override; + ADSK_FUSION_SNAPSHOTS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SNAPSHOTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Snapshot* add_raw() = 0; + virtual Snapshot* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual bool hasPendingSnapshot_raw() const = 0; + virtual bool revertPendingSnapshot_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr Snapshots::add() +{ + core::Ptr res = add_raw(); + return res; +} + +inline core::Ptr Snapshots::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t Snapshots::count() const +{ + size_t res = count_raw(); + return res; +} + +inline bool Snapshots::hasPendingSnapshot() const +{ + bool res = hasPendingSnapshot_raw(); + return res; +} + +inline bool Snapshots::revertPendingSnapshot() +{ + bool res = revertPendingSnapshot_raw(); + return res; +} + +template inline void Snapshots::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SNAPSHOTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/StringParameterValue.h b/usr/autodesk/CPP/include/Fusion/Fusion/StringParameterValue.h new file mode 100644 index 0000000..ed3fb79 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/StringParameterValue.h @@ -0,0 +1,73 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "ParameterValue.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_STRINGPARAMETERVALUE_CPP__ +# define ADSK_FUSION_STRINGPARAMETERVALUE_API XI_EXPORT +# else +# define ADSK_FUSION_STRINGPARAMETERVALUE_API +# endif +#else +# define ADSK_FUSION_STRINGPARAMETERVALUE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A parameter value that is a string. +class StringParameterValue : public ParameterValue { +public: + + /// Get or set the value of the parameter. + std::string value() const; + bool value(const std::string& value); + + ADSK_FUSION_STRINGPARAMETERVALUE_API static const char* classType(); + ADSK_FUSION_STRINGPARAMETERVALUE_API const char* objectType() const override; + ADSK_FUSION_STRINGPARAMETERVALUE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_STRINGPARAMETERVALUE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* value_raw() const = 0; + virtual bool value_raw(const char * value) = 0; +}; + +// Inline wrappers + +inline std::string StringParameterValue::value() const +{ + std::string res; + + char* p= value_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool StringParameterValue::value(const std::string& value) +{ + return value_raw(value.c_str()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_STRINGPARAMETERVALUE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/Timeline.h b/usr/autodesk/CPP/include/Fusion/Fusion/Timeline.h new file mode 100644 index 0000000..c0c5589 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/Timeline.h @@ -0,0 +1,185 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TIMELINE_CPP__ +# define ADSK_FUSION_TIMELINE_API XI_EXPORT +# else +# define ADSK_FUSION_TIMELINE_API +# endif +#else +# define ADSK_FUSION_TIMELINE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TimelineGroups; + class TimelineObject; +}} + +namespace adsk { namespace fusion { + +/// A collection of TimelineObjects in a parametric design. +class Timeline : public core::Base { +public: + + /// Moves the marker to the beginning of the timeline. + /// Returns true if the move is successful + bool moveToBeginning(); + + /// Moves the marker to the end of the timeline. + /// Returns true if the move is successful + bool moveToEnd(); + + /// Moves the marker to the next step in the timeline. + /// Returns true if the move is successful + bool movetoNextStep(); + + /// Moves the marker to the previous step in the timeline. + /// Returns true if the move is successful + bool moveToPreviousStep(); + + /// Plays the timeline beginning at the current position of the marker. + /// Returns true if playing the timeline was successful + bool play(); + + /// Gets and sets the current position of the marker where + /// 0 is at the beginning of the timeline and the value of Timeline.count is the end of the + /// timeline. + int markerPosition() const; + bool markerPosition(int value); + + /// Function that returns the specified item in the timeline using an index into the collection. + /// The items are returned in the order they appear in the timeline. + /// index : The index of the item within the collection to return. The first item in the collection + /// has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of items in the collection. + size_t count() const; + + /// Returns the collection of groups within the timeline. + core::Ptr timelineGroups() const; + + /// Deletes all objects in the timeline that are after the current position of the marker. + /// Returns true if successful. + bool deleteAllAfterMarker(); + + typedef TimelineObject iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_TIMELINE_API static const char* classType(); + ADSK_FUSION_TIMELINE_API const char* objectType() const override; + ADSK_FUSION_TIMELINE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TIMELINE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool moveToBeginning_raw() = 0; + virtual bool moveToEnd_raw() = 0; + virtual bool movetoNextStep_raw() = 0; + virtual bool moveToPreviousStep_raw() = 0; + virtual bool play_raw() = 0; + virtual int markerPosition_raw() const = 0; + virtual bool markerPosition_raw(int value) = 0; + virtual TimelineObject* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual TimelineGroups* timelineGroups_raw() const = 0; + virtual bool deleteAllAfterMarker_raw() = 0; +}; + +// Inline wrappers + +inline bool Timeline::moveToBeginning() +{ + bool res = moveToBeginning_raw(); + return res; +} + +inline bool Timeline::moveToEnd() +{ + bool res = moveToEnd_raw(); + return res; +} + +inline bool Timeline::movetoNextStep() +{ + bool res = movetoNextStep_raw(); + return res; +} + +inline bool Timeline::moveToPreviousStep() +{ + bool res = moveToPreviousStep_raw(); + return res; +} + +inline bool Timeline::play() +{ + bool res = play_raw(); + return res; +} + +inline int Timeline::markerPosition() const +{ + int res = markerPosition_raw(); + return res; +} + +inline bool Timeline::markerPosition(int value) +{ + return markerPosition_raw(value); +} + +inline core::Ptr Timeline::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t Timeline::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr Timeline::timelineGroups() const +{ + core::Ptr res = timelineGroups_raw(); + return res; +} + +inline bool Timeline::deleteAllAfterMarker() +{ + bool res = deleteAllAfterMarker_raw(); + return res; +} + +template inline void Timeline::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TIMELINE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/TimelineGroup.h b/usr/autodesk/CPP/include/Fusion/Fusion/TimelineGroup.h new file mode 100644 index 0000000..438d840 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/TimelineGroup.h @@ -0,0 +1,117 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "TimelineObject.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TIMELINEGROUP_CPP__ +# define ADSK_FUSION_TIMELINEGROUP_API XI_EXPORT +# else +# define ADSK_FUSION_TIMELINEGROUP_API +# endif +#else +# define ADSK_FUSION_TIMELINEGROUP_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TimelineObject; +}} + +namespace adsk { namespace fusion { + +/// Represents a group in the timeline. +class TimelineGroup : public TimelineObject { +public: + + /// Deletes the group with the option of deleting or keeping the contents. + /// deleteGroupAndContents : Indicates if the group and its contents should be deleted or if only the group + /// should be deleted and the contents kept and expanded. A value of true will delete + /// the group and its contents. + /// Returns true if the delete was successful. + bool deleteMe(bool deleteGroupAndContents); + + /// Indicates if the group is collapsed or expanded. + bool isCollapsed() const; + bool isCollapsed(bool value); + + /// Function that returns the specified timeline object within the group using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of items in the group. + size_t count() const; + + typedef TimelineObject iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_TIMELINEGROUP_API static const char* classType(); + ADSK_FUSION_TIMELINEGROUP_API const char* objectType() const override; + ADSK_FUSION_TIMELINEGROUP_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TIMELINEGROUP_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool deleteMe_raw(bool deleteGroupAndContents) = 0; + virtual bool isCollapsed_raw() const = 0; + virtual bool isCollapsed_raw(bool value) = 0; + virtual TimelineObject* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline bool TimelineGroup::deleteMe(bool deleteGroupAndContents) +{ + bool res = deleteMe_raw(deleteGroupAndContents); + return res; +} + +inline bool TimelineGroup::isCollapsed() const +{ + bool res = isCollapsed_raw(); + return res; +} + +inline bool TimelineGroup::isCollapsed(bool value) +{ + return isCollapsed_raw(value); +} + +inline core::Ptr TimelineGroup::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t TimelineGroup::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void TimelineGroup::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TIMELINEGROUP_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/TimelineGroups.h b/usr/autodesk/CPP/include/Fusion/Fusion/TimelineGroups.h new file mode 100644 index 0000000..f4e9e45 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/TimelineGroups.h @@ -0,0 +1,103 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TIMELINEGROUPS_CPP__ +# define ADSK_FUSION_TIMELINEGROUPS_API XI_EXPORT +# else +# define ADSK_FUSION_TIMELINEGROUPS_API +# endif +#else +# define ADSK_FUSION_TIMELINEGROUPS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TimelineGroup; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the time line groups within a design and provides +/// methods to create new groups. +class TimelineGroups : public core::Base { +public: + + /// Creates a new group within the timeline. The sequential set of items defined + /// by the start and end indices will be included in the group. A group cannot contains + /// another group so none of the items being grouped can be a group of this will fail. + /// startIndex : The index of the first item in the timeline that will be added to the group. + /// endIndex : The index of the last item in the timeline that will be added to the group. + /// Returns the created TimelineGroup object or null in the case of failure. + core::Ptr add(int startIndex, int endIndex); + + /// Function that returns the specified timeline group using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of items in the collection. + size_t count() const; + + typedef TimelineGroup iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_TIMELINEGROUPS_API static const char* classType(); + ADSK_FUSION_TIMELINEGROUPS_API const char* objectType() const override; + ADSK_FUSION_TIMELINEGROUPS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TIMELINEGROUPS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual TimelineGroup* add_raw(int startIndex, int endIndex) = 0; + virtual TimelineGroup* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr TimelineGroups::add(int startIndex, int endIndex) +{ + core::Ptr res = add_raw(startIndex, endIndex); + return res; +} + +inline core::Ptr TimelineGroups::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t TimelineGroups::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void TimelineGroups::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TIMELINEGROUPS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/TimelineObject.h b/usr/autodesk/CPP/include/Fusion/Fusion/TimelineObject.h new file mode 100644 index 0000000..daa7273 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/TimelineObject.h @@ -0,0 +1,284 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TIMELINEOBJECT_CPP__ +# define ADSK_FUSION_TIMELINEOBJECT_API XI_EXPORT +# else +# define ADSK_FUSION_TIMELINEOBJECT_API +# endif +#else +# define ADSK_FUSION_TIMELINEOBJECT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TimelineGroup; +}} + +namespace adsk { namespace fusion { + +/// Represents an object in the timeline. +class TimelineObject : public core::Base { +public: + + /// Gets and sets if this object is suppressed. + bool isSuppressed() const; + bool isSuppressed(bool value); + + /// Returns the parent group, if this object is part of a group. + /// Returns null if this object is not part of a group. + core::Ptr parentGroup() const; + + /// Returns the position of this item within the timeline where + /// the first item has an index of 0. + /// This property can return -1 in the two cases where this object + /// is not currently represented in the timeline. The two cases are: + /// 1. When this is a TimelineGroup object and the group is expanded. + /// 2. When this object is part of a group and the group is collapsed. + int index() const; + + /// Indicates if this item is currently not being computed + /// because it has been rolled back. + /// If this is a timelineGroup object and the group is expanded + /// the value of this property should be ignored. + bool isRolledBack() const; + + /// Rolls the timeline by repositioning the marker to either before or after this object. + /// This method will fail if this is a timelineGroup object and the group is expanded. + /// rollBefore : Set rollBefore to true to reposition the marker before this object or to false to + /// reposition the marker after this object + /// Returns true if the move was successful + bool rollTo(bool rollBefore); + + /// Returns the entity associated with this timeline object. + /// Edit operations can be performed by getting the object + /// representing the associated entity and using the methods + /// and properties on that entity to make changes. + /// Returns null if this is a TimelineGroup object + core::Ptr entity() const; + + /// Checks to see if this object can be reordered to the specified position. + /// The default value of -1 indicates the end of the timeline. + /// This method will fail if this is a timelineGroup object and the group is expanded. + /// beforeIndex : The index number of the position in the timeline to check + /// Returns true if the object can be reordered to the specified position + bool canReorder(int beforeIndex = -1); + + /// Reorders this object to the position specified. + /// The default value of -1 indicates the end of the timeline. + /// beforeIndex : The index number of the position in the timeline to place this object before + /// Returns true if the reorder operation was successful + /// This method will fail and return false if this is a timelineGroup object and the + /// group is expanded. + bool reorder(int beforeIndex = -1); + + /// Indicates if this TimelineObject represents a group. If True you can + /// operate on this object as a TimelineGroup object. + bool isGroup() const; + + /// Gets and sets the name of this timeline object. This name is shared by the object + /// the timeline object represents. For example, if the TimelineObject represents a Sketch + /// and you change the name using the TimelineObject, the name of the sketch in the browser + /// is also changed. The reverse is also true. Setting the name of an object; sketch, feature + /// construction geometry, etc, will also change the name of the associated node in the timeline. + std::string name() const; + bool name(const std::string& value); + + /// Returns the current health state of the object associated with this TimelineObject. + FeatureHealthStates healthState() const; + + /// Returns the error or warning message in the case where the healthState property returns either + /// WarningFeatureHealthState or ErrorFeatureHealthState. Otherwise this property returns an empty string. + std::string errorOrWarningMessage() const; + + ADSK_FUSION_TIMELINEOBJECT_API static const char* classType(); + ADSK_FUSION_TIMELINEOBJECT_API const char* objectType() const override; + ADSK_FUSION_TIMELINEOBJECT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TIMELINEOBJECT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isSuppressed_raw() const = 0; + virtual bool isSuppressed_raw(bool value) = 0; + virtual TimelineGroup* parentGroup_raw() const = 0; + virtual int index_raw() const = 0; + virtual bool isRolledBack_raw() const = 0; + virtual bool rollTo_raw(bool rollBefore) = 0; + virtual core::Base* entity_raw() const = 0; + virtual bool canReorder_raw(int beforeIndex) = 0; + virtual bool reorder_raw(int beforeIndex) = 0; + virtual bool isGroup_raw() const = 0; + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual FeatureHealthStates healthState_raw() const = 0; + virtual char* errorOrWarningMessage_raw() const = 0; + virtual void placeholderTimelineObject0() {} + virtual void placeholderTimelineObject1() {} + virtual void placeholderTimelineObject2() {} + virtual void placeholderTimelineObject3() {} + virtual void placeholderTimelineObject4() {} + virtual void placeholderTimelineObject5() {} + virtual void placeholderTimelineObject6() {} + virtual void placeholderTimelineObject7() {} + virtual void placeholderTimelineObject8() {} + virtual void placeholderTimelineObject9() {} + virtual void placeholderTimelineObject10() {} + virtual void placeholderTimelineObject11() {} + virtual void placeholderTimelineObject12() {} + virtual void placeholderTimelineObject13() {} + virtual void placeholderTimelineObject14() {} + virtual void placeholderTimelineObject15() {} + virtual void placeholderTimelineObject16() {} + virtual void placeholderTimelineObject17() {} + virtual void placeholderTimelineObject18() {} + virtual void placeholderTimelineObject19() {} + virtual void placeholderTimelineObject20() {} + virtual void placeholderTimelineObject21() {} + virtual void placeholderTimelineObject22() {} + virtual void placeholderTimelineObject23() {} + virtual void placeholderTimelineObject24() {} + virtual void placeholderTimelineObject25() {} + virtual void placeholderTimelineObject26() {} + virtual void placeholderTimelineObject27() {} + virtual void placeholderTimelineObject28() {} + virtual void placeholderTimelineObject29() {} + virtual void placeholderTimelineObject30() {} + virtual void placeholderTimelineObject31() {} + virtual void placeholderTimelineObject32() {} + virtual void placeholderTimelineObject33() {} + virtual void placeholderTimelineObject34() {} + virtual void placeholderTimelineObject35() {} + virtual void placeholderTimelineObject36() {} + virtual void placeholderTimelineObject37() {} + virtual void placeholderTimelineObject38() {} + virtual void placeholderTimelineObject39() {} + virtual void placeholderTimelineObject40() {} + virtual void placeholderTimelineObject41() {} + virtual void placeholderTimelineObject42() {} + virtual void placeholderTimelineObject43() {} + virtual void placeholderTimelineObject44() {} + virtual void placeholderTimelineObject45() {} + virtual void placeholderTimelineObject46() {} + virtual void placeholderTimelineObject47() {} + virtual void placeholderTimelineObject48() {} + virtual void placeholderTimelineObject49() {} +}; + +// Inline wrappers + +inline bool TimelineObject::isSuppressed() const +{ + bool res = isSuppressed_raw(); + return res; +} + +inline bool TimelineObject::isSuppressed(bool value) +{ + return isSuppressed_raw(value); +} + +inline core::Ptr TimelineObject::parentGroup() const +{ + core::Ptr res = parentGroup_raw(); + return res; +} + +inline int TimelineObject::index() const +{ + int res = index_raw(); + return res; +} + +inline bool TimelineObject::isRolledBack() const +{ + bool res = isRolledBack_raw(); + return res; +} + +inline bool TimelineObject::rollTo(bool rollBefore) +{ + bool res = rollTo_raw(rollBefore); + return res; +} + +inline core::Ptr TimelineObject::entity() const +{ + core::Ptr res = entity_raw(); + return res; +} + +inline bool TimelineObject::canReorder(int beforeIndex) +{ + bool res = canReorder_raw(beforeIndex); + return res; +} + +inline bool TimelineObject::reorder(int beforeIndex) +{ + bool res = reorder_raw(beforeIndex); + return res; +} + +inline bool TimelineObject::isGroup() const +{ + bool res = isGroup_raw(); + return res; +} + +inline std::string TimelineObject::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool TimelineObject::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline FeatureHealthStates TimelineObject::healthState() const +{ + FeatureHealthStates res = healthState_raw(); + return res; +} + +inline std::string TimelineObject::errorOrWarningMessage() const +{ + std::string res; + + char* p= errorOrWarningMessage_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TIMELINEOBJECT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/UserParameter.h b/usr/autodesk/CPP/include/Fusion/Fusion/UserParameter.h new file mode 100644 index 0000000..5129736 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/UserParameter.h @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "Parameter.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_USERPARAMETER_CPP__ +# define ADSK_FUSION_USERPARAMETER_API XI_EXPORT +# else +# define ADSK_FUSION_USERPARAMETER_API +# endif +#else +# define ADSK_FUSION_USERPARAMETER_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Design; + class UserParameters; +}} + +namespace adsk { namespace fusion { + +/// Represents a User Parameter. +class UserParameter : public Parameter { +public: + + /// Deletes the user parameter + /// A parameter can only be deleted if it is a UserParameter and + /// it is not referenced by other parameters. + /// Returns a bool indicating if the delete was successful or not. + /// Bug!!! Currently returning true if the parameter can't be deleted because it is + /// being referenced by other parameters. + bool deleteMe(); + + /// Returns the Collection containing the UserParameter. + core::Ptr userParameters() const; + + /// Returns the Design containing the UserParameter. + core::Ptr design() const; + + ADSK_FUSION_USERPARAMETER_API static const char* classType(); + ADSK_FUSION_USERPARAMETER_API const char* objectType() const override; + ADSK_FUSION_USERPARAMETER_API void* queryInterface(const char* id) const override; + ADSK_FUSION_USERPARAMETER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool deleteMe_raw() = 0; + virtual UserParameters* userParameters_raw() const = 0; + virtual Design* design_raw() const = 0; +}; + +// Inline wrappers + +inline bool UserParameter::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline core::Ptr UserParameter::userParameters() const +{ + core::Ptr res = userParameters_raw(); + return res; +} + +inline core::Ptr UserParameter::design() const +{ + core::Ptr res = design_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_USERPARAMETER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Fusion/UserParameters.h b/usr/autodesk/CPP/include/Fusion/Fusion/UserParameters.h new file mode 100644 index 0000000..8863bbc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Fusion/UserParameters.h @@ -0,0 +1,148 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_USERPARAMETERS_CPP__ +# define ADSK_FUSION_USERPARAMETERS_API XI_EXPORT +# else +# define ADSK_FUSION_USERPARAMETERS_API +# endif +#else +# define ADSK_FUSION_USERPARAMETERS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Design; + class UserParameter; +}} +namespace adsk { namespace core { + class ValueInput; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the User Parameters within a design and provides +/// methods to create new user parameters. +class UserParameters : public core::Base { +public: + + /// Function that returns the specified User Parameter using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection + /// has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Function that returns the specified User Parameter using the name of the parameter + /// as it is displayed in the parameters dialog. + /// name : The name of the User Parameter as it is displayed in the parameters dialog + /// Returns the specified item or null if an invalid name was specified. + core::Ptr itemByName(const std::string& name) const; + + /// Returns the number of parameters in the collection. + size_t count() const; + + /// Returns the design that owns the user parameters collection. + core::Ptr design() const; + + /// Adds a new user parameter to the collection. + /// name : The name of the parameter. This is the name shown in the parameters dialog + /// value : ValueInput object that specifies the value of the parameter. If the ValueInput was created using a real, + /// the value will be interpreted using the internal unit for the unit type specified by the "units" argument. + /// For example, if the ValueInput was created using the real value 5 and the input to the "units" argument is + /// any valid length unit, the value will be interpreted as 5 centimeters since centimeters is the internal unit + /// for lengths. If the "units" argument is a valid angle unit the value will be interpreted as 5 radians. + /// If the ValueInput was created using a string, the string is used as-is for the expression of the parameter. + /// This means if there are units as part of the string it must evaluate to the same unit type as that specified + /// by the "units" argument and if no units are specified it will use the current default units specified for + /// the current document. For example, if the ValueInput was created with the string "5 in", then the "units" + /// argument must define any valid length so they are compatible. If the ValueInput was created with the string "5", + /// any unit type can be used and the result will be 5 of that unit. + /// When using a ValueInput created using a string, it's the same as creating a parameter in the user-interface. + /// You can specify any valid expression, i.e. "5", "5 in", "5 in / 2", "5 + Length", etc. and you can choose + /// from many different types of units. The only requirement is that the units must match in type. For example, + /// they must both be lengths, or they must both be angles. + /// units : The units to use for the value of the parameter. + /// Units specified must match the units specified (if any) in the ValueInput object. + /// To create a parameter with no units you can specify either an empty string. + /// comment : The comment to display in the parameters dialog. Specify an empty string ("") for no comment + /// Returns the newly created UserParameter or null if the creation failed. + core::Ptr add(const std::string& name, const core::Ptr& value, const std::string& units, const std::string& comment); + + typedef UserParameter iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_USERPARAMETERS_API static const char* classType(); + ADSK_FUSION_USERPARAMETERS_API const char* objectType() const override; + ADSK_FUSION_USERPARAMETERS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_USERPARAMETERS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual UserParameter* item_raw(size_t index) const = 0; + virtual UserParameter* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual Design* design_raw() const = 0; + virtual UserParameter* add_raw(const char * name, core::ValueInput* value, const char * units, const char * comment) = 0; +}; + +// Inline wrappers + +inline core::Ptr UserParameters::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr UserParameters::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t UserParameters::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr UserParameters::design() const +{ + core::Ptr res = design_raw(); + return res; +} + +inline core::Ptr UserParameters::add(const std::string& name, const core::Ptr& value, const std::string& units, const std::string& comment) +{ + core::Ptr res = add_raw(name.c_str(), value.get(), units.c_str(), comment.c_str()); + return res; +} + +template inline void UserParameters::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_USERPARAMETERS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/FusionAll.h b/usr/autodesk/CPP/include/Fusion/FusionAll.h new file mode 100644 index 0000000..48cdb82 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/FusionAll.h @@ -0,0 +1,446 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/usr/autodesk/CPP/include/Fusion/FusionTypeDefs.h b/usr/autodesk/CPP/include/Fusion/FusionTypeDefs.h new file mode 100644 index 0000000..c5df169 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/FusionTypeDefs.h @@ -0,0 +1,508 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once + +namespace adsk { namespace fusion { + +/// Types that define the nature of the relationship between a point and a containing entity. +enum PointContainment +{ + PointInsidePointContainment, + PointOnPointContainment, + PointOutsidePointContainment, + UnknownPointContainment +}; + +/// Defines the various options when converting the geometry of a B-Rep body or face +/// to NURBS. This is used by the convert method of the BRepBody and BRepFace objects. +enum BRepConvertOptions +{ + ProceduralToNURBSConversion, + AnalyticsToNURBSConversion, + PlanesToNURBSConversion, + SplitPeriodicFacesConversion = 4 +}; + +/// The different accuracy settings for calculating area and physical property related values. +/// The higher the accuracy setting, the longer it will take to perform the calculations. +enum CalculationAccuracy +{ + LowCalculationAccuracy, + MediumCalculationAccuracy, + HighCalculationAccuracy, + VeryHighCalculationAccuracy +}; + +/// Specifies the different types of corners that can be created when offsetting a wire body. +enum OffsetCornerTypes +{ + CircularOffsetCornerType, + LinearOffsetCornerType, + ExtendedOffsetCornerType +}; + +/// Defines the different type of boolean operations that are supported. +enum BooleanTypes +{ + DifferenceBooleanType, + IntersectionBooleanType, + UnionBooleanType +}; + +/// Used by the findBRepUsingRay and findBRepUsingPoint methods to specify the desired return type. +enum BRepEntityTypes +{ + BRepBodyEntityType, + BRepFaceEntityType, + BRepEdgeEntityType, + BRepVertexEntityType +}; + +/// Specifies the different types of directions that can be used to define directions of a joint. +enum JointDirections +{ + XAxisJointDirection, + YAxisJointDirection, + ZAxisJointDirection, + CustomJointDirection +}; + +/// The various states that a feature can be in. This is used for the +/// states of modeling features, construction geometry, and sketches. +enum FeatureHealthStates +{ + HealthyFeatureHealthState, + WarningFeatureHealthState, + ErrorFeatureHealthState, + SuppressedFeatureHealthState, + RolledBackFeatureHealthState, + UnknownFeatureHealthState +}; + +/// List of the various keypoints of geometry that can be used when defining joint geometry. +enum JointKeyPointTypes +{ + StartKeyPoint, + MiddleKeyPoint, + EndKeyPoint, + CenterKeyPoint +}; + +/// List of the different types of ways that geometry for a joint can be defined. +enum JointGeometryTypes +{ + JointConstructionPointGeometry, + JointSketchPointGeometry, + JointBRepVertexGeometry, + JointBRepEdgeGeometry, + JointSketchCurveGeometry, + JointProfileGeometry, + JointPlanarBRepFaceGeometry, + JointNonPlanarBRepFaceGeometry, + JointBetweenTwoPlanesGeometry +}; + +/// List of the various types of joints. +enum JointTypes +{ + RigidJointType, + RevoluteJointType, + SliderJointType, + CylindricalJointType, + PinSlotJointType, + PlanarJointType, + BallJointType +}; + +/// List of the valid extent directions. +enum ExtentDirections +{ + PositiveExtentDirection, + NegativeExtentDirection, + SymmetricExtentDirection +}; + +/// List of the different operations a feature can perform. +enum FeatureOperations +{ + JoinFeatureOperation, + CutFeatureOperation, + IntersectFeatureOperation, + NewBodyFeatureOperation, + NewComponentFeatureOperation +}; + +/// Specifies the different types of entities that can be patterned. +enum PatternEntityTypes +{ + FacesPatternType, + FeaturesPatternType, + BodiesPatternType, + OccurrencesPatternType +}; + +/// Used to indicate which type of extent is used for a feature. +enum FeatureExtentTypes +{ + OneSideFeatureExtentType, + TwoSidesFeatureExtentType, + SymmetricFeatureExtentType +}; + +/// List of Thin Extrude Wall Locations +enum ThinExtrudeWallLocation +{ + Side1, + Center, + Side2 +}; + +/// List of the different types of holes. +enum HoleTypes +{ + SimpleHoleType, + CounterboreHoleType, + CountersinkHoleType +}; + +/// List of the valid edge positions for holes. +enum HoleEdgePositions +{ + EdgeStartPointPosition, + EdgeMidPointPosition, + EdgeEndPointPosition +}; + +/// Specifies the type of corner to model when multiple edges come together at a vertex. +enum ChamferCornerTypes +{ + ChamferCornerType, + MiterCornerType, + BlendCornertype +}; + +/// List of the different ways a chamfer can be defined. +enum ChamferTypes +{ + EqualDistanceChamferType, + TwoDistancesChamferType, + DistanceAndAngleChamferType +}; + +/// Controls options used when creating a Path and determining the rules for how curves are +/// considered to be chained or connected. +enum ChainedCurveOptions +{ + noChainedCurves, + connectedChainedCurves, + tangentChainedCurves, + openEdgesChainedCurves, + tangentAndOpenEdgesChainedCurves +}; + +/// List of the types of sweep orientation. +enum SweepOrientationTypes +{ + ParallelOrientationType, + PerpendicularOrientationType +}; + +/// List of the sweep profile scaling options. +enum SweepProfileScalingOptions +{ + SweepProfileScaleOption, + SweepProfileStretchOption, + SweepProfileNoScalingOption +}; + +/// List of the types of sweep extent. +enum SweepExtentTypes +{ + PerpendicularToPathExtentType, + FullExtentsExtentType +}; + +/// List of the compute options for mirroring and patterning features in the parametric modeling environment. +enum PatternComputeOptions +{ + OptimizedPatternCompute, + IdenticalPatternCompute, + AdjustPatternCompute +}; + +/// Defines the different ways to specify the spacing between elements in a pattern. +enum PatternDistanceType +{ + ExtentPatternDistanceType, + SpacingPatternDistanceType +}; + +/// List of the types of thread location. +enum ThreadLocations +{ + HighEndThreadLocation, + LowEndThreadLocation +}; + +/// List of the ways to split a face using the split face feature. +enum SplitFaceSplitTypes +{ + surfaceIntersectionSplitType, + alongVectorSplitType, + closestPointSplitType +}; + +/// List of Silhouette Split feature operations. +enum SilhouetteSplitOperations +{ + SilhouetteSplitFacesOnlyOperation, + SilhouetteSplitShelledBodyOperation, + SilhouetteSplitSolidBodyOperation +}; + +/// List of the coil types. +enum CoilFeatureTypes +{ + RevolutionsAndHeightCoilFeatureType, + RevolutionsAndPitchCoilFeatureType, + HeightAndPitchCoilFeatureType, + SpiralCoilFeatureType +}; + +/// List of the section types of coil primitive feature. +enum CoilFeatureSectionTypes +{ + CircularCoilFeatureSectionType, + SquareCoilFeatureSectionType, + TriangularExternalCoilFeatureSectionType, + TriangularInternalCoilFeatureSectionType +}; + +/// List of the section positions of coil feature. +enum CoilFeatureSectionPositions +{ + InsideCoilFeatureSectionPosition, + OnCenterCoilFeatureSectionPosition, + OutsideCoilFeatureSectionPosition +}; + +/// List of Surface Continuity Types. +enum SurfaceContinuityTypes +{ + ConnectedSurfaceContinuityType, + TangentSurfaceContinuityType, + CurvatureSurfaceContinuityType +}; + +/// List of Surface Extend Types. +enum SurfaceExtendTypes +{ + NaturalSurfaceExtendType, + TangentSurfaceExtendType, + PerpendicularSurfaceExtendType +}; + +/// List of Surface Extend Alignments +enum SurfaceExtendAlignment +{ + FreeEdges, + AlignEdges +}; + +/// List of Ruled Surface Types. +enum RuledSurfaceTypes +{ + TangentRuledSurfaceType, + NormalRuledSurfaceType, + DirectionRuledSurfaceType +}; + +/// List of Ruled Surface corner types. +enum RuledSurfaceCornerTypes +{ + RoundedRuledSurfaceCornerType, + MiteredRuledSurfaceCornerType +}; + +/// List of Untrim Loop Types. +enum UntrimLoopTypes +{ + AllLoopsUntrimType, + ExternalLoopsUntrimType, + InternalLoopsUntrimType, + ManualLoopsUntrimType +}; + +/// Valid unit types for distance +enum DistanceUnits +{ + MillimeterDistanceUnits, + CentimeterDistanceUnits, + MeterDistanceUnits, + InchDistanceUnits, + FootDistanceUnits +}; + +/// The valid options for the Design History (default design type) setting. +enum DefaultDesignTypeOptions +{ + PromptForDesignTypeOption, + DirectDesignTypeOption, + ParametricDesignTypeOption +}; + +/// The valid options for the Default workspaces setting. +enum DefaultWorkspaces +{ + ModelWorkspace, + SculptWorkspace, + PatchWorkspace +}; + +/// Fusion 360 design types +enum DesignTypes +{ + DirectDesignType, + ParametricDesignType +}; + +/// The expression of the parameter. Setting this can fail because of an invalid expression or +/// because a cyclic reference is created between parameters. +enum ExpressionError +{ + CyclicParameterReferenceError = 200 +}; + +/// Specific error types for DeleteMe methods. +enum DeleteMeError +{ + ParameterReferencedByOtherParameterError = 200 +}; + +/// The different refinement settings supported when exporting the design as an STL or 3mf file. +enum MeshRefinementSettings +{ + MeshRefinementHigh, + MeshRefinementMedium, + MeshRefinementLow, + MeshRefinementCustom +}; + +/// The various culling modes supported by custom graphics. +enum CustomGraphicsCullModes +{ + CustomGraphicsCullFront, + CustomGraphicsCullBack, + CustomGraphicsCullNone +}; + +/// Specifies the different styles that can be used to control billboarding. +enum CustomGraphicsBillBoardStyles +{ + ScreenBillBoardStyle = 1, + AxialBillBoardStyle, + RightReadingBillBoardStyle +}; + +/// Specifies which of the four view corners custom graphics will be drawn in relation to. The +/// notUsedViewCorner setting indicates the graphics are not positioned with respect to the view. +enum ViewCorners +{ + upperLeftViewCorner, + upperRightViewCorner, + lowerLeftViewCorner, + lowerRightViewCorner +}; + +/// A list of predefined point images that you can use for a CustomGraphicsPointSet. +enum CustomGraphicsPointTypes +{ + UserDefinedCustomGraphicsPointType, + PointCloudCustomGraphicsPointType +}; + +/// Specifies the line styles that can be applied to custom graphics lines and curves. +enum LineStylePatterns +{ + continuousLineStylePattern, + centerLineStylePattern, + dashedLineStylePattern, + dotLineStylePattern, + hiddenLineStylePattern, + phantomLineStylePattern, + tracksLineStylePattern, + zigzagLineStylePattern +}; + +/// The unit types that can be specified when importing a .stl or .obj file as a mesh. +enum MeshUnits +{ + CentimeterMeshUnit, + MillimeterMeshUnit, + MeterMeshUnit, + InchMeshUnit, + FootMeshUnit +}; + +/// Types that indicate the level of quality of a triangle mesh. +enum TriangleMeshQualityOptions +{ + LowQualityTriangleMesh = 8, + NormalQualityTriangleMesh = 11, + HighQualityTriangleMesh = 13, + VeryHighQualityTriangleMesh = 15 +}; + +/// Used by the Sketch.projectToSurface method when defined how to project a curve onto a surface. +enum SurfaceProjectTypes +{ + ClosestPointSurfaceProjectType, + AlongVectorSurfaceProjectType +}; + +/// Defines the various text style formatting options that can be applied to text. These are +/// bitwise values to they can be combined. +enum TextStyles +{ + TextStyleBold = 1, + TextStyleItalic, + TextStyleUnderline = 4 +}; + +/// Defines the nine key points that exist for a sketch text box and +/// can be used as the origin when rotating the text. The named positions +/// are with respect to the text box. For example when the text box has +/// not been rotated the top-left key point will be the point in the upper-left +/// corner of the text box. If the text box has been rotated 180 degrees, +/// the top-left key point will be the point in the lower-right corner of +/// the text box. +enum TextBoxKeyPoints +{ + TopLeftTextBoxKeyPoint, + TopMiddleTextBoxKeyPoint, + TopRightTextBoxKeyPoint, + MiddleLeftTextBoxKeyPoint, + MiddleTextBoxKeyPoint, + MiddleRightTextBoxKeyPoint, + BottomLeftTextBoxKeyPoint, + BottomMiddleTextBoxKeyPoint, + BottomRightTextBoxKeyPoint +}; + +/// The different dimension orientations. +enum DimensionOrientations +{ + AlignedDimensionOrientation, + HorizontalDimensionOrientation, + VerticalDimensionOrientation +}; +}// namespace fusion +}// namespace adsk diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsAppearanceColorEffect.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsAppearanceColorEffect.h new file mode 100644 index 0000000..05d0a61 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsAppearanceColorEffect.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "CustomGraphicsColorEffect.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSAPPEARANCECOLOREFFECT_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSAPPEARANCECOLOREFFECT_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSAPPEARANCECOLOREFFECT_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSAPPEARANCECOLOREFFECT_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Appearance; +}} + +namespace adsk { namespace fusion { + +/// One of the types of color effects that can be applied to a custom graphics entity. With this +/// type of effect, the graphics entity will display using a Fusion appearance. +class CustomGraphicsAppearanceColorEffect : public CustomGraphicsColorEffect { +public: + + /// Statically creates a new CustomGraphicsAppearanceColorEffect object. This can be used when + /// setting the color property of the various custom graphics objects. With this coloring + /// effect, an existing appearance is used. The appearance must be avaialable in the + /// design where the graphics will be drawn. + /// appearance : The appearance to use. The appearance must be avaialable in the design where the + /// graphics will be drawn. + /// Returns the created CustomGraphicsAppearanceColorEffect or null in case of a failure. + static core::Ptr create(const core::Ptr& appearance); + + /// Gets and sets the appearance to use. The appearance assigned must be available in the + /// design where the graphics will be drawn. + core::Ptr appearance() const; + bool appearance(const core::Ptr& value); + + ADSK_FUSION_CUSTOMGRAPHICSAPPEARANCECOLOREFFECT_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSAPPEARANCECOLOREFFECT_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSAPPEARANCECOLOREFFECT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSAPPEARANCECOLOREFFECT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_CUSTOMGRAPHICSAPPEARANCECOLOREFFECT_API static CustomGraphicsAppearanceColorEffect* create_raw(core::Appearance* appearance); + virtual core::Appearance* appearance_raw() const = 0; + virtual bool appearance_raw(core::Appearance* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsAppearanceColorEffect::create(const core::Ptr& appearance) +{ + core::Ptr res = create_raw(appearance.get()); + return res; +} + +inline core::Ptr CustomGraphicsAppearanceColorEffect::appearance() const +{ + core::Ptr res = appearance_raw(); + return res; +} + +inline bool CustomGraphicsAppearanceColorEffect::appearance(const core::Ptr& value) +{ + return appearance_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSAPPEARANCECOLOREFFECT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepBody.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepBody.h new file mode 100644 index 0000000..8c46bfc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepBody.h @@ -0,0 +1,95 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "CustomGraphicsEntity.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSBREPBODY_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSBREPBODY_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSBREPBODY_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSBREPBODY_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class CustomGraphicsBRepEdges; + class CustomGraphicsBRepFaces; + class CustomGraphicsBRepVertices; +}} + +namespace adsk { namespace fusion { + +/// This represents custom graphics that are based on a BRepBody. +class CustomGraphicsBRepBody : public CustomGraphicsEntity { +public: + + /// Returns the collection of CustomGraphicsBRepFace objects in the CustomGraphicsBRepBody. + core::Ptr faces() const; + + /// Returns the collection of CustomGraphicsBRepEdge objects in the CustomGraphicsBRepBody. + core::Ptr edges() const; + + /// Returns the collection of CustomGraphicsBRepVertex objects in the CustomGraphicsBRepBody. + core::Ptr vertices() const; + + /// Returns a transient BRepBody that is being displayed as custom graphics. + core::Ptr bRepBody() const; + + ADSK_FUSION_CUSTOMGRAPHICSBREPBODY_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSBREPBODY_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSBREPBODY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSBREPBODY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomGraphicsBRepFaces* faces_raw() const = 0; + virtual CustomGraphicsBRepEdges* edges_raw() const = 0; + virtual CustomGraphicsBRepVertices* vertices_raw() const = 0; + virtual BRepBody* bRepBody_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsBRepBody::faces() const +{ + core::Ptr res = faces_raw(); + return res; +} + +inline core::Ptr CustomGraphicsBRepBody::edges() const +{ + core::Ptr res = edges_raw(); + return res; +} + +inline core::Ptr CustomGraphicsBRepBody::vertices() const +{ + core::Ptr res = vertices_raw(); + return res; +} + +inline core::Ptr CustomGraphicsBRepBody::bRepBody() const +{ + core::Ptr res = bRepBody_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSBREPBODY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepEdges.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepEdges.h new file mode 100644 index 0000000..e4462ab --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepEdges.h @@ -0,0 +1,49 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSBREPEDGES_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSBREPEDGES_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSBREPEDGES_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSBREPEDGES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A collection of CustomGraphicsBRepEdge objects associated with a specific CustomGraphics body object. +class CustomGraphicsBRepEdges : public core::Base { +public: + + ADSK_FUSION_CUSTOMGRAPHICSBREPEDGES_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSBREPEDGES_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSBREPEDGES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSBREPEDGES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSBREPEDGES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepFaces.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepFaces.h new file mode 100644 index 0000000..14d496b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepFaces.h @@ -0,0 +1,49 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSBREPFACES_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSBREPFACES_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSBREPFACES_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSBREPFACES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A collection of CustomGraphicsBRepFace objects associated with a specific CustomGraphicsBRepBody object. +class CustomGraphicsBRepFaces : public core::Base { +public: + + ADSK_FUSION_CUSTOMGRAPHICSBREPFACES_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSBREPFACES_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSBREPFACES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSBREPFACES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSBREPFACES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepVertices.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepVertices.h new file mode 100644 index 0000000..62b3b8c --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBRepVertices.h @@ -0,0 +1,49 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSBREPVERTICES_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSBREPVERTICES_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSBREPVERTICES_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSBREPVERTICES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A collection of CustomGraphicsBRepVertex objects associated with a specific CustomGraphics body object. +class CustomGraphicsBRepVertices : public core::Base { +public: + + ADSK_FUSION_CUSTOMGRAPHICSBREPVERTICES_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSBREPVERTICES_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSBREPVERTICES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSBREPVERTICES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSBREPVERTICES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBasicMaterialColorEffect.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBasicMaterialColorEffect.h new file mode 100644 index 0000000..e0ce099 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBasicMaterialColorEffect.h @@ -0,0 +1,194 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "CustomGraphicsColorEffect.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSBASICMATERIALCOLOREFFECT_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSBASICMATERIALCOLOREFFECT_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSBASICMATERIALCOLOREFFECT_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSBASICMATERIALCOLOREFFECT_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Color; +}} + +namespace adsk { namespace fusion { + +/// One of the types of color effects that can be applied to a custom graphics entity. With this type +/// of effect, basic phong shading and lighting techniques are used so give the entity a 3-dimensional +/// appearance. +class CustomGraphicsBasicMaterialColorEffect : public CustomGraphicsColorEffect { +public: + + /// Statically creates a new basic CustomGraphicsBasicMaterialColorEffect object. This can be used to + /// color custom graphics entities. With this type of effect you define the basic phong shading + /// properties so that the entity can be rendered with basic shading and lighting effects applied + /// so that it appears 3-dimensional. + /// If only the emmissive coloris provided, the API will automatically create values for the + /// other colors to render the object as a single color. + /// diffuseColor : The diffuse color is the color of reflected light as it scatters off of a rough surface and is + /// the primary color of the entity. This color is always required. + /// ambientColor : The ambient color is the color of the light anywhere there's not a specific light source. If + /// not specified the same color as the diffuse color is used. + /// specularColor : The specular color is the color of reflected light (highlights) as it is reflected off of a shiny surface. This is + /// commonly white or a lighter shade of the diffuse color. If not specified, white is used. + /// emissiveColor : The emissive color is the color of light that entity emits, such as in a light bulb. If not specified, + /// black for no emissive light is used. + /// glossiness : This specifies how glossy the entity is. The glossiness determines the size of highlights, and thus + /// the apparent shininess of the material. A value of 0.0 will result in very large hightlights like you + /// would see with a rough surface. A maximum valaue of 128.0 will result in very small highlight as + /// from a smooth surface. + /// opacity : Specifies the opacity of the entity where a value of 1.0 is completely opaque and 0.0 is completely transparent. + /// Returns the created CustomGraphicsBasicMaterialColorEffect or null in case of a failure. + static core::Ptr create(const core::Ptr& diffuseColor, const core::Ptr& ambientColor = core::Ptr(), const core::Ptr& specularColor = core::Ptr(), const core::Ptr& emissiveColor = core::Ptr(), double glossiness = 5, double opacity = 1); + + /// Gets and sets the emissiveColor associated with this CustomGraphicsBasicMaterialColorEffect object. + /// The emissive color is the primary color of the entity + core::Ptr emissiveColor() const; + bool emissiveColor(const core::Ptr& value); + + /// Gets and sets the ambientColor associated with this CustomGraphicsBasicMaterialColorEffect object. + /// The ambient color is the color of the light anywhere there's not a specific light source. + core::Ptr ambientColor() const; + bool ambientColor(const core::Ptr& value); + + /// Gets and sets the diffuseColor associated with this CustomGraphicsBasicMaterialColorEffect object. + /// The diffuse color is the color of reflected light as it scatters off of a rough surface. + core::Ptr diffuseColor() const; + bool diffuseColor(const core::Ptr& value); + + /// Gets and sets the specularColor associated with this CustomGraphicsBasicMaterialColorEffect object. + /// The specular color is the color of reflected light (highlights) as it is reflected off of a shiny surface. This is + /// commonly white or a lighter shade of the emissive color. + core::Ptr specularColor() const; + bool specularColor(const core::Ptr& value); + + /// Gets and sets the glossiness associated with this CustomGraphicsBasicMaterialColorEffect object. + /// The glossiness determines the size of highlights, and thus the apparent shininess of the material. + /// A value of 0.0 will result in very large hightlights like you would see with a rough surface. + /// A maximum valaue of 128.0 will result in very small highlight as from a smooth surface. + double glossiness() const; + bool glossiness(double value); + + /// Gets and sets the opacity associated with this CustomGraphicsBasicMaterialColorEffect object. + /// A value of 1.0 is completely opaque and 0.0 is completely transparent. + double opacity() const; + bool opacity(double value); + + ADSK_FUSION_CUSTOMGRAPHICSBASICMATERIALCOLOREFFECT_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSBASICMATERIALCOLOREFFECT_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSBASICMATERIALCOLOREFFECT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSBASICMATERIALCOLOREFFECT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_CUSTOMGRAPHICSBASICMATERIALCOLOREFFECT_API static CustomGraphicsBasicMaterialColorEffect* create_raw(core::Color* diffuseColor, core::Color* ambientColor, core::Color* specularColor, core::Color* emissiveColor, double glossiness, double opacity); + virtual core::Color* emissiveColor_raw() const = 0; + virtual bool emissiveColor_raw(core::Color* value) = 0; + virtual core::Color* ambientColor_raw() const = 0; + virtual bool ambientColor_raw(core::Color* value) = 0; + virtual core::Color* diffuseColor_raw() const = 0; + virtual bool diffuseColor_raw(core::Color* value) = 0; + virtual core::Color* specularColor_raw() const = 0; + virtual bool specularColor_raw(core::Color* value) = 0; + virtual double glossiness_raw() const = 0; + virtual bool glossiness_raw(double value) = 0; + virtual double opacity_raw() const = 0; + virtual bool opacity_raw(double value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsBasicMaterialColorEffect::create(const core::Ptr& diffuseColor, const core::Ptr& ambientColor, const core::Ptr& specularColor, const core::Ptr& emissiveColor, double glossiness, double opacity) +{ + core::Ptr res = create_raw(diffuseColor.get(), ambientColor.get(), specularColor.get(), emissiveColor.get(), glossiness, opacity); + return res; +} + +inline core::Ptr CustomGraphicsBasicMaterialColorEffect::emissiveColor() const +{ + core::Ptr res = emissiveColor_raw(); + return res; +} + +inline bool CustomGraphicsBasicMaterialColorEffect::emissiveColor(const core::Ptr& value) +{ + return emissiveColor_raw(value.get()); +} + +inline core::Ptr CustomGraphicsBasicMaterialColorEffect::ambientColor() const +{ + core::Ptr res = ambientColor_raw(); + return res; +} + +inline bool CustomGraphicsBasicMaterialColorEffect::ambientColor(const core::Ptr& value) +{ + return ambientColor_raw(value.get()); +} + +inline core::Ptr CustomGraphicsBasicMaterialColorEffect::diffuseColor() const +{ + core::Ptr res = diffuseColor_raw(); + return res; +} + +inline bool CustomGraphicsBasicMaterialColorEffect::diffuseColor(const core::Ptr& value) +{ + return diffuseColor_raw(value.get()); +} + +inline core::Ptr CustomGraphicsBasicMaterialColorEffect::specularColor() const +{ + core::Ptr res = specularColor_raw(); + return res; +} + +inline bool CustomGraphicsBasicMaterialColorEffect::specularColor(const core::Ptr& value) +{ + return specularColor_raw(value.get()); +} + +inline double CustomGraphicsBasicMaterialColorEffect::glossiness() const +{ + double res = glossiness_raw(); + return res; +} + +inline bool CustomGraphicsBasicMaterialColorEffect::glossiness(double value) +{ + return glossiness_raw(value); +} + +inline double CustomGraphicsBasicMaterialColorEffect::opacity() const +{ + double res = opacity_raw(); + return res; +} + +inline bool CustomGraphicsBasicMaterialColorEffect::opacity(double value) +{ + return opacity_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSBASICMATERIALCOLOREFFECT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBillBoard.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBillBoard.h new file mode 100644 index 0000000..67a96aa --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsBillBoard.h @@ -0,0 +1,135 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSBILLBOARD_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSBILLBOARD_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSBILLBOARD_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSBILLBOARD_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Point3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Used to specify if the orientation of custom graphics are defined relative to the screen instead of model space. +/// This is commonly used for legends and symbols that you want to always face the user, even as the +/// camera is rotated. +class CustomGraphicsBillBoard : public core::Base { +public: + + /// Creates a new CustomGraphicsBillBoard object that can be used when calling the billBoarding property + /// of the CustomGraphicsEntity object to specify the billboarding behavior of some custom graphics. Once + /// created you can assign it to a custom graphics entity using its billBoarding property. + /// anchorPoint : Specifies the coordinate that the graphics will anchor to. The anchor point is the point where the + /// custom graphics are anchored in world space. As the user manipulates the camera and rotates around + /// the model, making it appear that world space is rotating, the graphics remain facing the camera and + /// the anchor point defines the common location between world space and the graphics. + /// For graphics where the If the isViewDependent property of the graphics entity is true, then the + /// anchor point is defined in pixels relative to the upper-left corner of the view and the z component + /// of the input point is ignored. + /// Returns the newly created CustomGraphicsBillBoard object or null in the case of failure. This can be assigned + /// to a custom graphics entity using its billBoarding property. + static core::Ptr create(const core::Ptr& anchorPoint); + + /// Specifies the coordinate in model or view space that the graphics will anchor to. For graphics that + /// represent a label, this will typically be the point where the label attaches to the model. A + /// CustomGraphicsAnchorPoint can be created using the static create method on the CustomGraphicsAnchorPoint + /// object. + core::Ptr anchorPoint() const; + bool anchorPoint(const core::Ptr& value); + + /// Specifies the type of billboarding to use. When a new CustomGraphicsBillBoard object is created + /// this defaults to ScreenBillBoardStyle so the graphics will all be facing the view plane. It can also + /// be set to an arbitrary plane by setting this to AxialBillBoardStyle and can be defined so that it never + /// appear backwards by setting it to RightReadingBillBoardStyle. + CustomGraphicsBillBoardStyles billBoardStyle() const; + bool billBoardStyle(CustomGraphicsBillBoardStyles value); + + /// When the billBoardStyle property is set to AxialBillBoardStyle, this is used to control the direction + /// of the graphics. Otherwise it uses the x axis of the view. + core::Ptr axis() const; + bool axis(const core::Ptr& value); + + ADSK_FUSION_CUSTOMGRAPHICSBILLBOARD_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSBILLBOARD_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSBILLBOARD_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSBILLBOARD_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_CUSTOMGRAPHICSBILLBOARD_API static CustomGraphicsBillBoard* create_raw(core::Point3D* anchorPoint); + virtual core::Point3D* anchorPoint_raw() const = 0; + virtual bool anchorPoint_raw(core::Point3D* value) = 0; + virtual CustomGraphicsBillBoardStyles billBoardStyle_raw() const = 0; + virtual bool billBoardStyle_raw(CustomGraphicsBillBoardStyles value) = 0; + virtual core::Vector3D* axis_raw() const = 0; + virtual bool axis_raw(core::Vector3D* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsBillBoard::create(const core::Ptr& anchorPoint) +{ + core::Ptr res = create_raw(anchorPoint.get()); + return res; +} + +inline core::Ptr CustomGraphicsBillBoard::anchorPoint() const +{ + core::Ptr res = anchorPoint_raw(); + return res; +} + +inline bool CustomGraphicsBillBoard::anchorPoint(const core::Ptr& value) +{ + return anchorPoint_raw(value.get()); +} + +inline CustomGraphicsBillBoardStyles CustomGraphicsBillBoard::billBoardStyle() const +{ + CustomGraphicsBillBoardStyles res = billBoardStyle_raw(); + return res; +} + +inline bool CustomGraphicsBillBoard::billBoardStyle(CustomGraphicsBillBoardStyles value) +{ + return billBoardStyle_raw(value); +} + +inline core::Ptr CustomGraphicsBillBoard::axis() const +{ + core::Ptr res = axis_raw(); + return res; +} + +inline bool CustomGraphicsBillBoard::axis(const core::Ptr& value) +{ + return axis_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSBILLBOARD_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsColorEffect.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsColorEffect.h new file mode 100644 index 0000000..d52e5b1 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsColorEffect.h @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSCOLOREFFECT_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSCOLOREFFECT_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSCOLOREFFECT_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSCOLOREFFECT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The base class for all custom graphics color effects. +class CustomGraphicsColorEffect : public core::Base { +public: + + ADSK_FUSION_CUSTOMGRAPHICSCOLOREFFECT_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSCOLOREFFECT_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSCOLOREFFECT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSCOLOREFFECT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual void placeholderCustomGraphicsColorEffect0() {} + virtual void placeholderCustomGraphicsColorEffect1() {} + virtual void placeholderCustomGraphicsColorEffect2() {} + virtual void placeholderCustomGraphicsColorEffect3() {} + virtual void placeholderCustomGraphicsColorEffect4() {} + virtual void placeholderCustomGraphicsColorEffect5() {} + virtual void placeholderCustomGraphicsColorEffect6() {} + virtual void placeholderCustomGraphicsColorEffect7() {} + virtual void placeholderCustomGraphicsColorEffect8() {} + virtual void placeholderCustomGraphicsColorEffect9() {} + virtual void placeholderCustomGraphicsColorEffect10() {} + virtual void placeholderCustomGraphicsColorEffect11() {} + virtual void placeholderCustomGraphicsColorEffect12() {} + virtual void placeholderCustomGraphicsColorEffect13() {} + virtual void placeholderCustomGraphicsColorEffect14() {} + virtual void placeholderCustomGraphicsColorEffect15() {} +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSCOLOREFFECT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsCoordinates.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsCoordinates.h new file mode 100644 index 0000000..9a5ae29 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsCoordinates.h @@ -0,0 +1,184 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSCOORDINATES_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSCOORDINATES_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSCOORDINATES_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSCOORDINATES_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Color; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// Represents coordinates that are used to define vertices in custom graphics. +class CustomGraphicsCoordinates : public core::Base { +public: + + /// Static method that creates a CustomGraphicsCoordinates object which can be used as input to + /// various custom graphics methods. + /// coordinates : An array of doubles where the values are the x, y, z components of each coordinate where + /// the unit of measure is centimeters. + /// Returns the created CustomGraphicsCoordinates object or null in the case of failure. + static core::Ptr create(const std::vector& coordinates); + + /// Gets and sets the coordinate data associated with this CustomGraphicsCoordinates object. + /// This data represents the x, y, z components of the coordinates where the unit of measure is centimeters. + std::vector coordinates() const; + bool coordinates(const std::vector& value); + + /// Returns the number of coordinates defined in the CustomGraphicsCoordinates object. + int coordinateCount() const; + + /// Gets the coordinate at the specified index. + /// index : The index of the coordinate to return. The first coordinate has an index of 0. + /// Returns the coordinate as a Point3D object. + core::Ptr getCoordinate(int index); + + /// Sets the coordinate at the specified index. + /// index : The index of the coordinate to set. The first coordinate has an index of 0. + /// coordinate : The coordinate value as a Point3D object. + /// Returns true if setting the coordinate was successful. + bool setCoordinate(int index, const core::Ptr& coordinate); + + /// Gets and sets the colors assoicated with the coordinate data. This is used when a mesh is + /// displayed using per-vertex coloring. + /// The color at each vertex is represented by four values where they are the red, green, blue, + /// and alpha values. This should contain the same number of colors as vertices. + std::vector colors() const; + bool colors(const std::vector& value); + + /// Gets the color assigned to the coordinate at the specified index. + /// index : The index of the color to return. The first color has an index of 0. + /// Returns the color associated with the index. Can also return null in the case + /// where there is no color assigned. + core::Ptr getColor(int index); + + /// Sets the color of the coordinate at the specified index. + /// index : The index of the coordinate to set. The first coordinate has an index of 0. + /// color : The color value as a Color object. + /// Returns true if setting the color was successful. + bool setColor(int index, const core::Ptr& color); + + ADSK_FUSION_CUSTOMGRAPHICSCOORDINATES_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSCOORDINATES_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSCOORDINATES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSCOORDINATES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_CUSTOMGRAPHICSCOORDINATES_API static CustomGraphicsCoordinates* create_raw(const double* coordinates, size_t coordinates_size); + virtual double* coordinates_raw(size_t& return_size) const = 0; + virtual bool coordinates_raw(const double* value, size_t value_size) = 0; + virtual int coordinateCount_raw() const = 0; + virtual core::Point3D* getCoordinate_raw(int index) = 0; + virtual bool setCoordinate_raw(int index, core::Point3D* coordinate) = 0; + virtual short* colors_raw(size_t& return_size) const = 0; + virtual bool colors_raw(const short* value, size_t value_size) = 0; + virtual core::Color* getColor_raw(int index) = 0; + virtual bool setColor_raw(int index, core::Color* color) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsCoordinates::create(const std::vector& coordinates) +{ + core::Ptr res = create_raw(coordinates.empty() ? NULL : &coordinates[0], coordinates.size()); + return res; +} + +inline std::vector CustomGraphicsCoordinates::coordinates() const +{ + std::vector res; + size_t s; + + double* p= coordinates_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsCoordinates::coordinates(const std::vector& value) +{ + return coordinates_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline int CustomGraphicsCoordinates::coordinateCount() const +{ + int res = coordinateCount_raw(); + return res; +} + +inline core::Ptr CustomGraphicsCoordinates::getCoordinate(int index) +{ + core::Ptr res = getCoordinate_raw(index); + return res; +} + +inline bool CustomGraphicsCoordinates::setCoordinate(int index, const core::Ptr& coordinate) +{ + bool res = setCoordinate_raw(index, coordinate.get()); + return res; +} + +inline std::vector CustomGraphicsCoordinates::colors() const +{ + std::vector res; + size_t s; + + short* p= colors_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsCoordinates::colors(const std::vector& value) +{ + return colors_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline core::Ptr CustomGraphicsCoordinates::getColor(int index) +{ + core::Ptr res = getColor_raw(index); + return res; +} + +inline bool CustomGraphicsCoordinates::setColor(int index, const core::Ptr& color) +{ + bool res = setColor_raw(index, color.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSCOORDINATES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsCurve.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsCurve.h new file mode 100644 index 0000000..cd5f825 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsCurve.h @@ -0,0 +1,90 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "CustomGraphicsEntity.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSCURVE_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSCURVE_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSCURVE_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSCURVE_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Curve3D; +}} + +namespace adsk { namespace fusion { + +/// This represents custom graphics that are based on any object derived from Curve3D (except InfiniteLine3D). +/// This is useful when drawing curved geometry where the alternative is to stroke the smooth curve and draw +/// it as a series of lines. Using this you can directly use the curve and Fusion 360 will automatically take care +/// of creating the correct display for the current level of detail. +class CustomGraphicsCurve : public CustomGraphicsEntity { +public: + + /// Gets and sets the curve associated with this graphics entity. Any of the curve types derived from Curve3D + /// is valid except for InfiniteLine3D. + core::Ptr curve() const; + bool curve(const core::Ptr& value); + + /// Defines the thickness of the curve in pixels. + double weight() const; + bool weight(double value); + + ADSK_FUSION_CUSTOMGRAPHICSCURVE_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSCURVE_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSCURVE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSCURVE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Curve3D* curve_raw() const = 0; + virtual bool curve_raw(core::Curve3D* value) = 0; + virtual double weight_raw() const = 0; + virtual bool weight_raw(double value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsCurve::curve() const +{ + core::Ptr res = curve_raw(); + return res; +} + +inline bool CustomGraphicsCurve::curve(const core::Ptr& value) +{ + return curve_raw(value.get()); +} + +inline double CustomGraphicsCurve::weight() const +{ + double res = weight_raw(); + return res; +} + +inline bool CustomGraphicsCurve::weight(double value) +{ + return weight_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSCURVE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsEntity.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsEntity.h new file mode 100644 index 0000000..7b64ba1 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsEntity.h @@ -0,0 +1,373 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSENTITY_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSENTITY_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSENTITY_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSENTITY_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomGraphicsBillBoard; + class CustomGraphicsColorEffect; + class CustomGraphicsViewPlacement; + class CustomGraphicsViewScale; +}} +namespace adsk { namespace core { + class BoundingBox3D; + class Matrix3D; +}} + +namespace adsk { namespace fusion { + +/// The base class for all visible and selectable custom graphics objects. +class CustomGraphicsEntity : public core::Base { +public: + + /// Deletes the entity from the custom graphics group. + /// Returns true if the deletion was successful. + bool deleteMe(); + + /// Gets and sets if the graphics entity is visible in the graphics window. By + /// default, when a new entity is created it is visible. + bool isVisible() const; + bool isVisible(bool value); + + /// Gets and sets if the graphics entity is selectable within the graphics window. By + /// default, when a new entity is created it is selectable. + bool isSelectable() const; + bool isSelectable(bool value); + + /// Sets the opacity of the graphics entity. By default, when a new entity is it is + /// completely opaque and does not override the opacity defined by the material. + /// opacity : The opacity value where 1.0 is completely opaque and 0.0 is completely transparent. + /// isOverride : Indicates if this entities opacity will override the opacity defined by the material. + /// If true, it will override the material opacity and if false the opacity values will + /// accumulate. + /// Returns true if setting the opacity information was successful. + bool setOpacity(double opacity, bool isOverride); + + /// Gets the opacity of the graphics entity. + /// opacity : The opacity value where 1.0 is completely opaque and 0.0 is completely transparent. + /// isOverride : Indicates if this entities opacity will override the opacity defined by the material. + /// If true, it will override the material opacity and if false the opacity values will + /// accumulate. + /// Returns true if getting the opacity information was successful. + bool getOpacity(double& opacity, bool& isOverride); + + /// Gets and sets the transform associated with the graphics entity. When a new graphics + /// entity is created its default transform is an identity matrix which results in the graphics entity + /// being displayed in model space using the original coordinate data used to define the entity. + core::Ptr transform() const; + bool transform(const core::Ptr& value); + + /// Gets and sets the depth priority associated with the graphics entity. The depth priority defines + /// how one graphics entity will be drawn with respect to another entity. This is useful when there + /// are entities that lie in the same space so it's ambiguous which should be drawn on the other. For + /// example, if you draw a curve on a planar mesh and want the curve to be completely visible. You can + /// set the depth priority of the curve to be greater than the mesh so it will be drawn after the mesh + /// and will remain visible. + /// When a new graphics entity is created it's default depth priority is 0. + int depthPriority() const; + bool depthPriority(int value); + + /// Gets and sets the culling model to use when rendering the entity. Culling is used when the entity contains + /// a mesh or B-Rep faces and defines which sides of the mesh or face are rendered. This is primarily used + /// for a watertight mesh or solid B-Rep so that the "inside" of the faces is not rendered since it's never + /// visible to the user. + /// When a new graphics entity is created its default cull mode is CustomGraphicsCullBack which will optimize + /// the rendering of "solid" meshes so the inside is not rendered. + CustomGraphicsCullModes cullMode() const; + bool cullMode(CustomGraphicsCullModes value); + + /// Gets and sets the current color definition for this entity. The color of custom graphics can + /// be defined in many ways; solid color, simple material, and appearance. + core::Ptr color() const; + bool color(const core::Ptr& value); + + /// Returns the parent Component for a top-level group or the CustomGraphicsGroup object for + /// graphics entities and child groups. + core::Ptr parent() const; + + /// An id you can specify for the entity. By default, all new graphics entities do not have an id and + /// this property will return an empty string. But in cases where entities will be selected, assigning + /// an id can make understanding what was selected much easier. + std::string id() const; + bool id(const std::string& value); + + /// Returns a box oriented parallel to the world x-y-x axes that contains the graphics entity. + /// Depending on whether the graphics are drawn in model space or screen space this will return + /// the bounding box in either centimeters (model) or pixels (screen). In the case where it + /// returns the bounding box in pixel space, the Z coordinates of the box will be 0 and can be ignored. + core::Ptr boundingBox() const; + + /// Gets and sets the billboarding behavior of this custom graphics entity. To define billboarding + /// you can set this property using a CustomGraphicsBillBoard objects that you statically create using + /// the create method of the CustomGraphicsBillBoard class. To remove billboarding from this entity + /// you can set this property to null. + /// Billboarding is used to specify that the orientation of custom graphics is defined relative to the + /// screen instead of model space. This is commonly used for legends and symbols that you want to + /// always face the user, even as the camera is rotated. + core::Ptr billBoarding() const; + bool billBoarding(const core::Ptr& value); + + /// Gets and sets the graphics view placement being applied to this graphics entity. A + /// CustomGraphicsViewPlacement object can be created using the static create method of the + /// class. When assigned to a graphics entity the position of the graphics is defined + /// relative to the view in 2D view space (pixels) rather than in 3D model space (centimeters). + core::Ptr viewPlacement() const; + bool viewPlacement(const core::Ptr& value); + + /// Gets and sets the graphics view scale being applied to this graphics entity. A + /// CustomGraphicsViewScale object can be created using the static create method of the + /// class. When assigned to a graphics entity the size of the graphics entity is defined + /// in view space (pixels) instead of model space (centimeters). + core::Ptr viewScale() const; + bool viewScale(const core::Ptr& value); + + ADSK_FUSION_CUSTOMGRAPHICSENTITY_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSENTITY_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSENTITY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSENTITY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool deleteMe_raw() = 0; + virtual bool isVisible_raw() const = 0; + virtual bool isVisible_raw(bool value) = 0; + virtual bool isSelectable_raw() const = 0; + virtual bool isSelectable_raw(bool value) = 0; + virtual bool setOpacity_raw(double opacity, bool isOverride) = 0; + virtual bool getOpacity_raw(double& opacity, bool& isOverride) = 0; + virtual core::Matrix3D* transform_raw() const = 0; + virtual bool transform_raw(core::Matrix3D* value) = 0; + virtual int depthPriority_raw() const = 0; + virtual bool depthPriority_raw(int value) = 0; + virtual CustomGraphicsCullModes cullMode_raw() const = 0; + virtual bool cullMode_raw(CustomGraphicsCullModes value) = 0; + virtual CustomGraphicsColorEffect* color_raw() const = 0; + virtual bool color_raw(CustomGraphicsColorEffect* value) = 0; + virtual core::Base* parent_raw() const = 0; + virtual char* id_raw() const = 0; + virtual bool id_raw(const char * value) = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual CustomGraphicsBillBoard* billBoarding_raw() const = 0; + virtual bool billBoarding_raw(CustomGraphicsBillBoard* value) = 0; + virtual CustomGraphicsViewPlacement* viewPlacement_raw() const = 0; + virtual bool viewPlacement_raw(CustomGraphicsViewPlacement* value) = 0; + virtual CustomGraphicsViewScale* viewScale_raw() const = 0; + virtual bool viewScale_raw(CustomGraphicsViewScale* value) = 0; + virtual void placeholderCustomGraphicsEntity0() {} + virtual void placeholderCustomGraphicsEntity1() {} + virtual void placeholderCustomGraphicsEntity2() {} + virtual void placeholderCustomGraphicsEntity3() {} + virtual void placeholderCustomGraphicsEntity4() {} + virtual void placeholderCustomGraphicsEntity5() {} + virtual void placeholderCustomGraphicsEntity6() {} + virtual void placeholderCustomGraphicsEntity7() {} + virtual void placeholderCustomGraphicsEntity8() {} + virtual void placeholderCustomGraphicsEntity9() {} + virtual void placeholderCustomGraphicsEntity10() {} + virtual void placeholderCustomGraphicsEntity11() {} + virtual void placeholderCustomGraphicsEntity12() {} + virtual void placeholderCustomGraphicsEntity13() {} + virtual void placeholderCustomGraphicsEntity14() {} + virtual void placeholderCustomGraphicsEntity15() {} + virtual void placeholderCustomGraphicsEntity16() {} + virtual void placeholderCustomGraphicsEntity17() {} + virtual void placeholderCustomGraphicsEntity18() {} + virtual void placeholderCustomGraphicsEntity19() {} + virtual void placeholderCustomGraphicsEntity20() {} + virtual void placeholderCustomGraphicsEntity21() {} + virtual void placeholderCustomGraphicsEntity22() {} + virtual void placeholderCustomGraphicsEntity23() {} + virtual void placeholderCustomGraphicsEntity24() {} + virtual void placeholderCustomGraphicsEntity25() {} + virtual void placeholderCustomGraphicsEntity26() {} + virtual void placeholderCustomGraphicsEntity27() {} + virtual void placeholderCustomGraphicsEntity28() {} + virtual void placeholderCustomGraphicsEntity29() {} + virtual void placeholderCustomGraphicsEntity30() {} + virtual void placeholderCustomGraphicsEntity31() {} + virtual void placeholderCustomGraphicsEntity32() {} + virtual void placeholderCustomGraphicsEntity33() {} + virtual void placeholderCustomGraphicsEntity34() {} + virtual void placeholderCustomGraphicsEntity35() {} + virtual void placeholderCustomGraphicsEntity36() {} + virtual void placeholderCustomGraphicsEntity37() {} + virtual void placeholderCustomGraphicsEntity38() {} +}; + +// Inline wrappers + +inline bool CustomGraphicsEntity::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline bool CustomGraphicsEntity::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline bool CustomGraphicsEntity::isVisible(bool value) +{ + return isVisible_raw(value); +} + +inline bool CustomGraphicsEntity::isSelectable() const +{ + bool res = isSelectable_raw(); + return res; +} + +inline bool CustomGraphicsEntity::isSelectable(bool value) +{ + return isSelectable_raw(value); +} + +inline bool CustomGraphicsEntity::setOpacity(double opacity, bool isOverride) +{ + bool res = setOpacity_raw(opacity, isOverride); + return res; +} + +inline bool CustomGraphicsEntity::getOpacity(double& opacity, bool& isOverride) +{ + bool res = getOpacity_raw(opacity, isOverride); + return res; +} + +inline core::Ptr CustomGraphicsEntity::transform() const +{ + core::Ptr res = transform_raw(); + return res; +} + +inline bool CustomGraphicsEntity::transform(const core::Ptr& value) +{ + return transform_raw(value.get()); +} + +inline int CustomGraphicsEntity::depthPriority() const +{ + int res = depthPriority_raw(); + return res; +} + +inline bool CustomGraphicsEntity::depthPriority(int value) +{ + return depthPriority_raw(value); +} + +inline CustomGraphicsCullModes CustomGraphicsEntity::cullMode() const +{ + CustomGraphicsCullModes res = cullMode_raw(); + return res; +} + +inline bool CustomGraphicsEntity::cullMode(CustomGraphicsCullModes value) +{ + return cullMode_raw(value); +} + +inline core::Ptr CustomGraphicsEntity::color() const +{ + core::Ptr res = color_raw(); + return res; +} + +inline bool CustomGraphicsEntity::color(const core::Ptr& value) +{ + return color_raw(value.get()); +} + +inline core::Ptr CustomGraphicsEntity::parent() const +{ + core::Ptr res = parent_raw(); + return res; +} + +inline std::string CustomGraphicsEntity::id() const +{ + std::string res; + + char* p= id_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsEntity::id(const std::string& value) +{ + return id_raw(value.c_str()); +} + +inline core::Ptr CustomGraphicsEntity::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline core::Ptr CustomGraphicsEntity::billBoarding() const +{ + core::Ptr res = billBoarding_raw(); + return res; +} + +inline bool CustomGraphicsEntity::billBoarding(const core::Ptr& value) +{ + return billBoarding_raw(value.get()); +} + +inline core::Ptr CustomGraphicsEntity::viewPlacement() const +{ + core::Ptr res = viewPlacement_raw(); + return res; +} + +inline bool CustomGraphicsEntity::viewPlacement(const core::Ptr& value) +{ + return viewPlacement_raw(value.get()); +} + +inline core::Ptr CustomGraphicsEntity::viewScale() const +{ + core::Ptr res = viewScale_raw(); + return res; +} + +inline bool CustomGraphicsEntity::viewScale(const core::Ptr& value) +{ + return viewScale_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSENTITY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsGroup.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsGroup.h new file mode 100644 index 0000000..227a3dc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsGroup.h @@ -0,0 +1,228 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "CustomGraphicsEntity.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSGROUP_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSGROUP_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSGROUP_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSGROUP_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class CustomGraphicsBRepBody; + class CustomGraphicsCoordinates; + class CustomGraphicsCurve; + class CustomGraphicsEntity; + class CustomGraphicsLines; + class CustomGraphicsMesh; + class CustomGraphicsPointSet; + class CustomGraphicsText; +}} +namespace adsk { namespace core { + class Curve3D; + class Matrix3D; +}} + +namespace adsk { namespace fusion { + +/// Represents of group of custom graphics entities. A group can also own other graphics groups. +class CustomGraphicsGroup : public CustomGraphicsEntity { +public: + + /// Function that returns the specified custom graphics entity within this group. This also includes + /// any child graphics groups. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of graphics entities within the group. + size_t count() const; + + /// Creates a new, empty CustomGraphicsGroup that is owned by this CustomGraphicsGroup. + /// Returns the new CustomGraphicsGroup object or null in the case of a failure. + core::Ptr addGroup(); + + /// Adds a new CustomGraphicsMesh entity to this group. + /// coordinates : The CustomGraphicsCoordinates object that defines the coordinates of the vertices of the mesh. + /// A CustomGrahpicsCoordinates object can be created using the static create method of the CustomGraphicsCoordinates class. + /// coordinateIndexList : An array of integers that represent indices into the coordinates to define the vertices of the triangles. If an empty + /// array is provided, then it's assumed that the first three coordinates defines the first triangle, the next three define + /// the second triangle, and so on. + /// normalVectors : An array of doubles that represent the x, y, z components of the normals at each coordinate. There should be a normal defined + /// for each coordinate. If an empty array is provided for the normal vectors, Fusion 360 will automatically calculate normal vectors + /// that are 90 degrees to the face of the triangle, making it appear flat. + /// normalIndexList : An array of integers that represent indices into the normal vectors to define the which vector corresponds to which vertex. This + /// should be the same size as the vertex index list. If an empty array is input and normal vectors are provided, it is assumed that + /// the normals match up one-to-one to each coordinate. + /// Returns the new CustomGraphicsMesh object or null in the case of a failure. + core::Ptr addMesh(const core::Ptr& coordinates, const std::vector& coordinateIndexList, const std::vector& normalVectors, const std::vector& normalIndexList); + + /// Adds a new CustomGraphicsLines entity to this group. + /// coordinates : The CustomGraphicsCoordinates object that defines the coordinates of the vertices of the lines. + /// A CustomGraphicsCoordinates object can be created using the static create method of the CustomGraphicsCoordinates class. + /// indexList : An array of integers that represent indices into the coordinates to define the order the coordinates are used to draw the lines. + /// If an empty array is provided, the coordinates are used in the order they're provided in the provided CustomGraphicsCoordinates object. + /// isLineStrip : A boolean indicating if a series of individual lines or a connected set of lines (a line strip) is to be drawn. If individual lines + /// are drawn, (this argument is false), each pair of coordinates defines a single line. If a line strip is drawn, (this argument is true), + /// the first pair of coordinates define the first line and the third coordinate defines a line that connects to the second coordinate. + /// The fourth coordinate creates a line connecting to the third coordinate, and so on. + /// lineStripLengths : If isLineStrip is true, this argument is used to define the number of coordinates to use in each line strip. It is an array of integers + /// that defines the number of coordinates for each line strip. For example, if the array [4,10] is input, 4 coordinates are connected for + /// the first line strip and 10 are used to create a second line strip. If an empty array is provided, a single line strip is created. If + /// isLineStrip is False, this argument is ignored. + /// Returns the new CustomGraphicsLines object or null in the case of a failure. + core::Ptr addLines(const core::Ptr& coordinates, const std::vector& indexList, bool isLineStrip, const std::vector& lineStripLengths = std::vector()); + + /// Adds a new CustomGraphicsCurve entity to this group. A CustomGraphicsCurve is a wireframe graphic + /// that is based on any object derived from Curve3D (except InfiniteLine3D). This is useful when + /// drawing curved geometry where the alternative is to stroke the smooth curve and draw it as a series + /// of lines. Using this you can directly use the curve and Fusion 360 will automatically take care of creating + /// the correct display for the current level of detail. + /// curve : The curve that defines the shape of the graphics entity. Any of the curve types derived from Curve3D + /// are valid except for InfiniteLine3D. + /// Returns the newly created CustomGraphicsCurve object or null in the case of failure. + core::Ptr addCurve(const core::Ptr& curve); + + /// Adds a new CustomGraphicsPointSet entity to this group. This will be displayed as one or more points where + /// all of the points will display using the same image. + /// coordinates : The CustomGraphicsCoordinates object that defines the coordinates where the points will be displayed. + /// A CustomGraphicsCoordinates object can be created using the static create method of the CustomGraphicsCoordinates class. + /// indexList : An array of integers that represent indices into the coordinates to define which coordinates to use when drawing points. + /// If an empty array is provided, a point is drawn for every coordinate. + /// pointType : Specifies the type of point to display. Currently there are two choices; UserDefinedCustomGraphicsPointType and + /// PointCloudCustomGraphicsPointType. When set to PointCloudCustomGraphicsPointType, each point displays as a single pixel and is + /// the most efficient point display type for displaying sets that contain very large quantities of points. When + /// set to UserDefinedCustomGraphicsPointType, you specify the image to display as the point. This can be any png image and is + /// centered on the point. + /// pointImage : If the pointType is PointCloudCustomGraphicsPointType this argument is ignored and can be an empty string. This argument + /// must be specified if the pointType is UserDefinedCustomGraphicsPointType. This is the path to the png image file that will be + /// displayed as the point. It can be either a full path to the file or a relative path that is respect to the .py, dll, or dylib + /// file being run. There is no restriction on the size of the image, but generally very small images would be used for points. + /// Returns the newly created CustomGraphicsPointSet object or null in the case of failure. + core::Ptr addPointSet(const core::Ptr& coordinates, const std::vector& indexList, CustomGraphicsPointTypes pointType, const std::string& pointImage); + + /// Adds a new CustomGraphicsText entity to this group. This will be displayed as a single line of text. + /// It is placed so that the upper-left corner is at the point defined and the text will be parallel + /// to the X-Y plane of the world coordinate system and in the X direction. To change it's position relative + /// to the input point you can change the horizontal and vertical justification on the returnsed CustomGrahicsText + /// object. You can also reorient the text by changing the transform of the returned CustomGraphicsText object. + /// formattedText : The text string to be displayed. Overall formatting can be defined using properties on the returned + /// CustomGraphicsText object. Formatting overrides can be defined within the string using formatting codes. + /// font : The name of the font to use when displaying the text. + /// size : The size of the text in centimeters. + /// transform : Transformation matrix that specifies the position and orientation of the text in model space. The origin of the text + /// is the upper-left corner. + /// Returns the newly created CustomGraphicsText object or null in the case of failure. + core::Ptr addText(const std::string& formattedText, const std::string& font, double size, const core::Ptr& transform); + + /// Adds a new CustomGraphicsBRepBody object to this group. This displays a real or transient BRepBody + /// object as custom graphics. No relationship exists back to the original input body so if it is + /// changed, the custom graphics will not change. + /// The body associated with the CustomGraphicsBRep body is a copy of the original input body. Equivalent + /// Faces, Edges, and vertices can be found by using the indexes in the collection. For example if you have + /// a face of the original body and find that it is at index 24 in the BRepFaces collection of that body, + /// the equivalent face in the custom graphics body will also be at index 24. This works as long as the original + /// body is not modified in any way. + /// body : The real or transient BRepBody object to draw using custom graphics. + /// Returns the newly created CustomGraphicsBRepBody object or null in the case of failure. + core::Ptr addBRepBody(const core::Ptr& body); + + ADSK_FUSION_CUSTOMGRAPHICSGROUP_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSGROUP_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSGROUP_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSGROUP_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomGraphicsEntity* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual CustomGraphicsGroup* addGroup_raw() = 0; + virtual CustomGraphicsMesh* addMesh_raw(CustomGraphicsCoordinates* coordinates, const int* coordinateIndexList, size_t coordinateIndexList_size, const double* normalVectors, size_t normalVectors_size, const int* normalIndexList, size_t normalIndexList_size) = 0; + virtual CustomGraphicsLines* addLines_raw(CustomGraphicsCoordinates* coordinates, const int* indexList, size_t indexList_size, bool isLineStrip, const int* lineStripLengths, size_t lineStripLengths_size) = 0; + virtual CustomGraphicsCurve* addCurve_raw(core::Curve3D* curve) = 0; + virtual CustomGraphicsPointSet* addPointSet_raw(CustomGraphicsCoordinates* coordinates, const int* indexList, size_t indexList_size, CustomGraphicsPointTypes pointType, const char * pointImage) = 0; + virtual CustomGraphicsText* addText_raw(const char * formattedText, const char * font, double size, core::Matrix3D* transform) = 0; + virtual CustomGraphicsBRepBody* addBRepBody_raw(BRepBody* body) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsGroup::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t CustomGraphicsGroup::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CustomGraphicsGroup::addGroup() +{ + core::Ptr res = addGroup_raw(); + return res; +} + +inline core::Ptr CustomGraphicsGroup::addMesh(const core::Ptr& coordinates, const std::vector& coordinateIndexList, const std::vector& normalVectors, const std::vector& normalIndexList) +{ + core::Ptr res = addMesh_raw(coordinates.get(), coordinateIndexList.empty() ? NULL : &coordinateIndexList[0], coordinateIndexList.size(), normalVectors.empty() ? NULL : &normalVectors[0], normalVectors.size(), normalIndexList.empty() ? NULL : &normalIndexList[0], normalIndexList.size()); + return res; +} + +inline core::Ptr CustomGraphicsGroup::addLines(const core::Ptr& coordinates, const std::vector& indexList, bool isLineStrip, const std::vector& lineStripLengths) +{ + core::Ptr res = addLines_raw(coordinates.get(), indexList.empty() ? NULL : &indexList[0], indexList.size(), isLineStrip, lineStripLengths.empty() ? NULL : &lineStripLengths[0], lineStripLengths.size()); + return res; +} + +inline core::Ptr CustomGraphicsGroup::addCurve(const core::Ptr& curve) +{ + core::Ptr res = addCurve_raw(curve.get()); + return res; +} + +inline core::Ptr CustomGraphicsGroup::addPointSet(const core::Ptr& coordinates, const std::vector& indexList, CustomGraphicsPointTypes pointType, const std::string& pointImage) +{ + core::Ptr res = addPointSet_raw(coordinates.get(), indexList.empty() ? NULL : &indexList[0], indexList.size(), pointType, pointImage.c_str()); + return res; +} + +inline core::Ptr CustomGraphicsGroup::addText(const std::string& formattedText, const std::string& font, double size, const core::Ptr& transform) +{ + core::Ptr res = addText_raw(formattedText.c_str(), font.c_str(), size, transform.get()); + return res; +} + +inline core::Ptr CustomGraphicsGroup::addBRepBody(const core::Ptr& body) +{ + core::Ptr res = addBRepBody_raw(body.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSGROUP_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsGroups.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsGroups.h new file mode 100644 index 0000000..789ae45 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsGroups.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSGROUPS_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSGROUPS_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSGROUPS_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSGROUPS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomGraphicsGroup; +}} + +namespace adsk { namespace fusion { + +/// Provides access to a set of graphics groups that are either associated with a component or owned by another +/// CustomGraphicsGroup object. This object also supports the creation of new custom graphics groups. +class CustomGraphicsGroups : public core::Base { +public: + + /// Function that returns the specified graphics group using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of graphics groups in the collection. + size_t count() const; + + /// Creates a new, empty CustomGraphicsGroup. + /// Returns the new CustomGraphicsGroup object or null in the case of a failure. + core::Ptr add(); + + ADSK_FUSION_CUSTOMGRAPHICSGROUPS_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSGROUPS_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSGROUPS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSGROUPS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomGraphicsGroup* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual CustomGraphicsGroup* add_raw() = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsGroups::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t CustomGraphicsGroups::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr CustomGraphicsGroups::add() +{ + core::Ptr res = add_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSGROUPS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsLines.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsLines.h new file mode 100644 index 0000000..6eed256 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsLines.h @@ -0,0 +1,217 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "CustomGraphicsEntity.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSLINES_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSLINES_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSLINES_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSLINES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomGraphicsCoordinates; +}} + +namespace adsk { namespace fusion { + +/// Represents lines drawn in the graphics window. +class CustomGraphicsLines : public CustomGraphicsEntity { +public: + + /// Gets and sets the CustomGraphicsCoordinates object that defines the coordinates of the vertices of the lines. + /// A CustomGraphicsCoordinates object can be created using the static create method of the CustomGraphicsCoordinates class. + core::Ptr coordinates() const; + bool coordinates(const core::Ptr& value); + + /// Gets and sets an array of integers that represent indices into the coordinates to define the order the coordinates are used to draw the lines. + /// An empty array indicates that no index list is used and coordinates are used in the order they're provided in the provided CustomGraphicsCoordinates object. + std::vector indexList() const; + bool indexList(const std::vector& value); + + /// Defines if the coordinates are used to define a series of individual lines or a connected set of lines (line strip). If individual lines + /// are drawn (this property is false), each pair of coordinates define a single line. If a line strip is drawn (this property is true), + /// the first pair of coordinates define the first line and the third coordinate defines a line that connects to the second coordinate. + /// The fourth coordinate creates a line connecting to the third coordinate, and so on. + bool isLineStrip() const; + bool isLineStrip(bool value); + + /// If isLineStrip is true, this property defines the number of coordinates to use in the line strips. It is an array of integers + /// that defines the number of coordinates for each line strip. An empty array indicates that a single line strip is to be drawn. + std::vector lineStripLengths() const; + bool lineStripLengths(const std::vector& value); + + /// Defines the thickness of the line in pixels. + double weight() const; + bool weight(double value); + + /// Defines the scale as it relates to how the line style is applied. The effect is to + /// shrink or expand the line style as it is applied to the line. This does not affect the line width. + double lineStyleScale() const; + bool lineStyleScale(double value); + + /// Specifies if the line style is computed based on the screen or model space. The default is + /// based on the screen which means the style is drawn the same regardless of how you zoom in + /// or out of the view. That is the length of lines and spaces are based on pixels. If it + /// is drawn relative to model space then the lines and spaces are defined in centimeters and + /// will zooming in and out will change the apparent spacing. + bool isScreenSpaceLineStyle() const; + bool isScreenSpaceLineStyle(bool value); + + /// The line style to apply to the line. The default is to draw a continuous line. + LineStylePatterns lineStylePattern() const; + bool lineStylePattern(LineStylePatterns value); + + ADSK_FUSION_CUSTOMGRAPHICSLINES_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSLINES_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSLINES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSLINES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomGraphicsCoordinates* coordinates_raw() const = 0; + virtual bool coordinates_raw(CustomGraphicsCoordinates* value) = 0; + virtual int* indexList_raw(size_t& return_size) const = 0; + virtual bool indexList_raw(const int* value, size_t value_size) = 0; + virtual bool isLineStrip_raw() const = 0; + virtual bool isLineStrip_raw(bool value) = 0; + virtual int* lineStripLengths_raw(size_t& return_size) const = 0; + virtual bool lineStripLengths_raw(const int* value, size_t value_size) = 0; + virtual double weight_raw() const = 0; + virtual bool weight_raw(double value) = 0; + virtual double lineStyleScale_raw() const = 0; + virtual bool lineStyleScale_raw(double value) = 0; + virtual bool isScreenSpaceLineStyle_raw() const = 0; + virtual bool isScreenSpaceLineStyle_raw(bool value) = 0; + virtual LineStylePatterns lineStylePattern_raw() const = 0; + virtual bool lineStylePattern_raw(LineStylePatterns value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsLines::coordinates() const +{ + core::Ptr res = coordinates_raw(); + return res; +} + +inline bool CustomGraphicsLines::coordinates(const core::Ptr& value) +{ + return coordinates_raw(value.get()); +} + +inline std::vector CustomGraphicsLines::indexList() const +{ + std::vector res; + size_t s; + + int* p= indexList_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsLines::indexList(const std::vector& value) +{ + return indexList_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline bool CustomGraphicsLines::isLineStrip() const +{ + bool res = isLineStrip_raw(); + return res; +} + +inline bool CustomGraphicsLines::isLineStrip(bool value) +{ + return isLineStrip_raw(value); +} + +inline std::vector CustomGraphicsLines::lineStripLengths() const +{ + std::vector res; + size_t s; + + int* p= lineStripLengths_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsLines::lineStripLengths(const std::vector& value) +{ + return lineStripLengths_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline double CustomGraphicsLines::weight() const +{ + double res = weight_raw(); + return res; +} + +inline bool CustomGraphicsLines::weight(double value) +{ + return weight_raw(value); +} + +inline double CustomGraphicsLines::lineStyleScale() const +{ + double res = lineStyleScale_raw(); + return res; +} + +inline bool CustomGraphicsLines::lineStyleScale(double value) +{ + return lineStyleScale_raw(value); +} + +inline bool CustomGraphicsLines::isScreenSpaceLineStyle() const +{ + bool res = isScreenSpaceLineStyle_raw(); + return res; +} + +inline bool CustomGraphicsLines::isScreenSpaceLineStyle(bool value) +{ + return isScreenSpaceLineStyle_raw(value); +} + +inline LineStylePatterns CustomGraphicsLines::lineStylePattern() const +{ + LineStylePatterns res = lineStylePattern_raw(); + return res; +} + +inline bool CustomGraphicsLines::lineStylePattern(LineStylePatterns value) +{ + return lineStylePattern_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSLINES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsMesh.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsMesh.h new file mode 100644 index 0000000..fc629af --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsMesh.h @@ -0,0 +1,181 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "CustomGraphicsEntity.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSMESH_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSMESH_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSMESH_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSMESH_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomGraphicsCoordinates; +}} + +namespace adsk { namespace fusion { + +/// Represents a custom triangle mesh drawn in the graphics window. +class CustomGraphicsMesh : public CustomGraphicsEntity { +public: + + /// Gets and sets the coordinates associated with this CustomGraphicsMesh. + core::Ptr coordinates() const; + bool coordinates(const core::Ptr& value); + + /// Gets and sets the normal vectors of the mesh where there is a normal + /// vector at each node. The normals are defined as an array + /// of floats where they are the x, y, z components of each vector. + std::vector normalVectors() const; + bool normalVectors(const std::vector& value); + + /// Gets and sets an array of indices that define which coordinate in the + /// coordinate list is used for each vertex in the mesh. Each set of three + /// indices defines a triagle. For example: + /// Indices 0, 1, and 2 define the coordinates to use for the first triangle and + /// indices 3, 4, and 5 define the coordinates for the second triangle, and so on. + std::vector vertexIndexList() const; + bool vertexIndexList(const std::vector& value); + + /// Gets and sets an array of indices that define which normal is associated + /// with each vertex in the mesh. This is used to look-up the normal in the + /// normalVectors array. + std::vector normalIndexList() const; + bool normalIndexList(const std::vector& value); + + /// Gets and sets the texture coordinates as an array of floats where + /// they are the u,v components at each node. They are defined as an + /// array of doubles where they are the u, v coordinates of each node. + /// Defining texture coordinates for a mesh is optional. + std::vector textureCoordinates() const; + bool textureCoordinates(const std::vector& value); + + ADSK_FUSION_CUSTOMGRAPHICSMESH_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSMESH_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSMESH_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSMESH_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomGraphicsCoordinates* coordinates_raw() const = 0; + virtual bool coordinates_raw(CustomGraphicsCoordinates* value) = 0; + virtual double* normalVectors_raw(size_t& return_size) const = 0; + virtual bool normalVectors_raw(const double* value, size_t value_size) = 0; + virtual int* vertexIndexList_raw(size_t& return_size) const = 0; + virtual bool vertexIndexList_raw(const int* value, size_t value_size) = 0; + virtual int* normalIndexList_raw(size_t& return_size) const = 0; + virtual bool normalIndexList_raw(const int* value, size_t value_size) = 0; + virtual double* textureCoordinates_raw(size_t& return_size) const = 0; + virtual bool textureCoordinates_raw(const double* value, size_t value_size) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsMesh::coordinates() const +{ + core::Ptr res = coordinates_raw(); + return res; +} + +inline bool CustomGraphicsMesh::coordinates(const core::Ptr& value) +{ + return coordinates_raw(value.get()); +} + +inline std::vector CustomGraphicsMesh::normalVectors() const +{ + std::vector res; + size_t s; + + double* p= normalVectors_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsMesh::normalVectors(const std::vector& value) +{ + return normalVectors_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline std::vector CustomGraphicsMesh::vertexIndexList() const +{ + std::vector res; + size_t s; + + int* p= vertexIndexList_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsMesh::vertexIndexList(const std::vector& value) +{ + return vertexIndexList_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline std::vector CustomGraphicsMesh::normalIndexList() const +{ + std::vector res; + size_t s; + + int* p= normalIndexList_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsMesh::normalIndexList(const std::vector& value) +{ + return normalIndexList_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline std::vector CustomGraphicsMesh::textureCoordinates() const +{ + std::vector res; + size_t s; + + double* p= textureCoordinates_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsMesh::textureCoordinates(const std::vector& value) +{ + return textureCoordinates_raw(value.empty() ? NULL : &value[0], value.size()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSMESH_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsPointSet.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsPointSet.h new file mode 100644 index 0000000..8ea227a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsPointSet.h @@ -0,0 +1,148 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "CustomGraphicsEntity.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSPOINTSET_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSPOINTSET_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSPOINTSET_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSPOINTSET_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CustomGraphicsCoordinates; +}} + +namespace adsk { namespace fusion { + +/// Represents a set of one or more custom graphics points all of the same style. +class CustomGraphicsPointSet : public CustomGraphicsEntity { +public: + + /// Gets and sets the coordinates used to define the position of the custom graphics points. + /// If no indexList is specified, every coordinate will be drawn using a custom graphics point, + core::Ptr coordinates() const; + bool coordinates(const core::Ptr& value); + + /// An list of indices that specify which coordinates from the coordinate list to draw points for. + /// If this is an empty array, then all of the coordinates are used. + std::vector indexList() const; + bool indexList(const std::vector& value); + + /// Gets and sets the image that will be used to display the point if the point type + /// is a custom image. The image will always be be billboarded. The file should be + /// a png image and can use transparency. The filename can be a full path or a + /// relative path that is relative to your runtime file. Setting this will automatically + /// set the pointType to UserDefinedCustomGraphicsPointType. This property can also + /// return an empty string in the case where a user defined image point is not being used. + std::string pointImage() const; + bool pointImage(const std::string& value); + + /// Specifies which of the pre-defined point images to use. Attempting to set this property + /// to UserDefinedCustomGraphicsPointType will fail. To change to a user defined point type + /// you must set use the pointImage property to specify the image to use and this will have + /// the side-effect of changing the value of this property to UserDefinedCustomGraphicsPointType. + CustomGraphicsPointTypes pointType() const; + bool pointType(CustomGraphicsPointTypes value); + + ADSK_FUSION_CUSTOMGRAPHICSPOINTSET_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSPOINTSET_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSPOINTSET_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSPOINTSET_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual CustomGraphicsCoordinates* coordinates_raw() const = 0; + virtual bool coordinates_raw(CustomGraphicsCoordinates* value) = 0; + virtual int* indexList_raw(size_t& return_size) const = 0; + virtual bool indexList_raw(const int* value, size_t value_size) = 0; + virtual char* pointImage_raw() const = 0; + virtual bool pointImage_raw(const char * value) = 0; + virtual CustomGraphicsPointTypes pointType_raw() const = 0; + virtual bool pointType_raw(CustomGraphicsPointTypes value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsPointSet::coordinates() const +{ + core::Ptr res = coordinates_raw(); + return res; +} + +inline bool CustomGraphicsPointSet::coordinates(const core::Ptr& value) +{ + return coordinates_raw(value.get()); +} + +inline std::vector CustomGraphicsPointSet::indexList() const +{ + std::vector res; + size_t s; + + int* p= indexList_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsPointSet::indexList(const std::vector& value) +{ + return indexList_raw(value.empty() ? NULL : &value[0], value.size()); +} + +inline std::string CustomGraphicsPointSet::pointImage() const +{ + std::string res; + + char* p= pointImage_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsPointSet::pointImage(const std::string& value) +{ + return pointImage_raw(value.c_str()); +} + +inline CustomGraphicsPointTypes CustomGraphicsPointSet::pointType() const +{ + CustomGraphicsPointTypes res = pointType_raw(); + return res; +} + +inline bool CustomGraphicsPointSet::pointType(CustomGraphicsPointTypes value) +{ + return pointType_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSPOINTSET_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsShowThroughColorEffect.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsShowThroughColorEffect.h new file mode 100644 index 0000000..36321c4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsShowThroughColorEffect.h @@ -0,0 +1,109 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "CustomGraphicsColorEffect.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSSHOWTHROUGHCOLOREFFECT_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSSHOWTHROUGHCOLOREFFECT_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSSHOWTHROUGHCOLOREFFECT_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSSHOWTHROUGHCOLOREFFECT_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Color; +}} + +namespace adsk { namespace fusion { + +/// One of the types of color effects that can be applied to a custom graphics entity. With this +/// type of effect, the graphics entity will display using the specified color and will show through +/// other graphics that are in front of it. +class CustomGraphicsShowThroughColorEffect : public CustomGraphicsColorEffect { +public: + + /// Creates a new CustomGraphicsShowThroughColorEffect object that can be assigned to a custom graphics entity + /// using its showThrough property. + /// color : The color that will be used to render the custom graphics object. + /// opacity : The level of opacity that will be applied when rendering the the custom graphics object. A value of 0 is fully translucent + /// and will have the effect of the object being completely covered by objects in front of it. A value of 1 is fully opaque + /// which will have the effect of the object completely covering all objects. Values in between will make objects in front of + /// the graphics object appear translucent to varying degrees so you can see the custom graphics object through it. + /// Returns the newly created CustomGraphicsShowThroughColorEffect object or null in the case of failure. This can be assigned + /// to a custom graphics entity using its showThrough property. + static core::Ptr create(const core::Ptr& color, double opacity); + + /// Gets and sets the color associated with this CustomGraphicsShowThroughColorEffect object. The color that will be used to render + /// the portion of the entity that is covered by other objects in the scene. + core::Ptr color() const; + bool color(const core::Ptr& value); + + /// Gets and sets the opacity value associated with this CustomGraphicsShowThroughColorEffect object. The opacity is used when rendering + /// the portion of the entity that is covered by other objects in the scene. This can be a value between 0 and 1, where 1 is + /// fully opaque and will completely cover any other entities. + double opacity() const; + bool opacity(double value); + + ADSK_FUSION_CUSTOMGRAPHICSSHOWTHROUGHCOLOREFFECT_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSSHOWTHROUGHCOLOREFFECT_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSSHOWTHROUGHCOLOREFFECT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSSHOWTHROUGHCOLOREFFECT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_CUSTOMGRAPHICSSHOWTHROUGHCOLOREFFECT_API static CustomGraphicsShowThroughColorEffect* create_raw(core::Color* color, double opacity); + virtual core::Color* color_raw() const = 0; + virtual bool color_raw(core::Color* value) = 0; + virtual double opacity_raw() const = 0; + virtual bool opacity_raw(double value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsShowThroughColorEffect::create(const core::Ptr& color, double opacity) +{ + core::Ptr res = create_raw(color.get(), opacity); + return res; +} + +inline core::Ptr CustomGraphicsShowThroughColorEffect::color() const +{ + core::Ptr res = color_raw(); + return res; +} + +inline bool CustomGraphicsShowThroughColorEffect::color(const core::Ptr& value) +{ + return color_raw(value.get()); +} + +inline double CustomGraphicsShowThroughColorEffect::opacity() const +{ + double res = opacity_raw(); + return res; +} + +inline bool CustomGraphicsShowThroughColorEffect::opacity(double value) +{ + return opacity_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSSHOWTHROUGHCOLOREFFECT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsSolidColorEffect.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsSolidColorEffect.h new file mode 100644 index 0000000..752c1dc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsSolidColorEffect.h @@ -0,0 +1,89 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "CustomGraphicsColorEffect.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSSOLIDCOLOREFFECT_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSSOLIDCOLOREFFECT_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSSOLIDCOLOREFFECT_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSSOLIDCOLOREFFECT_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Color; +}} + +namespace adsk { namespace fusion { + +/// One of the types of color effects that can be applied to a custom graphics entity. With this +/// type of effect, the graphics entity will display as the single color without any lighting +/// effects. For example, a sphere will display as a solid filled circle without any shading +/// indicating it is actually spherical. +class CustomGraphicsSolidColorEffect : public CustomGraphicsColorEffect { +public: + + /// Statically creates a new CustomGraphicsSolidColorEffect object. This can be used as input + /// when creating various color related custom graphics attributes. A solid color effect, + /// colors the entity with a single color without any lighting effects. With this coloring + /// effect, a sphere will display as a solid filled circle. + /// color : The color to use for the solid color display. The opacity component of the color is ignored + /// because the opacity of custom graphics is controlled seperately using an opacity attribute. + /// Returns the created CustomGraphicsSolidColorEffect or null in case of a failure. + static core::Ptr create(const core::Ptr& color); + + /// The color to use for the solid color display. The opacity component of the color is ignored + /// because the opacity of custom graphics is controlled seperately using an opacity attribute. + core::Ptr color() const; + bool color(const core::Ptr& value); + + ADSK_FUSION_CUSTOMGRAPHICSSOLIDCOLOREFFECT_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSSOLIDCOLOREFFECT_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSSOLIDCOLOREFFECT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSSOLIDCOLOREFFECT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_CUSTOMGRAPHICSSOLIDCOLOREFFECT_API static CustomGraphicsSolidColorEffect* create_raw(core::Color* color); + virtual core::Color* color_raw() const = 0; + virtual bool color_raw(core::Color* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsSolidColorEffect::create(const core::Ptr& color) +{ + core::Ptr res = create_raw(color.get()); + return res; +} + +inline core::Ptr CustomGraphicsSolidColorEffect::color() const +{ + core::Ptr res = color_raw(); + return res; +} + +inline bool CustomGraphicsSolidColorEffect::color(const core::Ptr& value) +{ + return color_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSSOLIDCOLOREFFECT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsText.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsText.h new file mode 100644 index 0000000..d719db6 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsText.h @@ -0,0 +1,213 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "CustomGraphicsEntity.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSTEXT_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSTEXT_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSTEXT_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSTEXT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Represents text drawn in the graphics window. The default position of the text is at (0,0,0) and +/// orientation is the text lying on the x-y plane. To reposition and reorient the text you can use +/// the transformation property. +class CustomGraphicsText : public CustomGraphicsEntity { +public: + + /// Gets and sets the formatted text definition. This is the full string, including the + /// formatting information, that's used to define the displayed text. + std::string formattedText() const; + bool formattedText(const std::string& value); + + /// Gets and sets the font used to display the text. This is the default font and applies to + /// all of text unless there is a font override defined within the text. + std::string font() const; + bool font(const std::string& value); + + /// Specifies that the text displays using an italic style. This is the default italic style and applies to + /// all of text unless there is a style override defined within the text. + bool isItalic() const; + bool isItalic(bool value); + + /// Specifies that the text displays using a bold style. This is the default bold style and applies to + /// all of text unless there is a style override defined within the text. + bool isBold() const; + bool isBold(bool value); + + /// Specifies that the text displays using an underline style. This is the default underline style and applies to + /// all of text unless there is a style override defined within the text. + bool isUnderline() const; + bool isUnderline(bool value); + + /// Specifies that the text displays using a strike through style. This is the default strike through style and applies to + /// all of text unless there is a style override defined within the text. + bool isStrikeThrough() const; + bool isStrikeThrough(bool value); + + /// Gets and sets the size of the text in centimeters. This is the default size and applies to + /// all of text unless there is a size override defined within the text. + double size() const; + bool size(double value); + + /// The actual width of the text in centimeters. This is useful when you want to position several + /// GraphicsText objects together. + double width() const; + + /// The actual height of the text in centimeters. This is useful when you want to position several + /// GraphicsText objects together. + double height() const; + + ADSK_FUSION_CUSTOMGRAPHICSTEXT_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSTEXT_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSTEXT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSTEXT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* formattedText_raw() const = 0; + virtual bool formattedText_raw(const char * value) = 0; + virtual char* font_raw() const = 0; + virtual bool font_raw(const char * value) = 0; + virtual bool isItalic_raw() const = 0; + virtual bool isItalic_raw(bool value) = 0; + virtual bool isBold_raw() const = 0; + virtual bool isBold_raw(bool value) = 0; + virtual bool isUnderline_raw() const = 0; + virtual bool isUnderline_raw(bool value) = 0; + virtual bool isStrikeThrough_raw() const = 0; + virtual bool isStrikeThrough_raw(bool value) = 0; + virtual double size_raw() const = 0; + virtual bool size_raw(double value) = 0; + virtual double width_raw() const = 0; + virtual double height_raw() const = 0; +}; + +// Inline wrappers + +inline std::string CustomGraphicsText::formattedText() const +{ + std::string res; + + char* p= formattedText_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsText::formattedText(const std::string& value) +{ + return formattedText_raw(value.c_str()); +} + +inline std::string CustomGraphicsText::font() const +{ + std::string res; + + char* p= font_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool CustomGraphicsText::font(const std::string& value) +{ + return font_raw(value.c_str()); +} + +inline bool CustomGraphicsText::isItalic() const +{ + bool res = isItalic_raw(); + return res; +} + +inline bool CustomGraphicsText::isItalic(bool value) +{ + return isItalic_raw(value); +} + +inline bool CustomGraphicsText::isBold() const +{ + bool res = isBold_raw(); + return res; +} + +inline bool CustomGraphicsText::isBold(bool value) +{ + return isBold_raw(value); +} + +inline bool CustomGraphicsText::isUnderline() const +{ + bool res = isUnderline_raw(); + return res; +} + +inline bool CustomGraphicsText::isUnderline(bool value) +{ + return isUnderline_raw(value); +} + +inline bool CustomGraphicsText::isStrikeThrough() const +{ + bool res = isStrikeThrough_raw(); + return res; +} + +inline bool CustomGraphicsText::isStrikeThrough(bool value) +{ + return isStrikeThrough_raw(value); +} + +inline double CustomGraphicsText::size() const +{ + double res = size_raw(); + return res; +} + +inline bool CustomGraphicsText::size(double value) +{ + return size_raw(value); +} + +inline double CustomGraphicsText::width() const +{ + double res = width_raw(); + return res; +} + +inline double CustomGraphicsText::height() const +{ + double res = height_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSTEXT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsVertexColorEffect.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsVertexColorEffect.h new file mode 100644 index 0000000..cb67182 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsVertexColorEffect.h @@ -0,0 +1,61 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "CustomGraphicsColorEffect.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSVERTEXCOLOREFFECT_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSVERTEXCOLOREFFECT_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSVERTEXCOLOREFFECT_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSVERTEXCOLOREFFECT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// One of the types of color effects that can be applied to a custom graphics entity. With this +/// type of effect, the graphics entity will display using the colors associated with the vertices +/// of the mesh in the CustomGraphicsCoordinates object. +class CustomGraphicsVertexColorEffect : public CustomGraphicsColorEffect { +public: + + /// Statically creates a new CustomGraphicsVertexColorEffect object. + /// Returns the created CustomGraphicsVertexColorEffect or null in case of a failure. + static core::Ptr create(); + + ADSK_FUSION_CUSTOMGRAPHICSVERTEXCOLOREFFECT_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSVERTEXCOLOREFFECT_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSVERTEXCOLOREFFECT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSVERTEXCOLOREFFECT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_CUSTOMGRAPHICSVERTEXCOLOREFFECT_API static CustomGraphicsVertexColorEffect* create_raw(); +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsVertexColorEffect::create() +{ + core::Ptr res = create_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSVERTEXCOLOREFFECT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsViewPlacement.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsViewPlacement.h new file mode 100644 index 0000000..d5d0348 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsViewPlacement.h @@ -0,0 +1,139 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSVIEWPLACEMENT_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSVIEWPLACEMENT_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSVIEWPLACEMENT_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSVIEWPLACEMENT_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Point2D; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// Positions custom graphics relative to one of the four corners of the view. Graphics positioned +/// this way will always appear on top of the model graphics. This is typically used to display +/// legends are small interactive tools. +class CustomGraphicsViewPlacement : public core::Base { +public: + + /// Creates a new CustomGraphicsViewPlacement object that can be used when setting the viewPlacement property + /// of a custom graphics entity to specify the billboarding behavior. + /// anchorPoint : The position within the defined graphics that will serve as the anchor. This is the location + /// on the graphics that will be positioned at the specified view point. + /// viewCorner : Defines which of the four corners of the view the graphics are drawn relative to. + /// viewPoint : A 2D point in the view that defines the position of the graphics. This is relative to the corner + /// and is in pixels. The x and y directions vary for each of the corners. These directions are only + /// used to position the 2D point and do not affect the standard coordinate system the graphics were + /// drawn in. + /// upperLeftViewCorner - The x direction is to the right and y is down. + /// upperRightViewCorner - The x direction is to the left and y is down. + /// lowerLeftViewCorner - The x direction is to the right and y is up. + /// lowerRightViewCorner - The x direction is to the left and y is up. + /// Returns the newly created CustomGraphicsViewPlacement object or null in the case of failure. This can then + /// be assigned to any custom graphics entity using its viewPlacement property. + static core::Ptr create(const core::Ptr& anchorPoint, ViewCorners viewCorner, const core::Ptr& viewPoint); + + /// Gets and sets the position within the defined graphics that serves as the anchor. This is the location + /// on the graphics that is positioned at the specified view point. + core::Ptr anchorPoint() const; + bool anchorPoint(const core::Ptr& value); + + /// A 2D point in the view that defines the position of the graphics. This is relative to the corner + /// and is in pixels. The x and y directions vary for each of the corners. These directions are only + /// used to position the 2D point and do not affect the standard coordinate system the graphics were + /// drawn in. + /// upperLeftViewCorner - The x direction is to the right and y is down. + /// upperRightViewCorner - The x direction is to the left and y is down. + /// lowerLeftViewCorner - The x direction is to the right and y is up. + /// lowerRightViewCorner - The x direction is to the left and y is up. + core::Ptr viewPoint() const; + bool viewPoint(const core::Ptr& value); + + /// Gets and sets which corner the graphics are positioned relative to. + ViewCorners viewCorner() const; + bool viewCorner(ViewCorners value); + + ADSK_FUSION_CUSTOMGRAPHICSVIEWPLACEMENT_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSVIEWPLACEMENT_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSVIEWPLACEMENT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSVIEWPLACEMENT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_CUSTOMGRAPHICSVIEWPLACEMENT_API static CustomGraphicsViewPlacement* create_raw(core::Point3D* anchorPoint, ViewCorners viewCorner, core::Point2D* viewPoint); + virtual core::Point3D* anchorPoint_raw() const = 0; + virtual bool anchorPoint_raw(core::Point3D* value) = 0; + virtual core::Point2D* viewPoint_raw() const = 0; + virtual bool viewPoint_raw(core::Point2D* value) = 0; + virtual ViewCorners viewCorner_raw() const = 0; + virtual bool viewCorner_raw(ViewCorners value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsViewPlacement::create(const core::Ptr& anchorPoint, ViewCorners viewCorner, const core::Ptr& viewPoint) +{ + core::Ptr res = create_raw(anchorPoint.get(), viewCorner, viewPoint.get()); + return res; +} + +inline core::Ptr CustomGraphicsViewPlacement::anchorPoint() const +{ + core::Ptr res = anchorPoint_raw(); + return res; +} + +inline bool CustomGraphicsViewPlacement::anchorPoint(const core::Ptr& value) +{ + return anchorPoint_raw(value.get()); +} + +inline core::Ptr CustomGraphicsViewPlacement::viewPoint() const +{ + core::Ptr res = viewPoint_raw(); + return res; +} + +inline bool CustomGraphicsViewPlacement::viewPoint(const core::Ptr& value) +{ + return viewPoint_raw(value.get()); +} + +inline ViewCorners CustomGraphicsViewPlacement::viewCorner() const +{ + ViewCorners res = viewCorner_raw(); + return res; +} + +inline bool CustomGraphicsViewPlacement::viewCorner(ViewCorners value) +{ + return viewCorner_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSVIEWPLACEMENT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsViewScale.h b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsViewScale.h new file mode 100644 index 0000000..686ad59 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Graphics/CustomGraphicsViewScale.h @@ -0,0 +1,111 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CUSTOMGRAPHICSVIEWSCALE_CPP__ +# define ADSK_FUSION_CUSTOMGRAPHICSVIEWSCALE_API XI_EXPORT +# else +# define ADSK_FUSION_CUSTOMGRAPHICSVIEWSCALE_API +# endif +#else +# define ADSK_FUSION_CUSTOMGRAPHICSVIEWSCALE_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// Specifies that custom graphics are to be scaled relative to the view (pixels) and not model space. +/// If this is applied to some custom graphics then they will stat the same size on the screen regardless +/// of the user zooming in or out. This is commonly used for glyphs and other interactive widgets so they don't +/// don't get too large or too small. +class CustomGraphicsViewScale : public core::Base { +public: + + /// Creates a new CustomGraphicsViewScale object that can be used when setting the viewScale property + /// of a custom graphics entity to specify the scaling behavior. + /// pixelScale : Defines the scale of the custom graphics relative to the view. If a custom graphics line is defined + /// to be 100 units long it would usually display as 100 cm long. When it is view scaled with a pixel scale of + /// 1 it will display as 100 pixels long. + /// anchorPoint : Defines the point in the graphics that defines the origin of the scaling. The graphics will be scaled + /// up or down relative to that point. + /// Returns the newly created CustomGraphicsViewScale object or null in the case of failure. This can then + /// be assigned to any custom graphics entity using its viewScale property. + static core::Ptr create(double pixelScale, const core::Ptr& anchorPoint); + + /// Gets and sets the scale of the custom graphics relative to the view. If a custom graphics line is defined + /// to be 100 units long it would usually display as 100 cm long. When it is view scaled with a pixel scale of + /// 1 it will display as 100 pixels long. + double pixelScale() const; + bool pixelScale(double value); + + /// Gets and sets the point in the graphics that defines the origin of the scaling. The graphics will be scaled + /// up or down relative to that point. + core::Ptr anchorPoint() const; + bool anchorPoint(const core::Ptr& value); + + ADSK_FUSION_CUSTOMGRAPHICSVIEWSCALE_API static const char* classType(); + ADSK_FUSION_CUSTOMGRAPHICSVIEWSCALE_API const char* objectType() const override; + ADSK_FUSION_CUSTOMGRAPHICSVIEWSCALE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CUSTOMGRAPHICSVIEWSCALE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + ADSK_FUSION_CUSTOMGRAPHICSVIEWSCALE_API static CustomGraphicsViewScale* create_raw(double pixelScale, core::Point3D* anchorPoint); + virtual double pixelScale_raw() const = 0; + virtual bool pixelScale_raw(double value) = 0; + virtual core::Point3D* anchorPoint_raw() const = 0; + virtual bool anchorPoint_raw(core::Point3D* value) = 0; +}; + +// Inline wrappers + +inline core::Ptr CustomGraphicsViewScale::create(double pixelScale, const core::Ptr& anchorPoint) +{ + core::Ptr res = create_raw(pixelScale, anchorPoint.get()); + return res; +} + +inline double CustomGraphicsViewScale::pixelScale() const +{ + double res = pixelScale_raw(); + return res; +} + +inline bool CustomGraphicsViewScale::pixelScale(double value) +{ + return pixelScale_raw(value); +} + +inline core::Ptr CustomGraphicsViewScale::anchorPoint() const +{ + core::Ptr res = anchorPoint_raw(); + return res; +} + +inline bool CustomGraphicsViewScale::anchorPoint(const core::Ptr& value) +{ + return anchorPoint_raw(value.get()); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CUSTOMGRAPHICSVIEWSCALE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/MeshBody/MeshBodies.h b/usr/autodesk/CPP/include/Fusion/MeshBody/MeshBodies.h new file mode 100644 index 0000000..867d411 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/MeshBody/MeshBodies.h @@ -0,0 +1,135 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MESHBODIES_CPP__ +# define ADSK_FUSION_MESHBODIES_API XI_EXPORT +# else +# define ADSK_FUSION_MESHBODIES_API +# endif +#else +# define ADSK_FUSION_MESHBODIES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class MeshBody; + class MeshBodyList; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the MeshBodies in the parent Component and +/// supports the creation of new mesh bodies. +class MeshBodies : public core::Base { +public: + + /// Creates a new mesh body by importing an .stl, .obj or .3mf file. + /// Because of a current limitation, if you want to create a mesh body in a parametric model, + /// you must first call the edit method of the base or form feature, use this method to create + /// the mesh body, and then call the finishEdit method of the base or form feature. The base + /// or form feature must be in an "edit" state to be able to add any additional items to it. + /// fullFilename : The full filename (path and file) of a .stl, .obj or .3mf file. + /// units : The units to use when importing the file. + /// baseOrFormFeature : The BaseFeature or FormFeature object that this mesh body will be associated with. This is an optional + /// requirement and is required when the model design history is being captured (parametric model) but is + /// ignored otherwise (direct edit model). + /// Returns a list of the newly created mesh bodies or null if the creation failed. Multiple + /// bodies can be created in the case where a .obj file that contains multiple bodies was imported. + /// STL files always contain a single body. + core::Ptr add(const std::string& fullFilename, MeshUnits units, const core::Ptr& baseOrFormFeature = NULL); + + /// Provides access to a mesh body within the collection. + /// index : The index of the mesh body to return, where an index of 0 is the first mesh body in the collection. + /// Returns the specified mesh body or null in the case of a invalid index. + core::Ptr item(size_t index) const; + + /// Returns the number of mesh bodies in the collection. + size_t count() const; + + /// Creates a new mesh body using the mesh description provided. + /// coordinates : Input array of doubles that defines the X, Y, Z coordinates of each node in the mesh. Each set of three numbers define + /// the coordinates of a node. + /// coordinateIndexList : An array of integers that represent indices into the coordinates to define the vertices of the triangles. If an empty + /// array is provided, then it's assumed that the first three coordinates defines the first triangle, the next three define + /// the second triangle, and so on. + /// normalVectors : An array of doubles that represent the x, y, z components of the normals at each coordinate. There should be a normal defined + /// for each coordinate. If an empty array is provided for the normal vectors, Fusion 360 will automatically calculate normal vectors + /// that are 90 degrees to the face of the triangle, making it appear flat. + /// normalIndexList : An array of integers that represent indices into the normal vectors to define the which vector corresponds to which vertex. This + /// should be the same size as the vertex index list. If an empty array is input and normal vectors are provided, it is assumed that + /// the normals match up one-to-one to each coordinate. + /// Returns the newly created MeshBody object or null in the case of a failure. + core::Ptr addByTriangleMeshData(const std::vector& coordinates, const std::vector& coordinateIndexList, const std::vector& normalVectors, const std::vector& normalIndexList); + + typedef MeshBody iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_MESHBODIES_API static const char* classType(); + ADSK_FUSION_MESHBODIES_API const char* objectType() const override; + ADSK_FUSION_MESHBODIES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MESHBODIES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual MeshBodyList* add_raw(const char * fullFilename, MeshUnits units, core::Base* baseOrFormFeature) = 0; + virtual MeshBody* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual MeshBody* addByTriangleMeshData_raw(const double* coordinates, size_t coordinates_size, const int* coordinateIndexList, size_t coordinateIndexList_size, const double* normalVectors, size_t normalVectors_size, const int* normalIndexList, size_t normalIndexList_size) = 0; +}; + +// Inline wrappers + +inline core::Ptr MeshBodies::add(const std::string& fullFilename, MeshUnits units, const core::Ptr& baseOrFormFeature) +{ + core::Ptr res = add_raw(fullFilename.c_str(), units, baseOrFormFeature.get()); + return res; +} + +inline core::Ptr MeshBodies::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t MeshBodies::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr MeshBodies::addByTriangleMeshData(const std::vector& coordinates, const std::vector& coordinateIndexList, const std::vector& normalVectors, const std::vector& normalIndexList) +{ + core::Ptr res = addByTriangleMeshData_raw(coordinates.empty() ? NULL : &coordinates[0], coordinates.size(), coordinateIndexList.empty() ? NULL : &coordinateIndexList[0], coordinateIndexList.size(), normalVectors.empty() ? NULL : &normalVectors[0], normalVectors.size(), normalIndexList.empty() ? NULL : &normalIndexList[0], normalIndexList.size()); + return res; +} + +template inline void MeshBodies::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MESHBODIES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/MeshBody/MeshBody.h b/usr/autodesk/CPP/include/Fusion/MeshBody/MeshBody.h new file mode 100644 index 0000000..37a8a47 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/MeshBody/MeshBody.h @@ -0,0 +1,346 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/CoreTypeDefs.h" +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MESHBODY_CPP__ +# define ADSK_FUSION_MESHBODY_API XI_EXPORT +# else +# define ADSK_FUSION_MESHBODY_API +# endif +#else +# define ADSK_FUSION_MESHBODY_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Component; + class Occurrence; + class PolygonMesh; + class TriangleMesh; +}} +namespace adsk { namespace core { + class Appearance; + class Attributes; + class Material; +}} + +namespace adsk { namespace fusion { + +/// Provides access to a mesh body. +class MeshBody : public core::Base { +public: + + /// Gets and sets the name of the mesh body as displayed in the browser. + std::string name() const; + bool name(const std::string& value); + + /// Gets and sets if the mesh body is selectable in the graphics window. + bool isSelectable() const; + bool isSelectable(bool value); + + /// Is the light bulb (as displayed in the browser) on. + /// A mesh body will only be visible if the light bulb is switched on. However, + /// the light bulb can be on and the mesh body is still invisible if the light bulb + /// for all bodies or the owning component is off. + bool isLightBulbOn() const; + bool isLightBulbOn(bool value); + + /// Gets if the mesh body point is visible. + bool isVisible() const; + + /// Deletes the mesh body. + /// Returns true in the case where the selection was successful. + bool deleteMe(); + + /// Returns the original mesh data that was imported. This can include triangles, quads, and polygons. + core::Ptr mesh() const; + + /// Returns the associated mesh that is used for the display. This will always be triangles and includes any textures. + core::Ptr displayMesh() const; + + /// Returns the parent Component. + core::Ptr parentComponent() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// Fails if this object is not the NativeObject. + /// occurrence : The occurrence that represents the context you want to create this proxy in. + /// Returns the proxy for the occurrence in the context of the specified occurrence. Returns null if it failed. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// This property returns the base or form feature that this mesh body is associated with. It + /// returns null in the case where the modeling design history is not being captured (direct edit model). + core::Ptr baseOrFormFeature() const; + + /// Returns the collection of attributes associated with this mesh body. + core::Ptr attributes() const; + + /// Gets and sets the physical material assigned to this mesh body. + core::Ptr material() const; + bool material(const core::Ptr& value); + + /// Read-write property that gets and sets the current appearance of the body. Setting this property will result in applying + /// an override appearance to the body and the AppearanceSourceType property will return OverrideAppearanceSource. Setting + /// this property to null will remove any override. + core::Ptr appearance() const; + bool appearance(const core::Ptr& value); + + /// Read-write property that gets the source of the appearance for the body. If this returns OverrideAppearanceSource, an override exists + /// on this body. The override can be removed by setting the Appearance property to null. + core::AppearanceSourceTypes appearanceSourceType() const; + + /// Gets and sets the opacity override assigned to this body. A value of 1.0 specifies + /// that is it completely opaque and a value of 0.0 specifies that is it completely transparent. + /// This value is not necessarily related to what the user sees because the opacity is inherited. + /// For example, if you this body is in a component and that component's opacity is set to something + /// other than 1.0, the body will also be shown as slightly transparent even though the opacity + /// property for the body will return 1.0. Because the component that contains the body can be + /// referenced as an occurrence in other components and they can have different opacity settings, + /// it's possible that different instances of the same body can display using different opacity levels. + /// To get the opacity that it is being displayed with use the MeshBody.visibleOpacity property. + /// This is the API equivalent of the "Opacity Control" command available for the body in the browser. + double opacity() const; + bool opacity(double value); + + /// The user can set an override opacity for components and bodies these opacity overrides combine if + /// children and parent components have overrides. This property returns the actual opacity that is + /// being used to render the body. To set the opacity use the opacity property of the MeshBody object. + double visibleOpacity() const; + + /// Returns a token for the MeshBody object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same mesh body. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_MESHBODY_API static const char* classType(); + ADSK_FUSION_MESHBODY_API const char* objectType() const override; + ADSK_FUSION_MESHBODY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MESHBODY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual bool isSelectable_raw() const = 0; + virtual bool isSelectable_raw(bool value) = 0; + virtual bool isLightBulbOn_raw() const = 0; + virtual bool isLightBulbOn_raw(bool value) = 0; + virtual bool isVisible_raw() const = 0; + virtual bool deleteMe_raw() = 0; + virtual PolygonMesh* mesh_raw() const = 0; + virtual TriangleMesh* displayMesh_raw() const = 0; + virtual Component* parentComponent_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual MeshBody* nativeObject_raw() const = 0; + virtual MeshBody* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual core::Base* baseOrFormFeature_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual core::Material* material_raw() const = 0; + virtual bool material_raw(core::Material* value) = 0; + virtual core::Appearance* appearance_raw() const = 0; + virtual bool appearance_raw(core::Appearance* value) = 0; + virtual core::AppearanceSourceTypes appearanceSourceType_raw() const = 0; + virtual double opacity_raw() const = 0; + virtual bool opacity_raw(double value) = 0; + virtual double visibleOpacity_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline std::string MeshBody::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool MeshBody::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline bool MeshBody::isSelectable() const +{ + bool res = isSelectable_raw(); + return res; +} + +inline bool MeshBody::isSelectable(bool value) +{ + return isSelectable_raw(value); +} + +inline bool MeshBody::isLightBulbOn() const +{ + bool res = isLightBulbOn_raw(); + return res; +} + +inline bool MeshBody::isLightBulbOn(bool value) +{ + return isLightBulbOn_raw(value); +} + +inline bool MeshBody::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline bool MeshBody::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline core::Ptr MeshBody::mesh() const +{ + core::Ptr res = mesh_raw(); + return res; +} + +inline core::Ptr MeshBody::displayMesh() const +{ + core::Ptr res = displayMesh_raw(); + return res; +} + +inline core::Ptr MeshBody::parentComponent() const +{ + core::Ptr res = parentComponent_raw(); + return res; +} + +inline core::Ptr MeshBody::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr MeshBody::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr MeshBody::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr MeshBody::baseOrFormFeature() const +{ + core::Ptr res = baseOrFormFeature_raw(); + return res; +} + +inline core::Ptr MeshBody::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline core::Ptr MeshBody::material() const +{ + core::Ptr res = material_raw(); + return res; +} + +inline bool MeshBody::material(const core::Ptr& value) +{ + return material_raw(value.get()); +} + +inline core::Ptr MeshBody::appearance() const +{ + core::Ptr res = appearance_raw(); + return res; +} + +inline bool MeshBody::appearance(const core::Ptr& value) +{ + return appearance_raw(value.get()); +} + +inline core::AppearanceSourceTypes MeshBody::appearanceSourceType() const +{ + core::AppearanceSourceTypes res = appearanceSourceType_raw(); + return res; +} + +inline double MeshBody::opacity() const +{ + double res = opacity_raw(); + return res; +} + +inline bool MeshBody::opacity(double value) +{ + return opacity_raw(value); +} + +inline double MeshBody::visibleOpacity() const +{ + double res = visibleOpacity_raw(); + return res; +} + +inline std::string MeshBody::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MESHBODY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/MeshBody/MeshBodyList.h b/usr/autodesk/CPP/include/Fusion/MeshBody/MeshBodyList.h new file mode 100644 index 0000000..653772e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/MeshBody/MeshBodyList.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MESHBODYLIST_CPP__ +# define ADSK_FUSION_MESHBODYLIST_API XI_EXPORT +# else +# define ADSK_FUSION_MESHBODYLIST_API +# endif +#else +# define ADSK_FUSION_MESHBODYLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class MeshBody; +}} + +namespace adsk { namespace fusion { + +/// Provides access to a list of MeshBody objects. +class MeshBodyList : public core::Base { +public: + + /// Provides access to a mesh body within the collection. + /// index : The index of the mesh body to return, where an index of 0 is the first mesh body in the collection. + /// Returns the specified mesh body or null in the case of a invalid index. + core::Ptr item(size_t index) const; + + /// Returns the number of mesh bodies in the collection. + size_t count() const; + + typedef MeshBody iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_MESHBODYLIST_API static const char* classType(); + ADSK_FUSION_MESHBODYLIST_API const char* objectType() const override; + ADSK_FUSION_MESHBODYLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MESHBODYLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual MeshBody* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr MeshBodyList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t MeshBodyList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void MeshBodyList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MESHBODYLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/MeshData/MeshManager.h b/usr/autodesk/CPP/include/Fusion/MeshData/MeshManager.h new file mode 100644 index 0000000..6a3d856 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/MeshData/MeshManager.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MESHMANAGER_CPP__ +# define ADSK_FUSION_MESHMANAGER_API XI_EXPORT +# else +# define ADSK_FUSION_MESHMANAGER_API +# endif +#else +# define ADSK_FUSION_MESHMANAGER_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TriangleMeshCalculator; + class TriangleMeshList; +}} + +namespace adsk { namespace fusion { + +/// Provides access to meshes that approximate a B-Rep and T-Spline. +class MeshManager : public core::Base { +public: + + /// Creates a new MeshCalculator which is used to calculate + /// new triangular meshes based on various parameters that control the calculation. + /// Returns the new MeshCalculator object or null if the creation failed. + core::Ptr createMeshCalculator(); + + /// Returns a collection that provides access to all of the + /// existing display meshes. + core::Ptr displayMeshes() const; + + /// Returns the parent BRepBody, BRepFace, BRepLump, BRepShell, SculptBody, or SculptFace object. + core::Ptr parent() const; + + ADSK_FUSION_MESHMANAGER_API static const char* classType(); + ADSK_FUSION_MESHMANAGER_API const char* objectType() const override; + ADSK_FUSION_MESHMANAGER_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MESHMANAGER_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual TriangleMeshCalculator* createMeshCalculator_raw() = 0; + virtual TriangleMeshList* displayMeshes_raw() const = 0; + virtual core::Base* parent_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr MeshManager::createMeshCalculator() +{ + core::Ptr res = createMeshCalculator_raw(); + return res; +} + +inline core::Ptr MeshManager::displayMeshes() const +{ + core::Ptr res = displayMeshes_raw(); + return res; +} + +inline core::Ptr MeshManager::parent() const +{ + core::Ptr res = parent_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MESHMANAGER_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/MeshData/PolygonMesh.h b/usr/autodesk/CPP/include/Fusion/MeshData/PolygonMesh.h new file mode 100644 index 0000000..852741d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/MeshData/PolygonMesh.h @@ -0,0 +1,286 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_POLYGONMESH_CPP__ +# define ADSK_FUSION_POLYGONMESH_API XI_EXPORT +# else +# define ADSK_FUSION_POLYGONMESH_API +# endif +#else +# define ADSK_FUSION_POLYGONMESH_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Point3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// The PolygonMesh represents a mesh that can contain any +/// combination of polygons, quads, and triangles. +class PolygonMesh : public core::Base { +public: + + /// Returns the number of nodes in the mesh. + int nodeCount() const; + + /// Returns the node coordinates as an array of doubles where + /// they are the x, y, z components of each coordinate. + std::vector nodeCoordinatesAsDouble() const; + + /// Returns the node coordinates as an array of floats where + /// they are the x, y, z components of each coordinate. + std::vector nodeCoordinatesAsFloat() const; + + /// Returns the node coordinates as an array of Point3D objects. + std::vector> nodeCoordinates() const; + + /// Returns the number of triangles in the mesh. + int triangleCount() const; + + /// Returns the number of quads in the mesh. + int quadCount() const; + + /// Returns the number of polygons (more than 4 sides) in the mesh. + int polygonCount() const; + + /// Returns the normal vectors as an array of doubles where + /// they are the x, y, z components of each vector. There is one normal vector for each index. + std::vector normalVectorsAsDouble() const; + + /// Returns the normal vectors as an array of floats. There is one normal vector for each index. + std::vector normalVectorsAsFloat() const; + + /// Returns the normal vectors as an array of Vector 3D objects. There is one normal vector for each index. + std::vector> normalVectors() const; + + /// Returns the index values that index into the NodeCoordinates and NormalVectors arrays to + /// define the three coordinates of each triangle and the corresponding normal. + std::vector triangleNodeIndices() const; + + /// Returns the index values that index into the NodeCoordinates and NormalVectors arrays to + /// define the four coordinates of each quad and the corresponding normal. + std::vector quadNodeIndices() const; + + /// Returns the index values that index into the NodeCoordinates and NormalVectors arrays to + /// define the coordinates of each polygon and the corresponding normal. + std::vector polygonNodeIndices() const; + + /// Returns the number of nodes that define each polygon. For example, + /// if NodeCountPerPolygon[0] returns 6 it indicates the first polygon + /// is defined using 6 nodes. The first six indices returned by the + /// PolygonNodeIndices properties provide the look-up into the NodeCoordinates + /// array. + std::vector nodeCountPerPolygon() const; + + ADSK_FUSION_POLYGONMESH_API static const char* classType(); + ADSK_FUSION_POLYGONMESH_API const char* objectType() const override; + ADSK_FUSION_POLYGONMESH_API void* queryInterface(const char* id) const override; + ADSK_FUSION_POLYGONMESH_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual int nodeCount_raw() const = 0; + virtual double* nodeCoordinatesAsDouble_raw(size_t& return_size) const = 0; + virtual float* nodeCoordinatesAsFloat_raw(size_t& return_size) const = 0; + virtual core::Point3D** nodeCoordinates_raw(size_t& return_size) const = 0; + virtual int triangleCount_raw() const = 0; + virtual int quadCount_raw() const = 0; + virtual int polygonCount_raw() const = 0; + virtual double* normalVectorsAsDouble_raw(size_t& return_size) const = 0; + virtual float* normalVectorsAsFloat_raw(size_t& return_size) const = 0; + virtual core::Vector3D** normalVectors_raw(size_t& return_size) const = 0; + virtual int* triangleNodeIndices_raw(size_t& return_size) const = 0; + virtual int* quadNodeIndices_raw(size_t& return_size) const = 0; + virtual int* polygonNodeIndices_raw(size_t& return_size) const = 0; + virtual int* nodeCountPerPolygon_raw(size_t& return_size) const = 0; +}; + +// Inline wrappers + +inline int PolygonMesh::nodeCount() const +{ + int res = nodeCount_raw(); + return res; +} + +inline std::vector PolygonMesh::nodeCoordinatesAsDouble() const +{ + std::vector res; + size_t s; + + double* p= nodeCoordinatesAsDouble_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector PolygonMesh::nodeCoordinatesAsFloat() const +{ + std::vector res; + size_t s; + + float* p= nodeCoordinatesAsFloat_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> PolygonMesh::nodeCoordinates() const +{ + std::vector> res; + size_t s; + + core::Point3D** p= nodeCoordinates_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline int PolygonMesh::triangleCount() const +{ + int res = triangleCount_raw(); + return res; +} + +inline int PolygonMesh::quadCount() const +{ + int res = quadCount_raw(); + return res; +} + +inline int PolygonMesh::polygonCount() const +{ + int res = polygonCount_raw(); + return res; +} + +inline std::vector PolygonMesh::normalVectorsAsDouble() const +{ + std::vector res; + size_t s; + + double* p= normalVectorsAsDouble_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector PolygonMesh::normalVectorsAsFloat() const +{ + std::vector res; + size_t s; + + float* p= normalVectorsAsFloat_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> PolygonMesh::normalVectors() const +{ + std::vector> res; + size_t s; + + core::Vector3D** p= normalVectors_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector PolygonMesh::triangleNodeIndices() const +{ + std::vector res; + size_t s; + + int* p= triangleNodeIndices_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector PolygonMesh::quadNodeIndices() const +{ + std::vector res; + size_t s; + + int* p= quadNodeIndices_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector PolygonMesh::polygonNodeIndices() const +{ + std::vector res; + size_t s; + + int* p= polygonNodeIndices_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector PolygonMesh::nodeCountPerPolygon() const +{ + std::vector res; + size_t s; + + int* p= nodeCountPerPolygon_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_POLYGONMESH_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/MeshData/TextureImage.h b/usr/autodesk/CPP/include/Fusion/MeshData/TextureImage.h new file mode 100644 index 0000000..a0f7dc8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/MeshData/TextureImage.h @@ -0,0 +1,63 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TEXTUREIMAGE_CPP__ +# define ADSK_FUSION_TEXTUREIMAGE_API XI_EXPORT +# else +# define ADSK_FUSION_TEXTUREIMAGE_API +# endif +#else +# define ADSK_FUSION_TEXTUREIMAGE_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Matrix2D; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the image data associated with a texture map. +class TextureImage : public core::Base { +public: + + /// The transform of the texture image in parametric space. + core::Ptr transform() const; + + ADSK_FUSION_TEXTUREIMAGE_API static const char* classType(); + ADSK_FUSION_TEXTUREIMAGE_API const char* objectType() const override; + ADSK_FUSION_TEXTUREIMAGE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TEXTUREIMAGE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Matrix2D* transform_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr TextureImage::transform() const +{ + core::Ptr res = transform_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TEXTUREIMAGE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/MeshData/TriangleMesh.h b/usr/autodesk/CPP/include/Fusion/MeshData/TriangleMesh.h new file mode 100644 index 0000000..8548e23 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/MeshData/TriangleMesh.h @@ -0,0 +1,291 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TRIANGLEMESH_CPP__ +# define ADSK_FUSION_TRIANGLEMESH_API XI_EXPORT +# else +# define ADSK_FUSION_TRIANGLEMESH_API +# endif +#else +# define ADSK_FUSION_TRIANGLEMESH_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class Point2D; + class Point3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// The TriangleMesh object represents all of the data defining +/// a triangular mesh. +class TriangleMesh : public core::Base { +public: + + /// Returns the total number of nodes in the mesh. + int nodeCount() const; + + /// Returns the node coordinates as an array of doubles where + /// they are the x, y, z components of each coordinate. + std::vector nodeCoordinatesAsDouble() const; + + /// Returns the node coordinates as an array of floats where + /// they are the x, y, z components of each coordinate. + std::vector nodeCoordinatesAsFloat() const; + + /// Returns the node coordinates as an array of Point3D objects. + std::vector> nodeCoordinates() const; + + /// Returns the number of triangles in the mesh. + int triangleCount() const; + + /// Returns the normal vectors of the mesh where there is a normal + /// vector at each node. The normals are returned as an array + /// of doubles where they are the x, y, z components of each vector. + std::vector normalVectorsAsDouble() const; + + /// Returns the normal vectors of the mesh where there is a normal + /// vector at each node. The normals are returned as an array + /// of floats where they are the x, y, z components of each vector. + std::vector normalVectorsAsFloat() const; + + /// Returns the normal vectors of the mesh where there is a normal + /// vector at each node. The normals are returned as an array + /// of Vector3D objects. + std::vector> normalVectors() const; + + /// Returns an array of indices that define which nodes are used + /// for each triangle. This is used to look-up the coordinates in the + /// NodeCoordinates array to get the three coordinates of each triangle. + std::vector nodeIndices() const; + + /// Returns the texture coordinates used when mapping a texture to + /// this face. The coordinates are returned as an array of + /// doubles where they are the u and v components of each + /// coordinate as defined in parametric space. There is a texture + /// coordinate for each vertex in the face mesh. + std::vector textureCoordinatesAsDouble() const; + + /// Returns the texture coordinates used when mapping a texture to + /// this face. The coordinates are returned as an array of + /// floats where they are the u and v components of each + /// coordinate as defined in parametric space. There is a texture + /// coordinate for each vertex in the face mesh. + std::vector textureCoordinatesAsFloat() const; + + /// Returns the texture coordinates used when mapping a texture to + /// this face. The coordinates are returned as an array of + /// Point2D objects where the x and y properties of the point are + /// u and v coordinates as defined in parametric space. There is + /// a texture coordinate for each vertex in the face mesh. + std::vector> textureCoordinates() const; + + /// Returns the surface tolerance that was used to generate this mesh. + /// This is most useful when using display meshes that have already + /// been calculated. + double surfaceTolerance() const; + + ADSK_FUSION_TRIANGLEMESH_API static const char* classType(); + ADSK_FUSION_TRIANGLEMESH_API const char* objectType() const override; + ADSK_FUSION_TRIANGLEMESH_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TRIANGLEMESH_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual int nodeCount_raw() const = 0; + virtual double* nodeCoordinatesAsDouble_raw(size_t& return_size) const = 0; + virtual float* nodeCoordinatesAsFloat_raw(size_t& return_size) const = 0; + virtual core::Point3D** nodeCoordinates_raw(size_t& return_size) const = 0; + virtual int triangleCount_raw() const = 0; + virtual double* normalVectorsAsDouble_raw(size_t& return_size) const = 0; + virtual float* normalVectorsAsFloat_raw(size_t& return_size) const = 0; + virtual core::Vector3D** normalVectors_raw(size_t& return_size) const = 0; + virtual int* nodeIndices_raw(size_t& return_size) const = 0; + virtual double* textureCoordinatesAsDouble_raw(size_t& return_size) const = 0; + virtual float* textureCoordinatesAsFloat_raw(size_t& return_size) const = 0; + virtual core::Point2D** textureCoordinates_raw(size_t& return_size) const = 0; + virtual double surfaceTolerance_raw() const = 0; +}; + +// Inline wrappers + +inline int TriangleMesh::nodeCount() const +{ + int res = nodeCount_raw(); + return res; +} + +inline std::vector TriangleMesh::nodeCoordinatesAsDouble() const +{ + std::vector res; + size_t s; + + double* p= nodeCoordinatesAsDouble_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector TriangleMesh::nodeCoordinatesAsFloat() const +{ + std::vector res; + size_t s; + + float* p= nodeCoordinatesAsFloat_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> TriangleMesh::nodeCoordinates() const +{ + std::vector> res; + size_t s; + + core::Point3D** p= nodeCoordinates_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline int TriangleMesh::triangleCount() const +{ + int res = triangleCount_raw(); + return res; +} + +inline std::vector TriangleMesh::normalVectorsAsDouble() const +{ + std::vector res; + size_t s; + + double* p= normalVectorsAsDouble_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector TriangleMesh::normalVectorsAsFloat() const +{ + std::vector res; + size_t s; + + float* p= normalVectorsAsFloat_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> TriangleMesh::normalVectors() const +{ + std::vector> res; + size_t s; + + core::Vector3D** p= normalVectors_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector TriangleMesh::nodeIndices() const +{ + std::vector res; + size_t s; + + int* p= nodeIndices_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector TriangleMesh::textureCoordinatesAsDouble() const +{ + std::vector res; + size_t s; + + double* p= textureCoordinatesAsDouble_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector TriangleMesh::textureCoordinatesAsFloat() const +{ + std::vector res; + size_t s; + + float* p= textureCoordinatesAsFloat_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> TriangleMesh::textureCoordinates() const +{ + std::vector> res; + size_t s; + + core::Point2D** p= textureCoordinates_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline double TriangleMesh::surfaceTolerance() const +{ + double res = surfaceTolerance_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TRIANGLEMESH_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/MeshData/TriangleMeshCalculator.h b/usr/autodesk/CPP/include/Fusion/MeshData/TriangleMeshCalculator.h new file mode 100644 index 0000000..e93ccdb --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/MeshData/TriangleMeshCalculator.h @@ -0,0 +1,173 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TRIANGLEMESHCALCULATOR_CPP__ +# define ADSK_FUSION_TRIANGLEMESHCALCULATOR_API XI_EXPORT +# else +# define ADSK_FUSION_TRIANGLEMESHCALCULATOR_API +# endif +#else +# define ADSK_FUSION_TRIANGLEMESHCALCULATOR_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class MeshManager; + class TriangleMesh; +}} + +namespace adsk { namespace fusion { + +/// Used to calculate new meshes for a B-Rep or T-Spline using defined criteria. +class TriangleMeshCalculator : public core::Base { +public: + + /// This is a simplified way to set the various settings that control the resulting mesh. When used it automatically + /// adjusts all of the property values appropriately. It does this for the given geometry by computing its bounding + /// box diameter. Then the surface tolerance is calculated as shown below where the meshLOD is the "Level of Detail" and + /// is described in more detail below. The diameter is the bounding box diameter. + /// double nodeApproximateSize = std::pow(2.0, meshLOD); + /// double fracTol = 1.0 / nodeApproximateSize; + /// surfaceTolerance = fracTol * diameter; + /// triangleMeshQuality : The mesh quality is specified by using an item from the enum list where the following items result + /// in a corresponding mesh LOD that's used in the equation above. + /// LowQualityTriangleMesh: 8 + /// NormalQualityTriangleMesh: 11 + /// HighQualityTriangleMesh: 13 + /// VeryHighQualityTriangleMesh: 15 + /// Returns true if setting the quality was successful. + bool setQuality(TriangleMeshQualityOptions triangleMeshQuality); + + /// Specifies the maximum distance that the mesh can deviate from the smooth surface. + /// The value is in centimeters. Smaller values can result in a much greater number + /// of facets being returned and will require more processing time to calculate. + double surfaceTolerance() const; + bool surfaceTolerance(double value); + + /// Specifies the maximum side of any triangle in the mesh. A value of 0 (the default) + /// indicates that no maximum length is specified. The value is specified in centimeters. + double maxSideLength() const; + bool maxSideLength(double value); + + /// Specifies the maximum length to height ratio that a triangle can have. + /// This helps to avoid long skinny triangles. A value of 0 (the default) + /// indicates that no maximum aspect ratio is specified. + double maxAspectRatio() const; + bool maxAspectRatio(double value); + + /// Specifies the maximum deviation between adjacent vertex normals. + /// This value is the maximum angle allowed between normals and is + /// specified in radians. A value of 0 (the default) indicates that no normal deviation is specified. + double maxNormalDeviation() const; + bool maxNormalDeviation(double value); + + /// Calculates a new triangle mesh based on the current settings. + /// Returns the new TriangleMesh object or null in the case where the calculation failed. + core::Ptr calculate(); + + /// Returns the parent MeshManager object. + core::Ptr parentMeshManager() const; + + ADSK_FUSION_TRIANGLEMESHCALCULATOR_API static const char* classType(); + ADSK_FUSION_TRIANGLEMESHCALCULATOR_API const char* objectType() const override; + ADSK_FUSION_TRIANGLEMESHCALCULATOR_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TRIANGLEMESHCALCULATOR_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool setQuality_raw(TriangleMeshQualityOptions triangleMeshQuality) = 0; + virtual double surfaceTolerance_raw() const = 0; + virtual bool surfaceTolerance_raw(double value) = 0; + virtual double maxSideLength_raw() const = 0; + virtual bool maxSideLength_raw(double value) = 0; + virtual double maxAspectRatio_raw() const = 0; + virtual bool maxAspectRatio_raw(double value) = 0; + virtual double maxNormalDeviation_raw() const = 0; + virtual bool maxNormalDeviation_raw(double value) = 0; + virtual TriangleMesh* calculate_raw() = 0; + virtual MeshManager* parentMeshManager_raw() const = 0; +}; + +// Inline wrappers + +inline bool TriangleMeshCalculator::setQuality(TriangleMeshQualityOptions triangleMeshQuality) +{ + bool res = setQuality_raw(triangleMeshQuality); + return res; +} + +inline double TriangleMeshCalculator::surfaceTolerance() const +{ + double res = surfaceTolerance_raw(); + return res; +} + +inline bool TriangleMeshCalculator::surfaceTolerance(double value) +{ + return surfaceTolerance_raw(value); +} + +inline double TriangleMeshCalculator::maxSideLength() const +{ + double res = maxSideLength_raw(); + return res; +} + +inline bool TriangleMeshCalculator::maxSideLength(double value) +{ + return maxSideLength_raw(value); +} + +inline double TriangleMeshCalculator::maxAspectRatio() const +{ + double res = maxAspectRatio_raw(); + return res; +} + +inline bool TriangleMeshCalculator::maxAspectRatio(double value) +{ + return maxAspectRatio_raw(value); +} + +inline double TriangleMeshCalculator::maxNormalDeviation() const +{ + double res = maxNormalDeviation_raw(); + return res; +} + +inline bool TriangleMeshCalculator::maxNormalDeviation(double value) +{ + return maxNormalDeviation_raw(value); +} + +inline core::Ptr TriangleMeshCalculator::calculate() +{ + core::Ptr res = calculate_raw(); + return res; +} + +inline core::Ptr TriangleMeshCalculator::parentMeshManager() const +{ + core::Ptr res = parentMeshManager_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TRIANGLEMESHCALCULATOR_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/MeshData/TriangleMeshList.h b/usr/autodesk/CPP/include/Fusion/MeshData/TriangleMeshList.h new file mode 100644 index 0000000..95a484e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/MeshData/TriangleMeshList.h @@ -0,0 +1,86 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TRIANGLEMESHLIST_CPP__ +# define ADSK_FUSION_TRIANGLEMESHLIST_API XI_EXPORT +# else +# define ADSK_FUSION_TRIANGLEMESHLIST_API +# endif +#else +# define ADSK_FUSION_TRIANGLEMESHLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TriangleMesh; +}} + +namespace adsk { namespace fusion { + +/// Provides access to a set of triangle meshes. +class TriangleMeshList : public core::Base { +public: + + /// Returns the specified triangle meshes. + /// index : The index of the mesh to return where the first item has an index of 0. + /// Returns the specified mesh or null in the case of invalid index. + core::Ptr item(size_t index) const; + + /// Returns the mesh with the tightest surface tolerance. This can return null + /// in the case the list is empty, ie. Count is 0. + core::Ptr bestMesh() const; + + /// Returns the number of meshes in the collection. + size_t count() const; + + ADSK_FUSION_TRIANGLEMESHLIST_API static const char* classType(); + ADSK_FUSION_TRIANGLEMESHLIST_API const char* objectType() const override; + ADSK_FUSION_TRIANGLEMESHLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TRIANGLEMESHLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual TriangleMesh* item_raw(size_t index) const = 0; + virtual TriangleMesh* bestMesh_raw() const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr TriangleMeshList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr TriangleMeshList::bestMesh() const +{ + core::Ptr res = bestMesh_raw(); + return res; +} + +inline size_t TriangleMeshList::count() const +{ + size_t res = count_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TRIANGLEMESHLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/AlongPathTextDefinition.h b/usr/autodesk/CPP/include/Fusion/Sketch/AlongPathTextDefinition.h new file mode 100644 index 0000000..1d99bb8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/AlongPathTextDefinition.h @@ -0,0 +1,119 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/CoreTypeDefs.h" +#include "SketchTextDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_ALONGPATHTEXTDEFINITION_CPP__ +# define ADSK_FUSION_ALONGPATHTEXTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_ALONGPATHTEXTDEFINITION_API +# endif +#else +# define ADSK_FUSION_ALONGPATHTEXTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines the information for text that follows along a path. +class AlongPathTextDefinition : public SketchTextDefinition { +public: + + /// Get and sets the entity that defines the path for the text. This can be a SketchCurve or BRepEdge object. + core::Ptr path() const; + bool path(const core::Ptr& value); + + /// Gets and sets if the text should be positioned above or below the path entity. + bool isAbovePath() const; + bool isAbovePath(bool value); + + /// Gets and sets the horizontal alignment of the text with respect to the path curve. + core::HorizontalAlignments horizontalAlignment() const; + bool horizontalAlignment(core::HorizontalAlignments value); + + /// Gets and sets the spacing between the characters. This is an additional spacing to apply + /// that is defined as a percentage of the default spacing. A spacing of 0 indicates no + /// additional spacing. A spacing of 50 indicates to use the default plus 50% of the default. + double characterSpacing() const; + bool characterSpacing(double value); + + ADSK_FUSION_ALONGPATHTEXTDEFINITION_API static const char* classType(); + ADSK_FUSION_ALONGPATHTEXTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_ALONGPATHTEXTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_ALONGPATHTEXTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* path_raw() const = 0; + virtual bool path_raw(core::Base* value) = 0; + virtual bool isAbovePath_raw() const = 0; + virtual bool isAbovePath_raw(bool value) = 0; + virtual core::HorizontalAlignments horizontalAlignment_raw() const = 0; + virtual bool horizontalAlignment_raw(core::HorizontalAlignments value) = 0; + virtual double characterSpacing_raw() const = 0; + virtual bool characterSpacing_raw(double value) = 0; +}; + +// Inline wrappers + +inline core::Ptr AlongPathTextDefinition::path() const +{ + core::Ptr res = path_raw(); + return res; +} + +inline bool AlongPathTextDefinition::path(const core::Ptr& value) +{ + return path_raw(value.get()); +} + +inline bool AlongPathTextDefinition::isAbovePath() const +{ + bool res = isAbovePath_raw(); + return res; +} + +inline bool AlongPathTextDefinition::isAbovePath(bool value) +{ + return isAbovePath_raw(value); +} + +inline core::HorizontalAlignments AlongPathTextDefinition::horizontalAlignment() const +{ + core::HorizontalAlignments res = horizontalAlignment_raw(); + return res; +} + +inline bool AlongPathTextDefinition::horizontalAlignment(core::HorizontalAlignments value) +{ + return horizontalAlignment_raw(value); +} + +inline double AlongPathTextDefinition::characterSpacing() const +{ + double res = characterSpacing_raw(); + return res; +} + +inline bool AlongPathTextDefinition::characterSpacing(double value) +{ + return characterSpacing_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_ALONGPATHTEXTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/CircularPatternConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/CircularPatternConstraint.h new file mode 100644 index 0000000..7af4a79 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/CircularPatternConstraint.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CIRCULARPATTERNCONSTRAINT_CPP__ +# define ADSK_FUSION_CIRCULARPATTERNCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_CIRCULARPATTERNCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_CIRCULARPATTERNCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A circular pattern constraint in a sketch. +class CircularPatternConstraint : public GeometricConstraint { +public: + + ADSK_FUSION_CIRCULARPATTERNCONSTRAINT_API static const char* classType(); + ADSK_FUSION_CIRCULARPATTERNCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_CIRCULARPATTERNCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CIRCULARPATTERNCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CIRCULARPATTERNCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/CoincidentConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/CoincidentConstraint.h new file mode 100644 index 0000000..882759f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/CoincidentConstraint.h @@ -0,0 +1,101 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COINCIDENTCONSTRAINT_CPP__ +# define ADSK_FUSION_COINCIDENTCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_COINCIDENTCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_COINCIDENTCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchEntity; + class SketchPoint; +}} + +namespace adsk { namespace fusion { + +/// A coincident constraint in a sketch. +class CoincidentConstraint : public GeometricConstraint { +public: + + /// Returns the sketch point that is constrained. + core::Ptr point() const; + + /// The sketch curve or point the point is constrained to. + core::Ptr entity() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_COINCIDENTCONSTRAINT_API static const char* classType(); + ADSK_FUSION_COINCIDENTCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_COINCIDENTCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COINCIDENTCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* point_raw() const = 0; + virtual SketchEntity* entity_raw() const = 0; + virtual CoincidentConstraint* nativeObject_raw() const = 0; + virtual CoincidentConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr CoincidentConstraint::point() const +{ + core::Ptr res = point_raw(); + return res; +} + +inline core::Ptr CoincidentConstraint::entity() const +{ + core::Ptr res = entity_raw(); + return res; +} + +inline core::Ptr CoincidentConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr CoincidentConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COINCIDENTCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/CollinearConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/CollinearConstraint.h new file mode 100644 index 0000000..6cb2eb9 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/CollinearConstraint.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_COLLINEARCONSTRAINT_CPP__ +# define ADSK_FUSION_COLLINEARCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_COLLINEARCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_COLLINEARCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchLine; +}} + +namespace adsk { namespace fusion { + +/// A collinear constraint in a sketch. +class CollinearConstraint : public GeometricConstraint { +public: + + /// Returns the first line. + core::Ptr lineOne() const; + + /// Returns the second line. + core::Ptr lineTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_COLLINEARCONSTRAINT_API static const char* classType(); + ADSK_FUSION_COLLINEARCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_COLLINEARCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_COLLINEARCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLine* lineOne_raw() const = 0; + virtual SketchLine* lineTwo_raw() const = 0; + virtual CollinearConstraint* nativeObject_raw() const = 0; + virtual CollinearConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr CollinearConstraint::lineOne() const +{ + core::Ptr res = lineOne_raw(); + return res; +} + +inline core::Ptr CollinearConstraint::lineTwo() const +{ + core::Ptr res = lineTwo_raw(); + return res; +} + +inline core::Ptr CollinearConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr CollinearConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_COLLINEARCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/ConcentricConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/ConcentricConstraint.h new file mode 100644 index 0000000..fc9c59d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/ConcentricConstraint.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_CONCENTRICCONSTRAINT_CPP__ +# define ADSK_FUSION_CONCENTRICCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_CONCENTRICCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_CONCENTRICCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; +}} + +namespace adsk { namespace fusion { + +/// A concentric constraint in a sketch. +class ConcentricConstraint : public GeometricConstraint { +public: + + /// Returns the first curve. + core::Ptr entityOne() const; + + /// Returns the second curve. + core::Ptr entityTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_CONCENTRICCONSTRAINT_API static const char* classType(); + ADSK_FUSION_CONCENTRICCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_CONCENTRICCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_CONCENTRICCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve* entityOne_raw() const = 0; + virtual SketchCurve* entityTwo_raw() const = 0; + virtual ConcentricConstraint* nativeObject_raw() const = 0; + virtual ConcentricConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ConcentricConstraint::entityOne() const +{ + core::Ptr res = entityOne_raw(); + return res; +} + +inline core::Ptr ConcentricConstraint::entityTwo() const +{ + core::Ptr res = entityTwo_raw(); + return res; +} + +inline core::Ptr ConcentricConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ConcentricConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_CONCENTRICCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/EqualConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/EqualConstraint.h new file mode 100644 index 0000000..4a6cec9 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/EqualConstraint.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_EQUALCONSTRAINT_CPP__ +# define ADSK_FUSION_EQUALCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_EQUALCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_EQUALCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; +}} + +namespace adsk { namespace fusion { + +/// An equal constraint in a sketch. +class EqualConstraint : public GeometricConstraint { +public: + + /// Returns the first curve. + core::Ptr curveOne() const; + + /// Returns the second curve. + core::Ptr curveTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_EQUALCONSTRAINT_API static const char* classType(); + ADSK_FUSION_EQUALCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_EQUALCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_EQUALCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve* curveOne_raw() const = 0; + virtual SketchCurve* curveTwo_raw() const = 0; + virtual EqualConstraint* nativeObject_raw() const = 0; + virtual EqualConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr EqualConstraint::curveOne() const +{ + core::Ptr res = curveOne_raw(); + return res; +} + +inline core::Ptr EqualConstraint::curveTwo() const +{ + core::Ptr res = curveTwo_raw(); + return res; +} + +inline core::Ptr EqualConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr EqualConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_EQUALCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/FitOnPathTextDefintion.h b/usr/autodesk/CPP/include/Fusion/Sketch/FitOnPathTextDefintion.h new file mode 100644 index 0000000..3e16925 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/FitOnPathTextDefintion.h @@ -0,0 +1,82 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchTextDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_FITONPATHTEXTDEFINTION_CPP__ +# define ADSK_FUSION_FITONPATHTEXTDEFINTION_API XI_EXPORT +# else +# define ADSK_FUSION_FITONPATHTEXTDEFINTION_API +# endif +#else +# define ADSK_FUSION_FITONPATHTEXTDEFINTION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// Defines the information for text that fits along a path. +class FitOnPathTextDefintion : public SketchTextDefinition { +public: + + /// Get and sets the entity that defines the path for the text. This can be a SketchCurve or BRepEdge object. + core::Ptr path() const; + bool path(const core::Ptr& value); + + /// Gets and sets if the text should be positioned above or below the path entity. + bool isAbovePath() const; + bool isAbovePath(bool value); + + ADSK_FUSION_FITONPATHTEXTDEFINTION_API static const char* classType(); + ADSK_FUSION_FITONPATHTEXTDEFINTION_API const char* objectType() const override; + ADSK_FUSION_FITONPATHTEXTDEFINTION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_FITONPATHTEXTDEFINTION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Base* path_raw() const = 0; + virtual bool path_raw(core::Base* value) = 0; + virtual bool isAbovePath_raw() const = 0; + virtual bool isAbovePath_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr FitOnPathTextDefintion::path() const +{ + core::Ptr res = path_raw(); + return res; +} + +inline bool FitOnPathTextDefintion::path(const core::Ptr& value) +{ + return path_raw(value.get()); +} + +inline bool FitOnPathTextDefintion::isAbovePath() const +{ + bool res = isAbovePath_raw(); + return res; +} + +inline bool FitOnPathTextDefintion::isAbovePath(bool value) +{ + return isAbovePath_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_FITONPATHTEXTDEFINTION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/GeometricConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/GeometricConstraint.h new file mode 100644 index 0000000..66b84a7 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/GeometricConstraint.h @@ -0,0 +1,163 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_GEOMETRICCONSTRAINT_CPP__ +# define ADSK_FUSION_GEOMETRICCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_GEOMETRICCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_GEOMETRICCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class Sketch; +}} +namespace adsk { namespace core { + class Attributes; +}} + +namespace adsk { namespace fusion { + +/// The base class for all geometric constraints. +class GeometricConstraint : public core::Base { +public: + + /// Deletes this constraint. The IsDeletable property can be used to determine if this + /// constraint can be deleted. + /// Returns true if the delete was successful. + bool deleteMe(); + + /// Indicates if this constraint is deletable. + bool isDeletable() const; + + /// Returns the parent sketch object. + core::Ptr parentSketch() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// Returns the collection of attributes associated with this geometric constraint. + core::Ptr attributes() const; + + /// Returns a token for the GeometricConstraint object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same geometric constraint. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_GEOMETRICCONSTRAINT_API static const char* classType(); + ADSK_FUSION_GEOMETRICCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_GEOMETRICCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_GEOMETRICCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool deleteMe_raw() = 0; + virtual bool isDeletable_raw() const = 0; + virtual Sketch* parentSketch_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual char* entityToken_raw() const = 0; + virtual void placeholderGeometricConstraint0() {} + virtual void placeholderGeometricConstraint1() {} + virtual void placeholderGeometricConstraint2() {} + virtual void placeholderGeometricConstraint3() {} + virtual void placeholderGeometricConstraint4() {} + virtual void placeholderGeometricConstraint5() {} + virtual void placeholderGeometricConstraint6() {} + virtual void placeholderGeometricConstraint7() {} + virtual void placeholderGeometricConstraint8() {} + virtual void placeholderGeometricConstraint9() {} + virtual void placeholderGeometricConstraint10() {} + virtual void placeholderGeometricConstraint11() {} + virtual void placeholderGeometricConstraint12() {} + virtual void placeholderGeometricConstraint13() {} + virtual void placeholderGeometricConstraint14() {} + virtual void placeholderGeometricConstraint15() {} + virtual void placeholderGeometricConstraint16() {} + virtual void placeholderGeometricConstraint17() {} + virtual void placeholderGeometricConstraint18() {} + virtual void placeholderGeometricConstraint19() {} + virtual void placeholderGeometricConstraint20() {} + virtual void placeholderGeometricConstraint21() {} + virtual void placeholderGeometricConstraint22() {} + virtual void placeholderGeometricConstraint23() {} + virtual void placeholderGeometricConstraint24() {} + virtual void placeholderGeometricConstraint25() {} +}; + +// Inline wrappers + +inline bool GeometricConstraint::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline bool GeometricConstraint::isDeletable() const +{ + bool res = isDeletable_raw(); + return res; +} + +inline core::Ptr GeometricConstraint::parentSketch() const +{ + core::Ptr res = parentSketch_raw(); + return res; +} + +inline core::Ptr GeometricConstraint::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr GeometricConstraint::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline std::string GeometricConstraint::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_GEOMETRICCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/GeometricConstraintList.h b/usr/autodesk/CPP/include/Fusion/Sketch/GeometricConstraintList.h new file mode 100644 index 0000000..9028cfc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/GeometricConstraintList.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_GEOMETRICCONSTRAINTLIST_CPP__ +# define ADSK_FUSION_GEOMETRICCONSTRAINTLIST_API XI_EXPORT +# else +# define ADSK_FUSION_GEOMETRICCONSTRAINTLIST_API +# endif +#else +# define ADSK_FUSION_GEOMETRICCONSTRAINTLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class GeometricConstraint; +}} + +namespace adsk { namespace fusion { + +/// A list of geometric constraints. +class GeometricConstraintList : public core::Base { +public: + + /// Function that returns the specified geometry constraint using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of constraints in the sketch. + size_t count() const; + + typedef GeometricConstraint iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_GEOMETRICCONSTRAINTLIST_API static const char* classType(); + ADSK_FUSION_GEOMETRICCONSTRAINTLIST_API const char* objectType() const override; + ADSK_FUSION_GEOMETRICCONSTRAINTLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_GEOMETRICCONSTRAINTLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual GeometricConstraint* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr GeometricConstraintList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t GeometricConstraintList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void GeometricConstraintList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_GEOMETRICCONSTRAINTLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/GeometricConstraints.h b/usr/autodesk/CPP/include/Fusion/Sketch/GeometricConstraints.h new file mode 100644 index 0000000..d3aeb68 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/GeometricConstraints.h @@ -0,0 +1,289 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_GEOMETRICCONSTRAINTS_CPP__ +# define ADSK_FUSION_GEOMETRICCONSTRAINTS_API XI_EXPORT +# else +# define ADSK_FUSION_GEOMETRICCONSTRAINTS_API +# endif +#else +# define ADSK_FUSION_GEOMETRICCONSTRAINTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class CoincidentConstraint; + class CollinearConstraint; + class ConcentricConstraint; + class EqualConstraint; + class GeometricConstraint; + class HorizontalConstraint; + class HorizontalPointsConstraint; + class MidPointConstraint; + class ParallelConstraint; + class PerpendicularConstraint; + class SketchCurve; + class SketchEntity; + class SketchLine; + class SketchPoint; + class SmoothConstraint; + class SymmetryConstraint; + class TangentConstraint; + class VerticalConstraint; + class VerticalPointsConstraint; +}} + +namespace adsk { namespace fusion { + +/// A collection of all of the geometric constraints in a sketch. This object +/// also supports the methods to create new geometric constraints. +class GeometricConstraints : public core::Base { +public: + + /// Function that returns the specified sketch constraint using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of constraints in the sketch. + size_t count() const; + + /// Creates a new coincident constraint between two entities. The first argument + /// is a sketch point. The second argument is a sketch curve or point. + /// point : The SketchPoint that will be made coincident. + /// entity : The SketchPoint or sketch curve that the point will be made coincident to. + /// Returns the newly created CoincidentConstraint object or null if the creation failed. + core::Ptr addCoincident(const core::Ptr& point, const core::Ptr& entity); + + /// Creates a new collinear constraint between two lines. + /// lineOne : The first line to create the constraint on. + /// lineTwo : The second line to create the constraint on. + /// Returns the newly created CollinearConstraint object or null if the creation failed. + core::Ptr addCollinear(const core::Ptr& lineOne, const core::Ptr& lineTwo); + + /// Creates a new concentric constraint between two circles, arcs, ellipses, or elliptical arcs. + /// entityOne : The first circle, arc, ellipse or elliptical arc. + /// entityTwo : The second circle, arc, ellipse or elliptical arc. + /// Returns the newly created ConcentricConstraint object or null if the creation failed. + core::Ptr addConcentric(const core::Ptr& entityOne, const core::Ptr& entityTwo); + + /// Creates a new midpoint constraint between a point and a curve. + /// point : The point to constrain to the midpoint of a curve. + /// midPointCurve : The curve that defines the midpoint to constraint to. + /// Returns the newly created MidPointConstraint object or null if the creation failed. + core::Ptr addMidPoint(const core::Ptr& point, const core::Ptr& midPointCurve); + + /// Creates a new parallel constraint between two lines. + /// lineOne : The first SketchLine. + /// lineTwo : The second SketchLine. + /// Returns the newly created ParallelConstraint object or null if the creation failed. + core::Ptr addParallel(const core::Ptr& lineOne, const core::Ptr& lineTwo); + + /// Creates a new perpendicular constraint between two lines. + /// lineOne : The first SketchLine. + /// lineTwo : The second SketchLine. + /// Returns the newly created PerpendicularConstraint object or null if the creation failed. + core::Ptr addPerpendicular(const core::Ptr& lineOne, const core::Ptr& lineTwo); + + /// Creates a new horizontal constraint on a line. + /// line : The line to constrain horizontally. + /// Returns the newly created HorizontalConstraint object or null if the creation failed. + core::Ptr addHorizontal(const core::Ptr& line); + + /// Creates a new horizontal constraint between two points. + /// pointOne : The first SketchPoint to constrain horizontally. + /// pointTwo : The second SketchPoint to constrain horizontally. + /// Returns the newly created HorizontalPointsConstraint object or null if the creation failed. + core::Ptr addHorizontalPoints(const core::Ptr& pointOne, const core::Ptr& pointTwo); + + /// Creates a new vertical constraint on a line. + /// line : The line to constrain vertically. + /// Returns the newly created VerticalConstraint object or null if the creation failed. + core::Ptr addVertical(const core::Ptr& line); + + /// Creates a new vertical constraint between two points. + /// pointOne : The first SketchPoint to constrain vertically. + /// pointTwo : The second SketchPoint to constrain vertically. + /// Returns the newly created VerticalPointsConstraint object or null if the creation failed. + core::Ptr addVerticalPoints(const core::Ptr& pointOne, const core::Ptr& pointTwo); + + /// Creates a new tangent constraint between two curves. + /// curveOne : The first curve to be tangent. + /// curveTwo : The second curve to be tangent. + /// Returns the newly created TangentConstraint object or null if the creation failed. + core::Ptr addTangent(const core::Ptr& curveOne, const core::Ptr& curveTwo); + + /// Creates a new smooth constraint between two curves. One of the curves + /// must be a spline. The other curve can be a spline or an arc. + /// curveOne : The first curve to be constrained to be smooth to the second curve. + /// curveTwo : The second curve to be constrained to be smooth to the first curve. + /// Returns the newly created SmoothConstraint object or null if the creation failed. + core::Ptr addSmooth(const core::Ptr& curveOne, const core::Ptr& curveTwo); + + /// Creates a new equal constraint between two lines, or between arcs and circles. + /// curveOne : The first line, arc, or circle. + /// curveTwo : The second line, arc, or circle. + /// Returns the newly created EqualConstraint object or null if the creation failed. + core::Ptr addEqual(const core::Ptr& curveOne, const core::Ptr& curveTwo); + + /// Creates a new symmetry constraint. + /// entityOne : The first sketch entity to be symmetric. + /// entityTwo : The second sketch entity to be symmetric. It must be the same type as the first entity. + /// symmetryLine : The SketchLine that defines the axis of symmetry. + /// Returns the newly created SymmetryConstraint object or null if the creation failed. + core::Ptr addSymmetry(const core::Ptr& entityOne, const core::Ptr& entityTwo, const core::Ptr& symmetryLine); + + typedef GeometricConstraint iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_GEOMETRICCONSTRAINTS_API static const char* classType(); + ADSK_FUSION_GEOMETRICCONSTRAINTS_API const char* objectType() const override; + ADSK_FUSION_GEOMETRICCONSTRAINTS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_GEOMETRICCONSTRAINTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual GeometricConstraint* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual CoincidentConstraint* addCoincident_raw(SketchPoint* point, SketchEntity* entity) = 0; + virtual CollinearConstraint* addCollinear_raw(SketchLine* lineOne, SketchLine* lineTwo) = 0; + virtual ConcentricConstraint* addConcentric_raw(SketchCurve* entityOne, SketchCurve* entityTwo) = 0; + virtual MidPointConstraint* addMidPoint_raw(SketchPoint* point, SketchCurve* midPointCurve) = 0; + virtual ParallelConstraint* addParallel_raw(SketchLine* lineOne, SketchLine* lineTwo) = 0; + virtual PerpendicularConstraint* addPerpendicular_raw(SketchLine* lineOne, SketchLine* lineTwo) = 0; + virtual HorizontalConstraint* addHorizontal_raw(SketchLine* line) = 0; + virtual HorizontalPointsConstraint* addHorizontalPoints_raw(SketchPoint* pointOne, SketchPoint* pointTwo) = 0; + virtual VerticalConstraint* addVertical_raw(SketchLine* line) = 0; + virtual VerticalPointsConstraint* addVerticalPoints_raw(SketchPoint* pointOne, SketchPoint* pointTwo) = 0; + virtual TangentConstraint* addTangent_raw(SketchCurve* curveOne, SketchCurve* curveTwo) = 0; + virtual SmoothConstraint* addSmooth_raw(SketchCurve* curveOne, SketchCurve* curveTwo) = 0; + virtual EqualConstraint* addEqual_raw(SketchCurve* curveOne, SketchCurve* curveTwo) = 0; + virtual SymmetryConstraint* addSymmetry_raw(SketchEntity* entityOne, SketchEntity* entityTwo, SketchLine* symmetryLine) = 0; +}; + +// Inline wrappers + +inline core::Ptr GeometricConstraints::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t GeometricConstraints::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr GeometricConstraints::addCoincident(const core::Ptr& point, const core::Ptr& entity) +{ + core::Ptr res = addCoincident_raw(point.get(), entity.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addCollinear(const core::Ptr& lineOne, const core::Ptr& lineTwo) +{ + core::Ptr res = addCollinear_raw(lineOne.get(), lineTwo.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addConcentric(const core::Ptr& entityOne, const core::Ptr& entityTwo) +{ + core::Ptr res = addConcentric_raw(entityOne.get(), entityTwo.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addMidPoint(const core::Ptr& point, const core::Ptr& midPointCurve) +{ + core::Ptr res = addMidPoint_raw(point.get(), midPointCurve.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addParallel(const core::Ptr& lineOne, const core::Ptr& lineTwo) +{ + core::Ptr res = addParallel_raw(lineOne.get(), lineTwo.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addPerpendicular(const core::Ptr& lineOne, const core::Ptr& lineTwo) +{ + core::Ptr res = addPerpendicular_raw(lineOne.get(), lineTwo.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addHorizontal(const core::Ptr& line) +{ + core::Ptr res = addHorizontal_raw(line.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addHorizontalPoints(const core::Ptr& pointOne, const core::Ptr& pointTwo) +{ + core::Ptr res = addHorizontalPoints_raw(pointOne.get(), pointTwo.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addVertical(const core::Ptr& line) +{ + core::Ptr res = addVertical_raw(line.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addVerticalPoints(const core::Ptr& pointOne, const core::Ptr& pointTwo) +{ + core::Ptr res = addVerticalPoints_raw(pointOne.get(), pointTwo.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addTangent(const core::Ptr& curveOne, const core::Ptr& curveTwo) +{ + core::Ptr res = addTangent_raw(curveOne.get(), curveTwo.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addSmooth(const core::Ptr& curveOne, const core::Ptr& curveTwo) +{ + core::Ptr res = addSmooth_raw(curveOne.get(), curveTwo.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addEqual(const core::Ptr& curveOne, const core::Ptr& curveTwo) +{ + core::Ptr res = addEqual_raw(curveOne.get(), curveTwo.get()); + return res; +} + +inline core::Ptr GeometricConstraints::addSymmetry(const core::Ptr& entityOne, const core::Ptr& entityTwo, const core::Ptr& symmetryLine) +{ + core::Ptr res = addSymmetry_raw(entityOne.get(), entityTwo.get(), symmetryLine.get()); + return res; +} + +template inline void GeometricConstraints::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_GEOMETRICCONSTRAINTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/HorizontalConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/HorizontalConstraint.h new file mode 100644 index 0000000..b3d5b8a --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/HorizontalConstraint.h @@ -0,0 +1,90 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_HORIZONTALCONSTRAINT_CPP__ +# define ADSK_FUSION_HORIZONTALCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_HORIZONTALCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_HORIZONTALCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchLine; +}} + +namespace adsk { namespace fusion { + +/// A horizontal constraint in a sketch. +class HorizontalConstraint : public GeometricConstraint { +public: + + /// Returns the line being constrained. + core::Ptr line() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_HORIZONTALCONSTRAINT_API static const char* classType(); + ADSK_FUSION_HORIZONTALCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_HORIZONTALCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_HORIZONTALCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLine* line_raw() const = 0; + virtual HorizontalConstraint* nativeObject_raw() const = 0; + virtual HorizontalConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr HorizontalConstraint::line() const +{ + core::Ptr res = line_raw(); + return res; +} + +inline core::Ptr HorizontalConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr HorizontalConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_HORIZONTALCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/HorizontalPointsConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/HorizontalPointsConstraint.h new file mode 100644 index 0000000..a3e2677 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/HorizontalPointsConstraint.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_HORIZONTALPOINTSCONSTRAINT_CPP__ +# define ADSK_FUSION_HORIZONTALPOINTSCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_HORIZONTALPOINTSCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_HORIZONTALPOINTSCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchPoint; +}} + +namespace adsk { namespace fusion { + +/// A horizontal constraint between two points in a sketch. +class HorizontalPointsConstraint : public GeometricConstraint { +public: + + /// Returns the first point. + core::Ptr pointOne() const; + + /// Returns the second point. + core::Ptr pointTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_HORIZONTALPOINTSCONSTRAINT_API static const char* classType(); + ADSK_FUSION_HORIZONTALPOINTSCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_HORIZONTALPOINTSCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_HORIZONTALPOINTSCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* pointOne_raw() const = 0; + virtual SketchPoint* pointTwo_raw() const = 0; + virtual HorizontalPointsConstraint* nativeObject_raw() const = 0; + virtual HorizontalPointsConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr HorizontalPointsConstraint::pointOne() const +{ + core::Ptr res = pointOne_raw(); + return res; +} + +inline core::Ptr HorizontalPointsConstraint::pointTwo() const +{ + core::Ptr res = pointTwo_raw(); + return res; +} + +inline core::Ptr HorizontalPointsConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr HorizontalPointsConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_HORIZONTALPOINTSCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/MidPointConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/MidPointConstraint.h new file mode 100644 index 0000000..9ff20f8 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/MidPointConstraint.h @@ -0,0 +1,101 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MIDPOINTCONSTRAINT_CPP__ +# define ADSK_FUSION_MIDPOINTCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_MIDPOINTCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_MIDPOINTCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; + class SketchPoint; +}} + +namespace adsk { namespace fusion { + +/// A midpoint constraint in a sketch. +class MidPointConstraint : public GeometricConstraint { +public: + + /// Returns the sketch point being constrained. + core::Ptr point() const; + + /// Returns the curve defining the midpoint. + core::Ptr midPointCurve() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_MIDPOINTCONSTRAINT_API static const char* classType(); + ADSK_FUSION_MIDPOINTCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_MIDPOINTCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MIDPOINTCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* point_raw() const = 0; + virtual SketchCurve* midPointCurve_raw() const = 0; + virtual MidPointConstraint* nativeObject_raw() const = 0; + virtual MidPointConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr MidPointConstraint::point() const +{ + core::Ptr res = point_raw(); + return res; +} + +inline core::Ptr MidPointConstraint::midPointCurve() const +{ + core::Ptr res = midPointCurve_raw(); + return res; +} + +inline core::Ptr MidPointConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr MidPointConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MIDPOINTCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/MultiLineTextDefinition.h b/usr/autodesk/CPP/include/Fusion/Sketch/MultiLineTextDefinition.h new file mode 100644 index 0000000..346dc92 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/MultiLineTextDefinition.h @@ -0,0 +1,133 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/CoreTypeDefs.h" +#include "../FusionTypeDefs.h" +#include "SketchTextDefinition.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_MULTILINETEXTDEFINITION_CPP__ +# define ADSK_FUSION_MULTILINETEXTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_MULTILINETEXTDEFINITION_API +# endif +#else +# define ADSK_FUSION_MULTILINETEXTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchLineList; +}} + +namespace adsk { namespace fusion { + +/// Defines the information for multi-line text. +class MultiLineTextDefinition : public SketchTextDefinition { +public: + + /// Returns the four sketch lines that define the boundary of the sketch text. By adding constraints to these lines + /// you can associatively control the size, position and angle of the sketch text. If the MultiLineTextDefinition + /// object is obtained from a SketchTextInput object, this property will return null because the text and it's + /// associated lines have not been created yet. + core::Ptr rectangleLines() const; + + /// Gets and sets the horizontal alignment of the text with respect to the text rectangle. + core::HorizontalAlignments horizontalAlignment() const; + bool horizontalAlignment(core::HorizontalAlignments value); + + /// Gets and sets the vertical alignment of the text with respect to the text rectangle. + core::VerticalAlignments verticalAlignment() const; + bool verticalAlignment(core::VerticalAlignments value); + + /// Rotates the text box. + /// angle : The angle to rotate the text, specified in radians. + /// keyPoint : The key point the rotation is defined around. This is optional and defaults the center of the text box. + /// + bool rotate(double angle, TextBoxKeyPoints keyPoint = adsk::fusion::MiddleTextBoxKeyPoint); + + /// Gets and sets the spacing between the characters. This is an additional spacing to apply + /// that is defined as a percentage of the default spacing. A spacing of 0 indicates no + /// additional spacing. A spacing of 50 indicates to use the default plus 50% of the default. + double characterSpacing() const; + bool characterSpacing(double value); + + ADSK_FUSION_MULTILINETEXTDEFINITION_API static const char* classType(); + ADSK_FUSION_MULTILINETEXTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_MULTILINETEXTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_MULTILINETEXTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLineList* rectangleLines_raw() const = 0; + virtual core::HorizontalAlignments horizontalAlignment_raw() const = 0; + virtual bool horizontalAlignment_raw(core::HorizontalAlignments value) = 0; + virtual core::VerticalAlignments verticalAlignment_raw() const = 0; + virtual bool verticalAlignment_raw(core::VerticalAlignments value) = 0; + virtual bool rotate_raw(double angle, TextBoxKeyPoints keyPoint) = 0; + virtual double characterSpacing_raw() const = 0; + virtual bool characterSpacing_raw(double value) = 0; +}; + +// Inline wrappers + +inline core::Ptr MultiLineTextDefinition::rectangleLines() const +{ + core::Ptr res = rectangleLines_raw(); + return res; +} + +inline core::HorizontalAlignments MultiLineTextDefinition::horizontalAlignment() const +{ + core::HorizontalAlignments res = horizontalAlignment_raw(); + return res; +} + +inline bool MultiLineTextDefinition::horizontalAlignment(core::HorizontalAlignments value) +{ + return horizontalAlignment_raw(value); +} + +inline core::VerticalAlignments MultiLineTextDefinition::verticalAlignment() const +{ + core::VerticalAlignments res = verticalAlignment_raw(); + return res; +} + +inline bool MultiLineTextDefinition::verticalAlignment(core::VerticalAlignments value) +{ + return verticalAlignment_raw(value); +} + +inline bool MultiLineTextDefinition::rotate(double angle, TextBoxKeyPoints keyPoint) +{ + bool res = rotate_raw(angle, keyPoint); + return res; +} + +inline double MultiLineTextDefinition::characterSpacing() const +{ + double res = characterSpacing_raw(); + return res; +} + +inline bool MultiLineTextDefinition::characterSpacing(double value) +{ + return characterSpacing_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_MULTILINETEXTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/OffsetConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/OffsetConstraint.h new file mode 100644 index 0000000..269f98b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/OffsetConstraint.h @@ -0,0 +1,147 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_OFFSETCONSTRAINT_CPP__ +# define ADSK_FUSION_OFFSETCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_OFFSETCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_OFFSETCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; + class SketchDimension; +}} + +namespace adsk { namespace fusion { + +/// An offset constraint in a sketch. +class OffsetConstraint : public GeometricConstraint { +public: + + /// Returns an array of sketch curves that are the set of parent curves. + /// Nothing should be assumed about the order in how the curves are returned. + std::vector> parentCurves() const; + + /// Returns an array of sketch curves that are the set of child curves resulting from the offset. + /// Nothing should be assumed about the order in how the curves are returned. + std::vector> childCurves() const; + + /// The current distance of the offset in centimeters. To change the offset you need to + /// modify the value of the parameter associated with the dimension, which you can get + /// using the dimension property. + double distance() const; + + /// Returns the dimension controlling the offset distance. This can return null in the + /// case where the dimension has been deleted. To change the offset distance you can use + /// the parameter property of the returned dimension to get the parameter that controls the value and + /// use properties on the parameter to change the value. This can return either a SketchOffsetCurvesDimension + /// or an SketchOffsetDimension. A SketchOffsetCurvesDimension is created automatically when curves are + /// offset but if it is deleted the offset can also be controlled by a SketchOffsetDimension. + core::Ptr dimension() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_OFFSETCONSTRAINT_API static const char* classType(); + ADSK_FUSION_OFFSETCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_OFFSETCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_OFFSETCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve** parentCurves_raw(size_t& return_size) const = 0; + virtual SketchCurve** childCurves_raw(size_t& return_size) const = 0; + virtual double distance_raw() const = 0; + virtual SketchDimension* dimension_raw() const = 0; + virtual OffsetConstraint* nativeObject_raw() const = 0; + virtual OffsetConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline std::vector> OffsetConstraint::parentCurves() const +{ + std::vector> res; + size_t s; + + SketchCurve** p= parentCurves_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> OffsetConstraint::childCurves() const +{ + std::vector> res; + size_t s; + + SketchCurve** p= childCurves_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline double OffsetConstraint::distance() const +{ + double res = distance_raw(); + return res; +} + +inline core::Ptr OffsetConstraint::dimension() const +{ + core::Ptr res = dimension_raw(); + return res; +} + +inline core::Ptr OffsetConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr OffsetConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_OFFSETCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/ParallelConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/ParallelConstraint.h new file mode 100644 index 0000000..8acab53 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/ParallelConstraint.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PARALLELCONSTRAINT_CPP__ +# define ADSK_FUSION_PARALLELCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_PARALLELCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_PARALLELCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchLine; +}} + +namespace adsk { namespace fusion { + +/// A parallel constraint in a sketch. +class ParallelConstraint : public GeometricConstraint { +public: + + /// Returns the first line. + core::Ptr lineOne() const; + + /// Returns the second line. + core::Ptr lineTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_PARALLELCONSTRAINT_API static const char* classType(); + ADSK_FUSION_PARALLELCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_PARALLELCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PARALLELCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLine* lineOne_raw() const = 0; + virtual SketchLine* lineTwo_raw() const = 0; + virtual ParallelConstraint* nativeObject_raw() const = 0; + virtual ParallelConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr ParallelConstraint::lineOne() const +{ + core::Ptr res = lineOne_raw(); + return res; +} + +inline core::Ptr ParallelConstraint::lineTwo() const +{ + core::Ptr res = lineTwo_raw(); + return res; +} + +inline core::Ptr ParallelConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ParallelConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PARALLELCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/PerpendicularConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/PerpendicularConstraint.h new file mode 100644 index 0000000..18b2ed1 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/PerpendicularConstraint.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PERPENDICULARCONSTRAINT_CPP__ +# define ADSK_FUSION_PERPENDICULARCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_PERPENDICULARCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_PERPENDICULARCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchLine; +}} + +namespace adsk { namespace fusion { + +/// A perpendicular constraint in a sketch. +class PerpendicularConstraint : public GeometricConstraint { +public: + + /// Returns the first line. + core::Ptr lineOne() const; + + /// Returns the second line. + core::Ptr lineTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_PERPENDICULARCONSTRAINT_API static const char* classType(); + ADSK_FUSION_PERPENDICULARCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_PERPENDICULARCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PERPENDICULARCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLine* lineOne_raw() const = 0; + virtual SketchLine* lineTwo_raw() const = 0; + virtual PerpendicularConstraint* nativeObject_raw() const = 0; + virtual PerpendicularConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr PerpendicularConstraint::lineOne() const +{ + core::Ptr res = lineOne_raw(); + return res; +} + +inline core::Ptr PerpendicularConstraint::lineTwo() const +{ + core::Ptr res = lineTwo_raw(); + return res; +} + +inline core::Ptr PerpendicularConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr PerpendicularConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PERPENDICULARCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/PolygonConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/PolygonConstraint.h new file mode 100644 index 0000000..b46f46f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/PolygonConstraint.h @@ -0,0 +1,71 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_POLYGONCONSTRAINT_CPP__ +# define ADSK_FUSION_POLYGONCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_POLYGONCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_POLYGONCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchLine; +}} + +namespace adsk { namespace fusion { + +/// A polygon constraint in a sketch. +class PolygonConstraint : public GeometricConstraint { +public: + + /// Returns the sketch lines that represent the polygon. + std::vector> lines() const; + + ADSK_FUSION_POLYGONCONSTRAINT_API static const char* classType(); + ADSK_FUSION_POLYGONCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_POLYGONCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_POLYGONCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLine** lines_raw(size_t& return_size) const = 0; +}; + +// Inline wrappers + +inline std::vector> PolygonConstraint::lines() const +{ + std::vector> res; + size_t s; + + SketchLine** p= lines_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_POLYGONCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/Profile.h b/usr/autodesk/CPP/include/Fusion/Sketch/Profile.h new file mode 100644 index 0000000..9a60e8e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/Profile.h @@ -0,0 +1,183 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PROFILE_CPP__ +# define ADSK_FUSION_PROFILE_API XI_EXPORT +# else +# define ADSK_FUSION_PROFILE_API +# endif +#else +# define ADSK_FUSION_PROFILE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class AreaProperties; + class Occurrence; + class ProfileLoops; + class Sketch; +}} +namespace adsk { namespace core { + class BoundingBox3D; + class Plane; +}} + +namespace adsk { namespace fusion { + +/// Represents a profile in a sketch. Profiles are automatically computed by Fusion 360 and +/// represent closed areas within the sketch. +class Profile : public core::Base { +public: + + /// Returns the 3D bounding box of the profile in sketch space. + core::Ptr boundingBox() const; + + /// Returns the plane the profile is defined in. Profiles are always planar and exist within + /// a single plane. + core::Ptr plane() const; + + /// The loops or closed areas within this profile. There is always a single outer loop + /// but there can be zero to many inner loops defining voids in the profile. + core::Ptr profileLoops() const; + + /// Returns the parent sketch of the profile. + core::Ptr parentSketch() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// Returns null if this isn't the NativeObject. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the AreaProperties object that has properties for getting the area, perimeter, centroid, etc + /// of this profile. + /// accuracy : Specifies the desired level of computational accuracy of the property calculations. + /// The default value of 'LowCalculationAccuracy' returns results within a +/- 1% error margin. + core::Ptr areaProperties(CalculationAccuracy accuracy = adsk::fusion::LowCalculationAccuracy) const; + + /// Returns a token for the Profile object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same profile. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_PROFILE_API static const char* classType(); + ADSK_FUSION_PROFILE_API const char* objectType() const override; + ADSK_FUSION_PROFILE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PROFILE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual core::Plane* plane_raw() const = 0; + virtual ProfileLoops* profileLoops_raw() const = 0; + virtual Sketch* parentSketch_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual Profile* nativeObject_raw() const = 0; + virtual Profile* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual AreaProperties* areaProperties_raw(CalculationAccuracy accuracy) const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr Profile::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline core::Ptr Profile::plane() const +{ + core::Ptr res = plane_raw(); + return res; +} + +inline core::Ptr Profile::profileLoops() const +{ + core::Ptr res = profileLoops_raw(); + return res; +} + +inline core::Ptr Profile::parentSketch() const +{ + core::Ptr res = parentSketch_raw(); + return res; +} + +inline core::Ptr Profile::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr Profile::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr Profile::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr Profile::areaProperties(CalculationAccuracy accuracy) const +{ + core::Ptr res = areaProperties_raw(accuracy); + return res; +} + +inline std::string Profile::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PROFILE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/ProfileCurve.h b/usr/autodesk/CPP/include/Fusion/Sketch/ProfileCurve.h new file mode 100644 index 0000000..3b7d3e4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/ProfileCurve.h @@ -0,0 +1,173 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/CoreTypeDefs.h" +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PROFILECURVE_CPP__ +# define ADSK_FUSION_PROFILECURVE_API XI_EXPORT +# else +# define ADSK_FUSION_PROFILECURVE_API +# endif +#else +# define ADSK_FUSION_PROFILECURVE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class Profile; + class ProfileLoop; + class Sketch; + class SketchEntity; +}} +namespace adsk { namespace core { + class BoundingBox3D; + class Curve3D; +}} + +namespace adsk { namespace fusion { + +/// A single curve in a profile. +class ProfileCurve : public core::Base { +public: + + /// Returns the geometric entity of this portion of the profile. + core::Ptr geometry() const; + + /// Return the geometry type that the Geometry property will return. + core::Curve3DTypes geometryType() const; + + /// Returns the associated sketch entity that defines this curve. + core::Ptr sketchEntity() const; + + /// Returns the parent ProfileLoop object. + core::Ptr parentProfileLoop() const; + + /// Returns the parent Profile object. + core::Ptr parentProfile() const; + + /// Returns the parent Profile object. + core::Ptr parentSketch() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// Returns null if this isn't the NativeObject. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the bounding box of the profile curve in sketch space. + core::Ptr boundingBox() const; + + ADSK_FUSION_PROFILECURVE_API static const char* classType(); + ADSK_FUSION_PROFILECURVE_API const char* objectType() const override; + ADSK_FUSION_PROFILECURVE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PROFILECURVE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Curve3D* geometry_raw() const = 0; + virtual core::Curve3DTypes geometryType_raw() const = 0; + virtual SketchEntity* sketchEntity_raw() const = 0; + virtual ProfileLoop* parentProfileLoop_raw() const = 0; + virtual Profile* parentProfile_raw() const = 0; + virtual Sketch* parentSketch_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual ProfileCurve* nativeObject_raw() const = 0; + virtual ProfileCurve* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ProfileCurve::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Curve3DTypes ProfileCurve::geometryType() const +{ + core::Curve3DTypes res = geometryType_raw(); + return res; +} + +inline core::Ptr ProfileCurve::sketchEntity() const +{ + core::Ptr res = sketchEntity_raw(); + return res; +} + +inline core::Ptr ProfileCurve::parentProfileLoop() const +{ + core::Ptr res = parentProfileLoop_raw(); + return res; +} + +inline core::Ptr ProfileCurve::parentProfile() const +{ + core::Ptr res = parentProfile_raw(); + return res; +} + +inline core::Ptr ProfileCurve::parentSketch() const +{ + core::Ptr res = parentSketch_raw(); + return res; +} + +inline core::Ptr ProfileCurve::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr ProfileCurve::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ProfileCurve::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr ProfileCurve::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PROFILECURVE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/ProfileCurves.h b/usr/autodesk/CPP/include/Fusion/Sketch/ProfileCurves.h new file mode 100644 index 0000000..68ada76 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/ProfileCurves.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PROFILECURVES_CPP__ +# define ADSK_FUSION_PROFILECURVES_API XI_EXPORT +# else +# define ADSK_FUSION_PROFILECURVES_API +# endif +#else +# define ADSK_FUSION_PROFILECURVES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ProfileCurve; +}} + +namespace adsk { namespace fusion { + +/// A collection of profile curves within a profile loop. +class ProfileCurves : public core::Base { +public: + + /// Function that returns the specified profile curve using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of curves in the collection. + size_t count() const; + + typedef ProfileCurve iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_PROFILECURVES_API static const char* classType(); + ADSK_FUSION_PROFILECURVES_API const char* objectType() const override; + ADSK_FUSION_PROFILECURVES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PROFILECURVES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ProfileCurve* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ProfileCurves::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ProfileCurves::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void ProfileCurves::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PROFILECURVES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/ProfileLoop.h b/usr/autodesk/CPP/include/Fusion/Sketch/ProfileLoop.h new file mode 100644 index 0000000..207484d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/ProfileLoop.h @@ -0,0 +1,127 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PROFILELOOP_CPP__ +# define ADSK_FUSION_PROFILELOOP_API XI_EXPORT +# else +# define ADSK_FUSION_PROFILELOOP_API +# endif +#else +# define ADSK_FUSION_PROFILELOOP_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class Profile; + class ProfileCurves; +}} + +namespace adsk { namespace fusion { + +/// A loop within a profile. +class ProfileLoop : public core::Base { +public: + + /// Indicates if this is an outer or inner loop. Profiles always have + /// one outer loop and have an zero to many inner loops defining voids. + bool isOuter() const; + + /// Returns a collection of the curves making up this loop. + core::Ptr profileCurves() const; + + /// Returns the parent Profile object. + core::Ptr parentProfile() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// Returns null if this isn't the NativeObject. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_PROFILELOOP_API static const char* classType(); + ADSK_FUSION_PROFILELOOP_API const char* objectType() const override; + ADSK_FUSION_PROFILELOOP_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PROFILELOOP_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool isOuter_raw() const = 0; + virtual ProfileCurves* profileCurves_raw() const = 0; + virtual Profile* parentProfile_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual ProfileLoop* nativeObject_raw() const = 0; + virtual ProfileLoop* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline bool ProfileLoop::isOuter() const +{ + bool res = isOuter_raw(); + return res; +} + +inline core::Ptr ProfileLoop::profileCurves() const +{ + core::Ptr res = profileCurves_raw(); + return res; +} + +inline core::Ptr ProfileLoop::parentProfile() const +{ + core::Ptr res = parentProfile_raw(); + return res; +} + +inline core::Ptr ProfileLoop::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr ProfileLoop::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr ProfileLoop::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PROFILELOOP_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/ProfileLoops.h b/usr/autodesk/CPP/include/Fusion/Sketch/ProfileLoops.h new file mode 100644 index 0000000..22e3bdf --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/ProfileLoops.h @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PROFILELOOPS_CPP__ +# define ADSK_FUSION_PROFILELOOPS_API XI_EXPORT +# else +# define ADSK_FUSION_PROFILELOOPS_API +# endif +#else +# define ADSK_FUSION_PROFILELOOPS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ProfileLoop; +}} + +namespace adsk { namespace fusion { + +/// A collection of loops within a Profile. +class ProfileLoops : public core::Base { +public: + + /// Function that returns the specified profile loop using an index into the collection. + /// index : The index of the item within the collection to return. + /// The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of loops within this profile. + size_t count() const; + + typedef ProfileLoop iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_PROFILELOOPS_API static const char* classType(); + ADSK_FUSION_PROFILELOOPS_API const char* objectType() const override; + ADSK_FUSION_PROFILELOOPS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PROFILELOOPS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual ProfileLoop* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr ProfileLoops::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t ProfileLoops::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void ProfileLoops::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PROFILELOOPS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/Profiles.h b/usr/autodesk/CPP/include/Fusion/Sketch/Profiles.h new file mode 100644 index 0000000..ffd47cb --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/Profiles.h @@ -0,0 +1,91 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_PROFILES_CPP__ +# define ADSK_FUSION_PROFILES_API XI_EXPORT +# else +# define ADSK_FUSION_PROFILES_API +# endif +#else +# define ADSK_FUSION_PROFILES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Profile; +}} + +namespace adsk { namespace fusion { + +/// A collection of all of the closed profiles currently calculated for this sketch. Closed profiles are +/// automatically computed by Fusion 360 and represent closed areas within the sketch. +/// This class also provides some additional utility functions to create open profiles and text based profiles +/// that can be used as input for various features. +class Profiles : public core::Base { +public: + + /// Function that returns the specified closed profile using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the + /// collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of closed profiles in the sketch. Open and text based profiles are not included. + size_t count() const; + + typedef Profile iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_PROFILES_API static const char* classType(); + ADSK_FUSION_PROFILES_API const char* objectType() const override; + ADSK_FUSION_PROFILES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_PROFILES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Profile* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr Profiles::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t Profiles::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void Profiles::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_PROFILES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/RectangularPatternConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/RectangularPatternConstraint.h new file mode 100644 index 0000000..97115f2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/RectangularPatternConstraint.h @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_RECTANGULARPATTERNCONSTRAINT_CPP__ +# define ADSK_FUSION_RECTANGULARPATTERNCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_RECTANGULARPATTERNCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_RECTANGULARPATTERNCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// A rectangular pattern constraint in a sketch. +class RectangularPatternConstraint : public GeometricConstraint { +public: + + ADSK_FUSION_RECTANGULARPATTERNCONSTRAINT_API static const char* classType(); + ADSK_FUSION_RECTANGULARPATTERNCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_RECTANGULARPATTERNCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_RECTANGULARPATTERNCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_RECTANGULARPATTERNCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/Sketch.h b/usr/autodesk/CPP/include/Fusion/Sketch/Sketch.h new file mode 100644 index 0000000..7e2720d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/Sketch.h @@ -0,0 +1,829 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCH_CPP__ +# define ADSK_FUSION_SKETCH_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCH_API +# endif +#else +# define ADSK_FUSION_SKETCH_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class BRepBody; + class BRepFace; + class Component; + class GeometricConstraints; + class Occurrence; + class Profiles; + class SketchCurve; + class SketchCurves; + class SketchDimensions; + class SketchEntity; + class SketchPoint; + class SketchPoints; + class SketchTexts; + class TimelineObject; +}} +namespace adsk { namespace core { + class Attributes; + class BoundingBox3D; + class Matrix3D; + class ObjectCollection; + class Point3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// Represents a sketch within a component. +class Sketch : public core::Base { +public: + + /// Gets and sets the name of this sketch as seen in the browser and timeline. + std::string name() const; + bool name(const std::string& value); + + /// Returns the sketch points collection associated with this sketch. + /// This provides access to the existing sketch points and supports + /// the creation of new sketch points. + core::Ptr sketchPoints() const; + + /// Returns the sketch curves collection associated with this sketch. + /// This provides access to the existing sketch curves which is all + /// geometry in the sketch except for sketch points. It is through this + /// collection that new sketch geometry gets created. + core::Ptr sketchCurves() const; + + /// Returns the sketch dimensions collection associated with this sketch. + /// This provides access to the existing sketch dimensions and supports + /// the creation of new sketch dimensions. + core::Ptr sketchDimensions() const; + + /// Returns the sketch constraints collection associated with this sketch. + /// This provides access to the existing sketch constraints and supports + /// the creation of new sketch constraints. + core::Ptr geometricConstraints() const; + + /// Projects the specified entity onto the x-y plane of the sketch + /// and returns the created sketch entity(s). + /// entity : The entity to project. This can be a sketch entity, an edge, a face to get all + /// of its edges, a vertex, a construction axis, a construction point, or a + /// construction plane that is perpendicular to the sketch to create a line. + /// Returns a collection of the sketch entities that were created as a result of the + /// projection. + core::Ptr project(const core::Ptr& entity); + + /// Intersects the specified body with the sketch plane and creates new + /// curves representing the intersection. + /// body : The body to be intersected by the sketch. + /// Returns a collection of the sketch entities that were created a a result of the + /// cut. + core::Ptr projectCutEdges(const core::Ptr& body); + + /// Creates new sketch curves and points that represent the specified entity + /// as sketch geometry. The sketch geometry is not projected but is created + /// in the same location in space as the input geometry. + /// entity : The entity to include into the sketch. This can be a sketch entity from + /// another sketch, edge, face (which results in getting all of its edges, a + /// vertex, construction axis, or construction point. + /// Returns a collection of the sketch entities that were created as a result of the include. + /// When including this curves it will be a single sketch curve, but for faces, multiple + /// sketch curves will be created; one for each edge. + core::Ptr include(const core::Ptr& entity); + + /// Finds the sketch curves that are end connected to the input curve. This can be useful + /// for many cases but is especially useful in gathering the input when creating an offset. + /// curve : The initial sketch curve that will be used to find the connected curves. + /// A collection of the connected curves. They are returned in their connected order with + /// the original input curve being one of the curves. + core::Ptr findConnectedCurves(const core::Ptr& curve); + + /// Creates offset curves for the set of input curves. If the offset distance is not + /// provided, the offset distance is defined by the direction point. + /// curves : A set of end connected curves. The Sketch.FindConnectedCurves method is a convenient way to get + /// this set of curves. + /// directionPoint : Defines which side of the input curves to create the offset on + /// offset : The distance to offset the curves in centimeters. + /// A collection of the new offset sketch curves created + core::Ptr offset(const core::Ptr& curves, const core::Ptr& directionPoint, double offset = 0); + + /// Gets and sets the transform of the sketch with respect to model space. + /// This defines the transform from the parent component space + /// to the sketch space. For example, if you have point coordinates in the space + /// of the parent component and apply this transform it will result in the + /// coordinates of the equivalent position in sketch space. + /// The transform is sensitive to the assembly context. + /// Setting the transform will fail in the case where the sketch is parametric + core::Ptr transform() const; + bool transform(const core::Ptr& value); + + /// A specified point in model space returns the equivalent point in sketch space. + /// This is sensitive to the assembly context. + /// modelCoordinate : A coordinate in model space. + /// Returns the equivalent point in sketch space. + core::Ptr modelToSketchSpace(const core::Ptr& modelCoordinate); + + /// A specified point in sketch space returns the equivalent point in model space. + /// This is sensitive to the assembly context. + /// sketchCoordinate : A coordinate in sketch space. + /// Returns the equivalent point in model space. + core::Ptr sketchToModelSpace(const core::Ptr& sketchCoordinate); + + /// Indicates if this sketch is parametric or not. For parametric sketches, you can also + /// get the construction plane or face it is associative to using the ReferencePlane property. + bool isParametric() const; + + /// Gets if this sketch is currently visible in the graphics window. Use the + /// isLightBulbOn to change if the light bulb beside the sketch node in the + /// browser is on or not. Parent nodes in the browser can have their light + /// bulb off which affects all of their children. This property indicates + /// the final result and whether this body is actually visible or not. + bool isVisible() const; + bool isVisible(bool value); + + /// Indicates if the dimensions of the sketch are displayed when the sketch is not active + /// (in sketch edit mode) + bool areDimensionsShown() const; + bool areDimensionsShown(bool value); + + /// Indicates if the profiles of the sketch are displayed + bool areProfilesShown() const; + bool areProfilesShown(bool value); + + /// Returns the origin point of the sketch in model space. + core::Ptr origin() const; + + /// Returns the X direction of the sketch as defined in model space. + core::Ptr xDirection() const; + + /// Returns the Y direction of the sketch as defined in model space. + core::Ptr yDirection() const; + + /// Gets and sets the construction plane or planar face the sketch is associated + /// to. This is only valid when the IsParametric property is True otherwise this + /// returns null and setting the property will fail. + /// Setting this property is the equivalent of the Redefine command. + core::Ptr referencePlane() const; + bool referencePlane(const core::Ptr& value); + + /// Temporarily turns off the compute of the sketch. This is used to + /// increase the performance as sketch geometry is created. Once the + /// sketch is drawn the this property should be set to false to allow + /// the sketch to recompute. This setting is not saved by the file and is + /// always false when a file is opened. + bool isComputeDeferred() const; + bool isComputeDeferred(bool value); + + /// Moves the specified sketch entities using the specified transform. + /// Transform respects any constraints that would normally prohibit the move. + /// sketchEntities : A collection of sketch entities to transform. + /// transform : The transform that defines the move, rotate or scale. + /// Returns true if the move was successful. + bool move(const core::Ptr& sketchEntities, const core::Ptr& transform); + + /// Copies the specified sketch entities, applying the specified transform. + /// Any geometric or dimension constraints associated with the entities will + /// automatically be copied, if possible. For example, if there is a horizontal + /// dimension and the transform defines a rotation then it will not be included in the + /// result. This same behavior can be seen when performing a copy/paste operation + /// in the user interface. + /// sketchEntities : The collection of sketch entities to copy. They must all exist in this sketch. + /// transform : The transform to apply to the copied entities. + /// targetSketch : Optionally specifies the sketch to copy the entities to. If not provided the entities are copied to this sketch. + /// Returns a collection of the new sketch entities that were created as a result of the copy. + core::Ptr copy(const core::Ptr& sketchEntities, const core::Ptr& transform, const core::Ptr& targetSketch = NULL); + + /// Returns the profiles currently computed for the sketch. + core::Ptr profiles() const; + + /// Deletes the sketch. + /// Returns true if the delete was successful. + bool deleteMe(); + + /// Saves the contents of the sketch to a specified DXF file. + /// fullFilename : The full filename, including the path, of the DXF file. + /// Returns true if the operation was successful. + bool saveAsDXF(const std::string& fullFilename); + + /// Imports the contents of an SVG file into the active sketch. + /// fullFilename : The full filename, including the path, of the SVG file. + /// xPosition : The X offset in centimeters in the sketch for the origin of the SVG data + /// relative to the sketch origin. + /// yPosition : The Y offset in centimeters in the sketch for the origin of the SVG data + /// relative to the sketch origin. + /// scale : The scale value to apply to the imported SVG data. + /// Returns true if the import was successful. + bool importSVG(const std::string& fullFilename, double xPosition, double yPosition, double scale); + + /// Returns the timeline object associated with this sketch. + core::Ptr timelineObject() const; + + /// Returns the parent Component. + core::Ptr parentComponent() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this + /// object in an assembly. This is only valid in the case where this + /// is acting as a proxy in an assembly. Returns null + /// in the case where the object is not in the context of an assembly. + /// but is already the native object. + core::Ptr assemblyContext() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the 3D bounding box of the sketch + core::Ptr boundingBox() const; + + /// Returns the sketch text collection associated with this sketch. + /// This provides access to existing text and supports the creation + /// of new text. + core::Ptr sketchTexts() const; + + /// Returns the sketch point that was automatically created by projecting the + /// origin construction point into the sketch. + core::Ptr originPoint() const; + + /// Indicates if this sketch is fully constrained. + bool isFullyConstrained() const; + + /// Changes which plane the sketch is based on. + /// planarEntity : A construction plane or planar face that defines the sketch plane + /// Returns true if the operation was successful. + bool redefine(const core::Ptr& planarEntity); + + /// Returns the collection of attributes associated with this face. + core::Ptr attributes() const; + + /// This property returns the base or form feature that this sketch is associated with. It returns + /// null in the case where the sketch is parametrically defined and is not related to a base or form + /// feature. It also returns null in the case where the modeling design history is not being captured (direct edit model). + core::Ptr baseOrFormFeature() const; + + /// Returns the current health state of this sketch. + FeatureHealthStates healthState() const; + + /// Returns the error or warning message in the case where the healthState property returns either + /// WarningFeatureHealthState or ErrorFeatureHealthState. Otherwise this property returns an empty string. + std::string errorOrWarningMessage() const; + + /// Intersects the specified entities (BRepBody, BRepFace, BRepEdge, BRepVertex, SketchCurve, ConstructionPoint, + /// ConstructionAxis, and ConstructionPlane) with the sketch plane and creates sketch geometry that represents + /// the intersection. + /// entities : An array containing the entities to intersect with the sketch plane. + /// An array returning the sketch entities that were created as a result of the + /// intersections. It's possible that this can come back empty in the case where the input + /// entities don't intersect the sketch plane. + std::vector> intersectWithSketchPlane(const std::vector>& entities); + + /// Projects the specified set of curves onto the specified set of faces using the specified method of projection. + /// if the projection type is along a vector, then the directionEntity argument must be supplied. if the projectionType + /// is the closest point method, the directionEntity argument is ignored. + /// faces : An array of BRepFace objects that the curves will be projected onto. + /// curves : An array of various curve objects that will be projected onto the faces. The curves can be sketch curves and points, + /// BRepEdge objects, ConstructionAxis objects, and ConstructionPoint objects. + /// projectType : Specifies which projection type to use which defines the direction of projection. If this is set to AlongVectorSurfaceProjectType + /// the directionEntity argument must be provided. + /// directionEntity : if the projectType argument is AlongVectorSurfaceProjectType, this argument must be specified and defines the + /// direction of projection. It can be a linear BRepEdge, a BRepFace where the normal will be used, a SketchLine, or + /// a ConstructionLine. + /// Returns an array of the sketch entities that were created as a result of projection the specified curves onto + /// the faces. + std::vector> projectToSurface(const std::vector>& faces, const std::vector>& curves, SurfaceProjectTypes projectType, const core::Ptr& directionEntity = core::Ptr()); + + /// Returns the current revision ID of the sketch. This ID changes any time the sketch is modified in any way. By getting + /// and saving the ID when you create any data that is dependent on the sketch, you can then compare the saved + /// ID with the current ID to determine if the sketch has changed to know if you should update your data. + std::string revisionId() const; + + /// Indicates if the constraints of the sketch are displayed when the sketch is active. + bool areConstraintsShown() const; + bool areConstraintsShown(bool value); + + /// Indicates if the sketch points in the sketch are displayed. Points that are not connected to any other + /// geometry will continue to be shown. + bool arePointsShown() const; + bool arePointsShown(bool value); + + /// Gets and set if the light bulb beside the sketch node in the + /// browser is on or not. Parent nodes in the browser can have their light + /// bulb off which affects all of their children so this property does not + /// indicate if the body is actually visible, just that it should be visible + /// if all of it's parent nodes are also visible. Use the isVisible property + /// to determine if it's actually visible. + bool isLightBulbOn() const; + bool isLightBulbOn(bool value); + + /// Returns a token for the Sketch object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same token. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_SKETCH_API static const char* classType(); + ADSK_FUSION_SKETCH_API const char* objectType() const override; + ADSK_FUSION_SKETCH_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCH_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual SketchPoints* sketchPoints_raw() const = 0; + virtual SketchCurves* sketchCurves_raw() const = 0; + virtual SketchDimensions* sketchDimensions_raw() const = 0; + virtual GeometricConstraints* geometricConstraints_raw() const = 0; + virtual core::ObjectCollection* project_raw(core::Base* entity) = 0; + virtual core::ObjectCollection* projectCutEdges_raw(BRepBody* body) = 0; + virtual core::ObjectCollection* include_raw(core::Base* entity) = 0; + virtual core::ObjectCollection* findConnectedCurves_raw(SketchCurve* curve) = 0; + virtual core::ObjectCollection* offset_raw(core::ObjectCollection* curves, core::Point3D* directionPoint, double offset) = 0; + virtual core::Matrix3D* transform_raw() const = 0; + virtual bool transform_raw(core::Matrix3D* value) = 0; + virtual core::Point3D* modelToSketchSpace_raw(core::Point3D* modelCoordinate) = 0; + virtual core::Point3D* sketchToModelSpace_raw(core::Point3D* sketchCoordinate) = 0; + virtual bool isParametric_raw() const = 0; + virtual bool isVisible_raw() const = 0; + virtual bool isVisible_raw(bool value) = 0; + virtual bool areDimensionsShown_raw() const = 0; + virtual bool areDimensionsShown_raw(bool value) = 0; + virtual bool areProfilesShown_raw() const = 0; + virtual bool areProfilesShown_raw(bool value) = 0; + virtual core::Point3D* origin_raw() const = 0; + virtual core::Vector3D* xDirection_raw() const = 0; + virtual core::Vector3D* yDirection_raw() const = 0; + virtual core::Base* referencePlane_raw() const = 0; + virtual bool referencePlane_raw(core::Base* value) = 0; + virtual bool isComputeDeferred_raw() const = 0; + virtual bool isComputeDeferred_raw(bool value) = 0; + virtual bool move_raw(core::ObjectCollection* sketchEntities, core::Matrix3D* transform) = 0; + virtual core::ObjectCollection* copy_raw(core::ObjectCollection* sketchEntities, core::Matrix3D* transform, Sketch* targetSketch) = 0; + virtual Profiles* profiles_raw() const = 0; + virtual bool deleteMe_raw() = 0; + virtual bool saveAsDXF_raw(const char * fullFilename) = 0; + virtual bool importSVG_raw(const char * fullFilename, double xPosition, double yPosition, double scale) = 0; + virtual TimelineObject* timelineObject_raw() const = 0; + virtual Component* parentComponent_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual Sketch* nativeObject_raw() const = 0; + virtual Sketch* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual SketchTexts* sketchTexts_raw() const = 0; + virtual SketchPoint* originPoint_raw() const = 0; + virtual bool isFullyConstrained_raw() const = 0; + virtual bool redefine_raw(core::Base* planarEntity) = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual core::Base* baseOrFormFeature_raw() const = 0; + virtual FeatureHealthStates healthState_raw() const = 0; + virtual char* errorOrWarningMessage_raw() const = 0; + virtual SketchEntity** intersectWithSketchPlane_raw(core::Base** entities, size_t entities_size, size_t& return_size) = 0; + virtual SketchEntity** projectToSurface_raw(BRepFace** faces, size_t faces_size, core::Base** curves, size_t curves_size, SurfaceProjectTypes projectType, core::Base* directionEntity, size_t& return_size) = 0; + virtual char* revisionId_raw() const = 0; + virtual bool areConstraintsShown_raw() const = 0; + virtual bool areConstraintsShown_raw(bool value) = 0; + virtual bool arePointsShown_raw() const = 0; + virtual bool arePointsShown_raw(bool value) = 0; + virtual bool isLightBulbOn_raw() const = 0; + virtual bool isLightBulbOn_raw(bool value) = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline std::string Sketch::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool Sketch::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline core::Ptr Sketch::sketchPoints() const +{ + core::Ptr res = sketchPoints_raw(); + return res; +} + +inline core::Ptr Sketch::sketchCurves() const +{ + core::Ptr res = sketchCurves_raw(); + return res; +} + +inline core::Ptr Sketch::sketchDimensions() const +{ + core::Ptr res = sketchDimensions_raw(); + return res; +} + +inline core::Ptr Sketch::geometricConstraints() const +{ + core::Ptr res = geometricConstraints_raw(); + return res; +} + +inline core::Ptr Sketch::project(const core::Ptr& entity) +{ + core::Ptr res = project_raw(entity.get()); + return res; +} + +inline core::Ptr Sketch::projectCutEdges(const core::Ptr& body) +{ + core::Ptr res = projectCutEdges_raw(body.get()); + return res; +} + +inline core::Ptr Sketch::include(const core::Ptr& entity) +{ + core::Ptr res = include_raw(entity.get()); + return res; +} + +inline core::Ptr Sketch::findConnectedCurves(const core::Ptr& curve) +{ + core::Ptr res = findConnectedCurves_raw(curve.get()); + return res; +} + +inline core::Ptr Sketch::offset(const core::Ptr& curves, const core::Ptr& directionPoint, double offset) +{ + core::Ptr res = offset_raw(curves.get(), directionPoint.get(), offset); + return res; +} + +inline core::Ptr Sketch::transform() const +{ + core::Ptr res = transform_raw(); + return res; +} + +inline bool Sketch::transform(const core::Ptr& value) +{ + return transform_raw(value.get()); +} + +inline core::Ptr Sketch::modelToSketchSpace(const core::Ptr& modelCoordinate) +{ + core::Ptr res = modelToSketchSpace_raw(modelCoordinate.get()); + return res; +} + +inline core::Ptr Sketch::sketchToModelSpace(const core::Ptr& sketchCoordinate) +{ + core::Ptr res = sketchToModelSpace_raw(sketchCoordinate.get()); + return res; +} + +inline bool Sketch::isParametric() const +{ + bool res = isParametric_raw(); + return res; +} + +inline bool Sketch::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline bool Sketch::isVisible(bool value) +{ + return isVisible_raw(value); +} + +inline bool Sketch::areDimensionsShown() const +{ + bool res = areDimensionsShown_raw(); + return res; +} + +inline bool Sketch::areDimensionsShown(bool value) +{ + return areDimensionsShown_raw(value); +} + +inline bool Sketch::areProfilesShown() const +{ + bool res = areProfilesShown_raw(); + return res; +} + +inline bool Sketch::areProfilesShown(bool value) +{ + return areProfilesShown_raw(value); +} + +inline core::Ptr Sketch::origin() const +{ + core::Ptr res = origin_raw(); + return res; +} + +inline core::Ptr Sketch::xDirection() const +{ + core::Ptr res = xDirection_raw(); + return res; +} + +inline core::Ptr Sketch::yDirection() const +{ + core::Ptr res = yDirection_raw(); + return res; +} + +inline core::Ptr Sketch::referencePlane() const +{ + core::Ptr res = referencePlane_raw(); + return res; +} + +inline bool Sketch::referencePlane(const core::Ptr& value) +{ + return referencePlane_raw(value.get()); +} + +inline bool Sketch::isComputeDeferred() const +{ + bool res = isComputeDeferred_raw(); + return res; +} + +inline bool Sketch::isComputeDeferred(bool value) +{ + return isComputeDeferred_raw(value); +} + +inline bool Sketch::move(const core::Ptr& sketchEntities, const core::Ptr& transform) +{ + bool res = move_raw(sketchEntities.get(), transform.get()); + return res; +} + +inline core::Ptr Sketch::copy(const core::Ptr& sketchEntities, const core::Ptr& transform, const core::Ptr& targetSketch) +{ + core::Ptr res = copy_raw(sketchEntities.get(), transform.get(), targetSketch.get()); + return res; +} + +inline core::Ptr Sketch::profiles() const +{ + core::Ptr res = profiles_raw(); + return res; +} + +inline bool Sketch::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline bool Sketch::saveAsDXF(const std::string& fullFilename) +{ + bool res = saveAsDXF_raw(fullFilename.c_str()); + return res; +} + +inline bool Sketch::importSVG(const std::string& fullFilename, double xPosition, double yPosition, double scale) +{ + bool res = importSVG_raw(fullFilename.c_str(), xPosition, yPosition, scale); + return res; +} + +inline core::Ptr Sketch::timelineObject() const +{ + core::Ptr res = timelineObject_raw(); + return res; +} + +inline core::Ptr Sketch::parentComponent() const +{ + core::Ptr res = parentComponent_raw(); + return res; +} + +inline core::Ptr Sketch::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline core::Ptr Sketch::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr Sketch::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr Sketch::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline core::Ptr Sketch::sketchTexts() const +{ + core::Ptr res = sketchTexts_raw(); + return res; +} + +inline core::Ptr Sketch::originPoint() const +{ + core::Ptr res = originPoint_raw(); + return res; +} + +inline bool Sketch::isFullyConstrained() const +{ + bool res = isFullyConstrained_raw(); + return res; +} + +inline bool Sketch::redefine(const core::Ptr& planarEntity) +{ + bool res = redefine_raw(planarEntity.get()); + return res; +} + +inline core::Ptr Sketch::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline core::Ptr Sketch::baseOrFormFeature() const +{ + core::Ptr res = baseOrFormFeature_raw(); + return res; +} + +inline FeatureHealthStates Sketch::healthState() const +{ + FeatureHealthStates res = healthState_raw(); + return res; +} + +inline std::string Sketch::errorOrWarningMessage() const +{ + std::string res; + + char* p= errorOrWarningMessage_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> Sketch::intersectWithSketchPlane(const std::vector>& entities) +{ + std::vector> res; + size_t s; + core::Base** entities_ = new core::Base*[entities.size()]; + for(size_t i=0; i> Sketch::projectToSurface(const std::vector>& faces, const std::vector>& curves, SurfaceProjectTypes projectType, const core::Ptr& directionEntity) +{ + std::vector> res; + size_t s; + BRepFace** faces_ = new BRepFace*[faces.size()]; + for(size_t i=0; i lineOne() const; + + /// The second line being constrained. + core::Ptr lineTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHANGULARDIMENSION_API static const char* classType(); + ADSK_FUSION_SKETCHANGULARDIMENSION_API const char* objectType() const override; + ADSK_FUSION_SKETCHANGULARDIMENSION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHANGULARDIMENSION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLine* lineOne_raw() const = 0; + virtual SketchLine* lineTwo_raw() const = 0; + virtual SketchAngularDimension* nativeObject_raw() const = 0; + virtual SketchAngularDimension* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchAngularDimension::lineOne() const +{ + core::Ptr res = lineOne_raw(); + return res; +} + +inline core::Ptr SketchAngularDimension::lineTwo() const +{ + core::Ptr res = lineTwo_raw(); + return res; +} + +inline core::Ptr SketchAngularDimension::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchAngularDimension::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHANGULARDIMENSION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchArc.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchArc.h new file mode 100644 index 0000000..ac715a0 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchArc.h @@ -0,0 +1,159 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchCurve.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHARC_CPP__ +# define ADSK_FUSION_SKETCHARC_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHARC_API +# endif +#else +# define ADSK_FUSION_SKETCHARC_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchPoint; +}} +namespace adsk { namespace core { + class Arc3D; +}} + +namespace adsk { namespace fusion { + +/// An arc in a sketch. +class SketchArc : public SketchCurve { +public: + + /// The sketch point at the center of the arc. The arc is dependent on this point and moving the + /// point will cause the arc to adjust. + core::Ptr centerSketchPoint() const; + + /// The sketch point at the start of the arc. The arc is dependent on this point and moving the + /// point will cause the arc to adjust. + core::Ptr startSketchPoint() const; + + /// The sketch point at the end of the arc. The arc is dependent on this point and moving the + /// point will cause the arc to adjust. + core::Ptr endSketchPoint() const; + + /// Gets and sets the radius of the arc. Changing the radius is limited + /// by any constraints that might exist on the circle. Setting the radius + /// can fail in cases where the radius is fully defined through constraints. + double radius() const; + bool radius(double value); + + /// Returns the transient geometry of the arc which provides geometric + /// information about the arc. The returned geometry is always in sketch space. + core::Ptr geometry() const; + + /// Returns an Arc3D object which provides geometric information in world space. + /// The returned geometry takes into account the assembly context and the position of the + /// sketch in it's parent component, which means the geometry will be returned in the root + /// component space. + core::Ptr worldGeometry() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHARC_API static const char* classType(); + ADSK_FUSION_SKETCHARC_API const char* objectType() const override; + ADSK_FUSION_SKETCHARC_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHARC_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* centerSketchPoint_raw() const = 0; + virtual SketchPoint* startSketchPoint_raw() const = 0; + virtual SketchPoint* endSketchPoint_raw() const = 0; + virtual double radius_raw() const = 0; + virtual bool radius_raw(double value) = 0; + virtual core::Arc3D* geometry_raw() const = 0; + virtual core::Arc3D* worldGeometry_raw() const = 0; + virtual SketchArc* nativeObject_raw() const = 0; + virtual SketchArc* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchArc::centerSketchPoint() const +{ + core::Ptr res = centerSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchArc::startSketchPoint() const +{ + core::Ptr res = startSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchArc::endSketchPoint() const +{ + core::Ptr res = endSketchPoint_raw(); + return res; +} + +inline double SketchArc::radius() const +{ + double res = radius_raw(); + return res; +} + +inline bool SketchArc::radius(double value) +{ + return radius_raw(value); +} + +inline core::Ptr SketchArc::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr SketchArc::worldGeometry() const +{ + core::Ptr res = worldGeometry_raw(); + return res; +} + +inline core::Ptr SketchArc::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchArc::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHARC_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchArcs.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchArcs.h new file mode 100644 index 0000000..b3df685 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchArcs.h @@ -0,0 +1,140 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHARCS_CPP__ +# define ADSK_FUSION_SKETCHARCS_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHARCS_API +# endif +#else +# define ADSK_FUSION_SKETCHARCS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchArc; + class SketchCurve; +}} +namespace adsk { namespace core { + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// The collection of arcs in a sketch. This provides access to the existing +/// arcs and supports the methods to create new arcs. +class SketchArcs : public core::Base { +public: + + /// Function that returns the specified sketch arc using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of arcs in the sketch. + size_t count() const; + + /// Creates a sketch arc that is always parallel to the x-y plane of the sketch + /// and is centered at the specified point. + /// centerPoint : The center point of the arc. This can be either an existing SketchPoint or a Point3D object. + /// startPoint : The start point of the arc. The distance between this point and the center defines the radius + /// of the arc. This can be either an existing SketchPoint or a Point3D object. + /// sweepAngle : The sweep of the arc. This is defined in radians and a positive value defines a counter-clockwise sweep. + /// Returns the newly created SketchArc object or null if the creation failed. + core::Ptr addByCenterStartSweep(const core::Ptr& centerPoint, const core::Ptr& startPoint, double sweepAngle); + + /// Creates a sketch arc that passes through the three points. + /// startPoint : The start point of the arc. This can be either an existing SketchPoint or a Point3D object. + /// point : A point along the arc. This is a Point3D object. + /// endPoint : The end point of the arc. This can be either an existing SketchPoint or a Point3D object. + /// Returns the newly created SketchArc or null in the case of a failure. + core::Ptr addByThreePoints(const core::Ptr& startPoint, const core::Ptr& point, const core::Ptr& endPoint); + + /// Creates a fillet between two sketch entities + /// The side (quadrant) the fillet is created on is determined by the points specified. + /// The point for each entity can be its startSketchPoint or endSketchPoint + /// firstEntity : The first curve for the fillet definition. The curve must be open. + /// firstEntityPoint : A point on or closer to one end of the first curve that indicates the side to create the fillet on + /// secondEnitity : The second curve for the fillet definition. The curve must be open. + /// secondEntityPoint : A point on or closer to one end of the second curve that indicates the side to create the fillet on + /// radius : radius of the arc in centimeters + /// Returns the newly created SketchArc object (fillet) if the operation was successful or null if it failed. + core::Ptr addFillet(const core::Ptr& firstEntity, const core::Ptr& firstEntityPoint, const core::Ptr& secondEnitity, const core::Ptr& secondEntityPoint, double radius); + + typedef SketchArc iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHARCS_API static const char* classType(); + ADSK_FUSION_SKETCHARCS_API const char* objectType() const override; + ADSK_FUSION_SKETCHARCS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHARCS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchArc* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SketchArc* addByCenterStartSweep_raw(core::Base* centerPoint, core::Base* startPoint, double sweepAngle) = 0; + virtual SketchArc* addByThreePoints_raw(core::Base* startPoint, core::Point3D* point, core::Base* endPoint) = 0; + virtual SketchArc* addFillet_raw(SketchCurve* firstEntity, core::Point3D* firstEntityPoint, SketchCurve* secondEnitity, core::Point3D* secondEntityPoint, double radius) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchArcs::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchArcs::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SketchArcs::addByCenterStartSweep(const core::Ptr& centerPoint, const core::Ptr& startPoint, double sweepAngle) +{ + core::Ptr res = addByCenterStartSweep_raw(centerPoint.get(), startPoint.get(), sweepAngle); + return res; +} + +inline core::Ptr SketchArcs::addByThreePoints(const core::Ptr& startPoint, const core::Ptr& point, const core::Ptr& endPoint) +{ + core::Ptr res = addByThreePoints_raw(startPoint.get(), point.get(), endPoint.get()); + return res; +} + +inline core::Ptr SketchArcs::addFillet(const core::Ptr& firstEntity, const core::Ptr& firstEntityPoint, const core::Ptr& secondEnitity, const core::Ptr& secondEntityPoint, double radius) +{ + core::Ptr res = addFillet_raw(firstEntity.get(), firstEntityPoint.get(), secondEnitity.get(), secondEntityPoint.get(), radius); + return res; +} + +template inline void SketchArcs::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHARCS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchCircle.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchCircle.h new file mode 100644 index 0000000..953b175 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchCircle.h @@ -0,0 +1,145 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchCurve.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHCIRCLE_CPP__ +# define ADSK_FUSION_SKETCHCIRCLE_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHCIRCLE_API +# endif +#else +# define ADSK_FUSION_SKETCHCIRCLE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchPoint; +}} +namespace adsk { namespace core { + class Circle3D; +}} + +namespace adsk { namespace fusion { + +/// A circle in a sketch. +class SketchCircle : public SketchCurve { +public: + + /// Returns the sketch point at the center of the circle. + core::Ptr centerSketchPoint() const; + + /// Returns the transient geometry of the circle which provides geometric + /// information about the circle. The returned geometry is always in sketch space. + core::Ptr geometry() const; + + /// Returns a Point3D object which provides the position of the sketch point in world space. + /// The returned coordinate takes into account the assembly context and the position of the + /// sketch in it's parent component, which means the coordinate will be returned in the root + /// component space. + core::Ptr worldGeometry() const; + + /// Returns the area of the circle in square centimeters. + double area() const; + + /// Gets and sets the radius of the circle. Changing the radius is limited + /// by any constraints that might exist on the circle. + double radius() const; + bool radius(double value); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHCIRCLE_API static const char* classType(); + ADSK_FUSION_SKETCHCIRCLE_API const char* objectType() const override; + ADSK_FUSION_SKETCHCIRCLE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHCIRCLE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* centerSketchPoint_raw() const = 0; + virtual core::Circle3D* geometry_raw() const = 0; + virtual core::Circle3D* worldGeometry_raw() const = 0; + virtual double area_raw() const = 0; + virtual double radius_raw() const = 0; + virtual bool radius_raw(double value) = 0; + virtual SketchCircle* nativeObject_raw() const = 0; + virtual SketchCircle* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchCircle::centerSketchPoint() const +{ + core::Ptr res = centerSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchCircle::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr SketchCircle::worldGeometry() const +{ + core::Ptr res = worldGeometry_raw(); + return res; +} + +inline double SketchCircle::area() const +{ + double res = area_raw(); + return res; +} + +inline double SketchCircle::radius() const +{ + double res = radius_raw(); + return res; +} + +inline bool SketchCircle::radius(double value) +{ + return radius_raw(value); +} + +inline core::Ptr SketchCircle::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchCircle::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHCIRCLE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchCircles.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchCircles.h new file mode 100644 index 0000000..89741ce --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchCircles.h @@ -0,0 +1,185 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHCIRCLES_CPP__ +# define ADSK_FUSION_SKETCHCIRCLES_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHCIRCLES_API +# endif +#else +# define ADSK_FUSION_SKETCHCIRCLES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchCircle; + class SketchLine; +}} +namespace adsk { namespace core { + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// The collection of circles in a sketch. This provides access to the existing +/// circles and supports the methods to create new circles. +class SketchCircles : public core::Base { +public: + + /// Function that returns the specified sketch circle using an index into the collection. + /// index : The index of the item within the collection to return. + /// The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of circles in the sketch. + size_t count() const; + + /// Creates a sketch circle that is always parallel to the x-y plane of the sketch + /// and is centered at the specified point. + /// centerPoint : The center point of the circle. It can be an existing SketchPoint or a Point3D object. + /// radius : The radius of the circle in centimeters. + /// Returns the newly created SketchCircle object or null if the creation failed. + core::Ptr addByCenterRadius(const core::Ptr& centerPoint, double radius); + + /// Creates a sketch circle where the circle passes through the two points and the + /// distance between the two points is the diameter of the circle. + /// pointOne : A Point3D object that defines a point is sketch space and lies on the x-y plane of the sketch. + /// pointTwo : A Point3D object that defines a point is sketch space and lies on the x-y plane of the sketch. + /// Returns the newly created SketchCircle object or null if the creation failed. + core::Ptr addByTwoPoints(const core::Ptr& pointOne, const core::Ptr& pointTwo); + + /// Creates a sketch circle that passes through the three points. The three points must + /// lie on the x-y plane of the sketch. + /// pointOne : The first point that the circle will pass through. The z component must be zero. + /// pointTwo : The second point that the circle will pass through. The z component must be zero. + /// pointThree : The third point that the circle will pass through. The z component must be zero. + /// Returns the newly created SketchCircle object or null if the creation failed. + core::Ptr addByThreePoints(const core::Ptr& pointOne, const core::Ptr& pointTwo, const core::Ptr& pointThree); + + /// Creates a sketch circle that is tangent to the two input lines. + /// The two lines must lie on the x-y plane of the sketch. + /// tangentOne : The first line that the circle will be tangent to. + /// The line must lie on the x-y plane of the sketch. + /// tangentTwo : The second line that the circle will be tangent to. + /// The line must lie on the x-y plane of the sketch and cannot + /// be parallel to the first line. + /// radius : The radius of the circle in centimeters. + /// hintPoint : A point that specifies which of the possible four solutions to use + /// when creating the circle. If you consider the two input lines to be infinite + /// they create four quadrants which results in four possible solutions for the + /// creation of the circle. The hint point is a point anywhere within the quadrant + /// where you want the circle created. + /// Returns the newly created SketchCircle object or null if the creation failed. + core::Ptr addByTwoTangents(const core::Ptr& tangentOne, const core::Ptr& tangentTwo, double radius, const core::Ptr& hintPoint); + + /// Creates a sketch circle that is tangent to the three input lines. + /// The three lines must lie on the x-y plane of the sketch. + /// tangentOne : The first line that the circle will be tangent to. + /// The line must lie on the x-y plane of the sketch and cannot be parallel + /// to the second or third line. + /// tangentTwo : The second line that the circle will be tangent to. + /// The line must lie on the x-y plane of the sketch and cannot be parallel + /// to the first or third line. + /// tangentThree : The third line that the circle will be tangent to. + /// The line must lie on the x-y plane of the sketch and cannot be parallel + /// to the first or second line. + /// hintPoint : A point that specifies which of the possible multiple solutions to use + /// when creating the circle. If you consider the three input lines to be infinite + /// there are many possible solutions when creating a circle that is tangent to all + /// three lines. The hint point is a point anywhere within the area defined by the + /// three lines where the circle is to be created. + /// Returns the newly created SketchCircle object or null if the creation failed. + core::Ptr addByThreeTangents(const core::Ptr& tangentOne, const core::Ptr& tangentTwo, const core::Ptr& tangentThree, const core::Ptr& hintPoint); + + typedef SketchCircle iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHCIRCLES_API static const char* classType(); + ADSK_FUSION_SKETCHCIRCLES_API const char* objectType() const override; + ADSK_FUSION_SKETCHCIRCLES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHCIRCLES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCircle* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SketchCircle* addByCenterRadius_raw(core::Base* centerPoint, double radius) = 0; + virtual SketchCircle* addByTwoPoints_raw(core::Point3D* pointOne, core::Point3D* pointTwo) = 0; + virtual SketchCircle* addByThreePoints_raw(core::Point3D* pointOne, core::Point3D* pointTwo, core::Point3D* pointThree) = 0; + virtual SketchCircle* addByTwoTangents_raw(SketchLine* tangentOne, SketchLine* tangentTwo, double radius, core::Point3D* hintPoint) = 0; + virtual SketchCircle* addByThreeTangents_raw(SketchLine* tangentOne, SketchLine* tangentTwo, SketchLine* tangentThree, core::Point3D* hintPoint) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchCircles::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchCircles::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SketchCircles::addByCenterRadius(const core::Ptr& centerPoint, double radius) +{ + core::Ptr res = addByCenterRadius_raw(centerPoint.get(), radius); + return res; +} + +inline core::Ptr SketchCircles::addByTwoPoints(const core::Ptr& pointOne, const core::Ptr& pointTwo) +{ + core::Ptr res = addByTwoPoints_raw(pointOne.get(), pointTwo.get()); + return res; +} + +inline core::Ptr SketchCircles::addByThreePoints(const core::Ptr& pointOne, const core::Ptr& pointTwo, const core::Ptr& pointThree) +{ + core::Ptr res = addByThreePoints_raw(pointOne.get(), pointTwo.get(), pointThree.get()); + return res; +} + +inline core::Ptr SketchCircles::addByTwoTangents(const core::Ptr& tangentOne, const core::Ptr& tangentTwo, double radius, const core::Ptr& hintPoint) +{ + core::Ptr res = addByTwoTangents_raw(tangentOne.get(), tangentTwo.get(), radius, hintPoint.get()); + return res; +} + +inline core::Ptr SketchCircles::addByThreeTangents(const core::Ptr& tangentOne, const core::Ptr& tangentTwo, const core::Ptr& tangentThree, const core::Ptr& hintPoint) +{ + core::Ptr res = addByThreeTangents_raw(tangentOne.get(), tangentTwo.get(), tangentThree.get(), hintPoint.get()); + return res; +} + +template inline void SketchCircles::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHCIRCLES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchConcentricCircleDimension.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchConcentricCircleDimension.h new file mode 100644 index 0000000..2e14e52 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchConcentricCircleDimension.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchDimension.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHCONCENTRICCIRCLEDIMENSION_CPP__ +# define ADSK_FUSION_SKETCHCONCENTRICCIRCLEDIMENSION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHCONCENTRICCIRCLEDIMENSION_API +# endif +#else +# define ADSK_FUSION_SKETCHCONCENTRICCIRCLEDIMENSION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; +}} + +namespace adsk { namespace fusion { + +/// A concentric circle dimension in a sketch. +class SketchConcentricCircleDimension : public SketchDimension { +public: + + /// Returns the first concentric circle or arc. + core::Ptr circleOne() const; + + /// Returns the second concentric circle or arc. + core::Ptr circleTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHCONCENTRICCIRCLEDIMENSION_API static const char* classType(); + ADSK_FUSION_SKETCHCONCENTRICCIRCLEDIMENSION_API const char* objectType() const override; + ADSK_FUSION_SKETCHCONCENTRICCIRCLEDIMENSION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHCONCENTRICCIRCLEDIMENSION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve* circleOne_raw() const = 0; + virtual SketchCurve* circleTwo_raw() const = 0; + virtual SketchConcentricCircleDimension* nativeObject_raw() const = 0; + virtual SketchConcentricCircleDimension* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchConcentricCircleDimension::circleOne() const +{ + core::Ptr res = circleOne_raw(); + return res; +} + +inline core::Ptr SketchConcentricCircleDimension::circleTwo() const +{ + core::Ptr res = circleTwo_raw(); + return res; +} + +inline core::Ptr SketchConcentricCircleDimension::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchConcentricCircleDimension::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHCONCENTRICCIRCLEDIMENSION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchConicCurve.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchConicCurve.h new file mode 100644 index 0000000..ad66dfc --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchConicCurve.h @@ -0,0 +1,153 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchCurve.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHCONICCURVE_CPP__ +# define ADSK_FUSION_SKETCHCONICCURVE_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHCONICCURVE_API +# endif +#else +# define ADSK_FUSION_SKETCHCONICCURVE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchPoint; +}} +namespace adsk { namespace core { + class CurveEvaluator3D; + class NurbsCurve3D; +}} + +namespace adsk { namespace fusion { + +/// The SketchConicCurve class represents conic curves in a sketch. +class SketchConicCurve : public SketchCurve { +public: + + /// The sketch point at the start of the curve. + core::Ptr startSketchPoint() const; + + /// The sketch point at the end of the curve. + core::Ptr endSketchPoint() const; + + /// The sketch point at the apex of the conic curve. + core::Ptr apexSketchPoint() const; + + /// Returns the transient geometry of the curve which provides geometric + /// information about the curve. The returned geometry is always in sketch space. + /// Because the fixed spline can be analytically defined, for example it + /// can be the precise intersection of a surface and the sketch plane, + /// returning a NURBS curve that represents the spline may be an + /// approximation of the actual curve. You can use the Evaluator + /// property of the SketchFixedSpline object to perform evaluations + /// on the precise curve. + core::Ptr geometry() const; + + /// Returns a NurbsCurve3D object that is the equivalent of this sketch curve + /// but is in the space of the parent component rather than in sketch space. + core::Ptr worldGeometry() const; + + /// Returns an evaluator object that lets you perform evaluations + /// on the precise geometry of the curve. + core::Ptr evaluator() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHCONICCURVE_API static const char* classType(); + ADSK_FUSION_SKETCHCONICCURVE_API const char* objectType() const override; + ADSK_FUSION_SKETCHCONICCURVE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHCONICCURVE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* startSketchPoint_raw() const = 0; + virtual SketchPoint* endSketchPoint_raw() const = 0; + virtual SketchPoint* apexSketchPoint_raw() const = 0; + virtual core::NurbsCurve3D* geometry_raw() const = 0; + virtual core::NurbsCurve3D* worldGeometry_raw() const = 0; + virtual core::CurveEvaluator3D* evaluator_raw() const = 0; + virtual SketchConicCurve* nativeObject_raw() const = 0; + virtual SketchConicCurve* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchConicCurve::startSketchPoint() const +{ + core::Ptr res = startSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchConicCurve::endSketchPoint() const +{ + core::Ptr res = endSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchConicCurve::apexSketchPoint() const +{ + core::Ptr res = apexSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchConicCurve::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr SketchConicCurve::worldGeometry() const +{ + core::Ptr res = worldGeometry_raw(); + return res; +} + +inline core::Ptr SketchConicCurve::evaluator() const +{ + core::Ptr res = evaluator_raw(); + return res; +} + +inline core::Ptr SketchConicCurve::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchConicCurve::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHCONICCURVE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchConicCurves.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchConicCurves.h new file mode 100644 index 0000000..393ef1f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchConicCurves.h @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHCONICCURVES_CPP__ +# define ADSK_FUSION_SKETCHCONICCURVES_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHCONICCURVES_API +# endif +#else +# define ADSK_FUSION_SKETCHCONICCURVES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchConicCurve; +}} + +namespace adsk { namespace fusion { + +/// The collection of conic curves in a sketch. This provides access to the existing +/// conic curves and supports the method to create new conic curves. +class SketchConicCurves : public core::Base { +public: + + /// Function that returns the specified conic curve using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of conic curves in the sketch. + size_t count() const; + + typedef SketchConicCurve iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHCONICCURVES_API static const char* classType(); + ADSK_FUSION_SKETCHCONICCURVES_API const char* objectType() const override; + ADSK_FUSION_SKETCHCONICCURVES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHCONICCURVES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchConicCurve* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchConicCurves::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchConicCurves::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void SketchConicCurves::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHCONICCURVES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchCurve.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchCurve.h new file mode 100644 index 0000000..9183847 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchCurve.h @@ -0,0 +1,191 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchEntity.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHCURVE_CPP__ +# define ADSK_FUSION_SKETCHCURVE_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHCURVE_API +# endif +#else +# define ADSK_FUSION_SKETCHCURVE_API XI_IMPORT +#endif + +namespace adsk { namespace core { + class ObjectCollection; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// A single sketch curve. This is the base class for the specific curve types. +class SketchCurve : public SketchEntity { +public: + + /// Returns the length of the curve in centimeters. + double length() const; + + /// Gets and sets whether this curve is construction geometry. + bool isConstruction() const; + bool isConstruction(bool value); + + /// Split a curve at a position specified along the curve + /// splitPoint : A position (transient Point3D) on the curve that defines the point at which to split the curve + /// createConstraints : Constraints are created by default. Specify false to create no constraints. + /// Returns the resulting 2 curves; the original curve + the newly created curve + /// When split spline the original is deleted and two new curves returned. + /// Empty collection returned if curve is closed. + core::Ptr split(const core::Ptr& splitPoint, bool createConstraints = true); + + /// Trim a curve by specifying a point that determines the segment of the curve to trim away + /// segmentPoint : A point (transient Point3D) on or closest to the segment of the curve to remove. (start, end or middle) + /// The segment of the curve closest to the segmentPoint gets removed + /// createConstraints : Constraints are created by default. Specify false to not create constraints. + /// When trimming the start or end side of a line, unclosed circular or elliptical arc, the original entity is modified and returned + /// When trimming the middle of a line, unclosed circular or elliptical arc the original entity is deleted and two new entities are returned + /// When trimming the start or end of any type of closed curve, the original is deleted and a new curve is returned + /// Any trimming of a spline (open or closed) deletes the original and new spline/s are returned + /// Trimming a curve having no intersections deletes the original and returns an empty collection + core::Ptr trim(const core::Ptr& segmentPoint, bool createConstraints = true); + + /// Breaks a curve into two or three pieces by finding intersections of this curve with all other curves in the + /// sketch and splitting this curve at the nearest intersections to a specified point on the curve. + /// segmentPoint : A point that specifies the segment of the curve that is to be split from the rest of the curve. The nearest + /// intersection(s) to this point define the break location(s). + /// createConstraints : Optional argument that specifies if constraints should be created between the new curve segments. A value of + /// true indicates constraints will be created. + /// All of the curves resulting from the break are returned in an ObjectCollection. In the case where no intersections + /// are found and as a result the curve is not broken, an empty ObjectCollection is returned. + core::Ptr breakCurve(const core::Ptr& segmentPoint, bool createConstraints = true); + + /// Extend a curve by specifying a point that determines the end of the curve to extend + /// endPoint : A point (transient Point3D) on or closest to the end of the curve to extend. (start or end) + /// The end of the curve closest to the endPoint gets extended + /// createConstraints : Constraints are created by default. Specify false to not create constraints. + /// Returns the modified original curve if the start or end of the curve is extended + /// If the extend joins a curve to another, the two original curves are deleted and a new curve is returned + /// If an arc is extended so as to become a circle, the original arc is deleted and a new circle is returned + core::Ptr extend(const core::Ptr& endPoint, bool createConstraints = true); + + /// Get the curves that intersect this curve along with the intersection points (Point3D) + /// sketchCurves : A collection of curves to attempt to find intersections with. + /// Set the value of this parameter to null to use all curves in the sketch for the calculation. + /// intersectingCurves : A collection of the actual intersecting curves + /// intersectionPoints : A collection of intersection points (Point3D) + /// Item numbers in this collection correspond to the item numbers in the intersectingCurves collection. + /// Returns true if the method was successful. It can be successful regardless of whether intersections were found or not. + bool intersections(const core::Ptr& sketchCurves, core::Ptr& intersectingCurves, core::Ptr& intersectionPoints); + + ADSK_FUSION_SKETCHCURVE_API static const char* classType(); + ADSK_FUSION_SKETCHCURVE_API const char* objectType() const override; + ADSK_FUSION_SKETCHCURVE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHCURVE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual double length_raw() const = 0; + virtual bool isConstruction_raw() const = 0; + virtual bool isConstruction_raw(bool value) = 0; + virtual core::ObjectCollection* split_raw(core::Point3D* splitPoint, bool createConstraints) = 0; + virtual core::ObjectCollection* trim_raw(core::Point3D* segmentPoint, bool createConstraints) = 0; + virtual core::ObjectCollection* breakCurve_raw(core::Point3D* segmentPoint, bool createConstraints) = 0; + virtual core::ObjectCollection* extend_raw(core::Point3D* endPoint, bool createConstraints) = 0; + virtual bool intersections_raw(core::ObjectCollection* sketchCurves, core::ObjectCollection*& intersectingCurves, core::ObjectCollection*& intersectionPoints) = 0; + virtual void placeholderSketchCurve0() {} + virtual void placeholderSketchCurve1() {} + virtual void placeholderSketchCurve2() {} + virtual void placeholderSketchCurve3() {} + virtual void placeholderSketchCurve4() {} + virtual void placeholderSketchCurve5() {} + virtual void placeholderSketchCurve6() {} + virtual void placeholderSketchCurve7() {} + virtual void placeholderSketchCurve8() {} + virtual void placeholderSketchCurve9() {} + virtual void placeholderSketchCurve10() {} + virtual void placeholderSketchCurve11() {} + virtual void placeholderSketchCurve12() {} + virtual void placeholderSketchCurve13() {} + virtual void placeholderSketchCurve14() {} + virtual void placeholderSketchCurve15() {} + virtual void placeholderSketchCurve16() {} + virtual void placeholderSketchCurve17() {} + virtual void placeholderSketchCurve18() {} + virtual void placeholderSketchCurve19() {} + virtual void placeholderSketchCurve20() {} + virtual void placeholderSketchCurve21() {} + virtual void placeholderSketchCurve22() {} + virtual void placeholderSketchCurve23() {} +}; + +// Inline wrappers + +inline double SketchCurve::length() const +{ + double res = length_raw(); + return res; +} + +inline bool SketchCurve::isConstruction() const +{ + bool res = isConstruction_raw(); + return res; +} + +inline bool SketchCurve::isConstruction(bool value) +{ + return isConstruction_raw(value); +} + +inline core::Ptr SketchCurve::split(const core::Ptr& splitPoint, bool createConstraints) +{ + core::Ptr res = split_raw(splitPoint.get(), createConstraints); + return res; +} + +inline core::Ptr SketchCurve::trim(const core::Ptr& segmentPoint, bool createConstraints) +{ + core::Ptr res = trim_raw(segmentPoint.get(), createConstraints); + return res; +} + +inline core::Ptr SketchCurve::breakCurve(const core::Ptr& segmentPoint, bool createConstraints) +{ + core::Ptr res = breakCurve_raw(segmentPoint.get(), createConstraints); + return res; +} + +inline core::Ptr SketchCurve::extend(const core::Ptr& endPoint, bool createConstraints) +{ + core::Ptr res = extend_raw(endPoint.get(), createConstraints); + return res; +} + +inline bool SketchCurve::intersections(const core::Ptr& sketchCurves, core::Ptr& intersectingCurves, core::Ptr& intersectionPoints) +{ + core::ObjectCollection* intersectingCurves_ = nullptr; + core::ObjectCollection* intersectionPoints_ = nullptr; + + bool res = intersections_raw(sketchCurves.get(), intersectingCurves_, intersectionPoints_); + intersectingCurves = intersectingCurves_; + intersectionPoints = intersectionPoints_; + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHCURVE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchCurves.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchCurves.h new file mode 100644 index 0000000..08ef504 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchCurves.h @@ -0,0 +1,193 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHCURVES_CPP__ +# define ADSK_FUSION_SKETCHCURVES_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHCURVES_API +# endif +#else +# define ADSK_FUSION_SKETCHCURVES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchArcs; + class SketchCircles; + class SketchConicCurves; + class SketchCurve; + class SketchEllipses; + class SketchEllipticalArcs; + class SketchFittedSplines; + class SketchFixedSplines; + class SketchLines; +}} + +namespace adsk { namespace fusion { + +/// A collection of sketch curves in a sketch. This also provides access to collections +/// for the specific types of curves where you can get the curves based on type and +/// create new curves. +class SketchCurves : public core::Base { +public: + + /// Function that returns the specified sketch curve using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of sketch curves in the sketch. + size_t count() const; + + /// Returns the sketch arcs collection associated with this sketch. + /// This provides access to the existing sketch arcs and supports + /// the creation of new sketch arcs. + core::Ptr sketchArcs() const; + + /// Returns the sketch circles collection associated with this sketch. + /// This provides access to the existing sketch circles and supports + /// the creation of new sketch circles. + core::Ptr sketchCircles() const; + + /// Returns the sketch ellipses collection associated with this sketch. + /// This provides access to the existing sketch ellipses and supports + /// the creation of new sketch ellipses. + core::Ptr sketchEllipses() const; + + /// Returns the sketch elliptical arcs collection associated with this sketch. + /// This provides access to the existing sketch elliptical arcs and supports + /// the creation of new sketch elliptical arcs. + core::Ptr sketchEllipticalArcs() const; + + /// Returns the sketch lines collection associated with this sketch. + /// This provides access to the existing sketch lines and supports + /// the creation of new sketch lines. + core::Ptr sketchLines() const; + + /// Returns the sketch splines collection associated with this sketch. + /// This provides access to the existing sketch splines and supports + /// the creation of new sketch splines. + core::Ptr sketchFittedSplines() const; + + /// Returns the fixed sketch splines collection associated with this sketch. + /// This provides access to the existing fixed sketch splines and supports + /// the creation of new fixed sketch splines. + core::Ptr sketchFixedSplines() const; + + /// Returns the conic curves collection associated with this sketch. + /// This provides access to the existing conic curves and support the + /// creation of new conic curves. + core::Ptr sketchConicCurves() const; + + typedef SketchCurve iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHCURVES_API static const char* classType(); + ADSK_FUSION_SKETCHCURVES_API const char* objectType() const override; + ADSK_FUSION_SKETCHCURVES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHCURVES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SketchArcs* sketchArcs_raw() const = 0; + virtual SketchCircles* sketchCircles_raw() const = 0; + virtual SketchEllipses* sketchEllipses_raw() const = 0; + virtual SketchEllipticalArcs* sketchEllipticalArcs_raw() const = 0; + virtual SketchLines* sketchLines_raw() const = 0; + virtual SketchFittedSplines* sketchFittedSplines_raw() const = 0; + virtual SketchFixedSplines* sketchFixedSplines_raw() const = 0; + virtual SketchConicCurves* sketchConicCurves_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchCurves::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchCurves::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SketchCurves::sketchArcs() const +{ + core::Ptr res = sketchArcs_raw(); + return res; +} + +inline core::Ptr SketchCurves::sketchCircles() const +{ + core::Ptr res = sketchCircles_raw(); + return res; +} + +inline core::Ptr SketchCurves::sketchEllipses() const +{ + core::Ptr res = sketchEllipses_raw(); + return res; +} + +inline core::Ptr SketchCurves::sketchEllipticalArcs() const +{ + core::Ptr res = sketchEllipticalArcs_raw(); + return res; +} + +inline core::Ptr SketchCurves::sketchLines() const +{ + core::Ptr res = sketchLines_raw(); + return res; +} + +inline core::Ptr SketchCurves::sketchFittedSplines() const +{ + core::Ptr res = sketchFittedSplines_raw(); + return res; +} + +inline core::Ptr SketchCurves::sketchFixedSplines() const +{ + core::Ptr res = sketchFixedSplines_raw(); + return res; +} + +inline core::Ptr SketchCurves::sketchConicCurves() const +{ + core::Ptr res = sketchConicCurves_raw(); + return res; +} + +template inline void SketchCurves::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHCURVES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchDiameterDimension.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchDiameterDimension.h new file mode 100644 index 0000000..1d198f3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchDiameterDimension.h @@ -0,0 +1,90 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchDimension.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHDIAMETERDIMENSION_CPP__ +# define ADSK_FUSION_SKETCHDIAMETERDIMENSION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHDIAMETERDIMENSION_API +# endif +#else +# define ADSK_FUSION_SKETCHDIAMETERDIMENSION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; +}} + +namespace adsk { namespace fusion { + +/// An diameter dimension in a sketch. +class SketchDiameterDimension : public SketchDimension { +public: + + /// Returns the arc or circle being constrained. + core::Ptr entity() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHDIAMETERDIMENSION_API static const char* classType(); + ADSK_FUSION_SKETCHDIAMETERDIMENSION_API const char* objectType() const override; + ADSK_FUSION_SKETCHDIAMETERDIMENSION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHDIAMETERDIMENSION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve* entity_raw() const = 0; + virtual SketchDiameterDimension* nativeObject_raw() const = 0; + virtual SketchDiameterDimension* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchDiameterDimension::entity() const +{ + core::Ptr res = entity_raw(); + return res; +} + +inline core::Ptr SketchDiameterDimension::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchDiameterDimension::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHDIAMETERDIMENSION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchDimension.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchDimension.h new file mode 100644 index 0000000..7120575 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchDimension.h @@ -0,0 +1,204 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHDIMENSION_CPP__ +# define ADSK_FUSION_SKETCHDIMENSION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHDIMENSION_API +# endif +#else +# define ADSK_FUSION_SKETCHDIMENSION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class ModelParameter; + class Occurrence; + class Sketch; +}} +namespace adsk { namespace core { + class Attributes; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// The base class for the all sketch dimensions. +class SketchDimension : public core::Base { +public: + + /// Deletes this dimension. The IsDeletable property indicates if this dimension can be deleted. + /// Returns true if the delete was successful. + bool deleteMe(); + + /// Indicates if this dimension is deletable. + bool isDeletable() const; + + /// Gets and sets position of the dimension text. + core::Ptr textPosition() const; + bool textPosition(const core::Ptr& value); + + /// Returns the parent sketch object. + core::Ptr parentSketch() const; + + /// Returns the associated parameter or null if there is no associated parameter. + core::Ptr parameter() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// Gets and sets if the dimension is Driving or is Driven. Setting this property to true for a given dimension + /// may fail if the result would over constrain the sketch. Fusion 360 does not allow over-constrained sketches. + bool isDriving() const; + bool isDriving(bool value); + + /// Returns the collection of attributes associated with this sketch dimension. + core::Ptr attributes() const; + + /// Returns a token for the SketchDimension object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same sketch dimension. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_SKETCHDIMENSION_API static const char* classType(); + ADSK_FUSION_SKETCHDIMENSION_API const char* objectType() const override; + ADSK_FUSION_SKETCHDIMENSION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHDIMENSION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual bool deleteMe_raw() = 0; + virtual bool isDeletable_raw() const = 0; + virtual core::Point3D* textPosition_raw() const = 0; + virtual bool textPosition_raw(core::Point3D* value) = 0; + virtual Sketch* parentSketch_raw() const = 0; + virtual ModelParameter* parameter_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual bool isDriving_raw() const = 0; + virtual bool isDriving_raw(bool value) = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual char* entityToken_raw() const = 0; + virtual void placeholderSketchDimension0() {} + virtual void placeholderSketchDimension1() {} + virtual void placeholderSketchDimension2() {} + virtual void placeholderSketchDimension3() {} + virtual void placeholderSketchDimension4() {} + virtual void placeholderSketchDimension5() {} + virtual void placeholderSketchDimension6() {} + virtual void placeholderSketchDimension7() {} + virtual void placeholderSketchDimension8() {} + virtual void placeholderSketchDimension9() {} + virtual void placeholderSketchDimension10() {} + virtual void placeholderSketchDimension11() {} + virtual void placeholderSketchDimension12() {} + virtual void placeholderSketchDimension13() {} + virtual void placeholderSketchDimension14() {} + virtual void placeholderSketchDimension15() {} + virtual void placeholderSketchDimension16() {} + virtual void placeholderSketchDimension17() {} + virtual void placeholderSketchDimension18() {} + virtual void placeholderSketchDimension19() {} + virtual void placeholderSketchDimension20() {} +}; + +// Inline wrappers + +inline bool SketchDimension::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline bool SketchDimension::isDeletable() const +{ + bool res = isDeletable_raw(); + return res; +} + +inline core::Ptr SketchDimension::textPosition() const +{ + core::Ptr res = textPosition_raw(); + return res; +} + +inline bool SketchDimension::textPosition(const core::Ptr& value) +{ + return textPosition_raw(value.get()); +} + +inline core::Ptr SketchDimension::parentSketch() const +{ + core::Ptr res = parentSketch_raw(); + return res; +} + +inline core::Ptr SketchDimension::parameter() const +{ + core::Ptr res = parameter_raw(); + return res; +} + +inline core::Ptr SketchDimension::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline bool SketchDimension::isDriving() const +{ + bool res = isDriving_raw(); + return res; +} + +inline bool SketchDimension::isDriving(bool value) +{ + return isDriving_raw(value); +} + +inline core::Ptr SketchDimension::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline std::string SketchDimension::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHDIMENSION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchDimensionList.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchDimensionList.h new file mode 100644 index 0000000..6091153 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchDimensionList.h @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHDIMENSIONLIST_CPP__ +# define ADSK_FUSION_SKETCHDIMENSIONLIST_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHDIMENSIONLIST_API +# endif +#else +# define ADSK_FUSION_SKETCHDIMENSIONLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchDimension; +}} + +namespace adsk { namespace fusion { + +/// A list of sketch dimensions. +class SketchDimensionList : public core::Base { +public: + + /// Function that returns the specified sketch dimension using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection + /// has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of sketch dimensions in the sketch. + size_t count() const; + + typedef SketchDimension iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHDIMENSIONLIST_API static const char* classType(); + ADSK_FUSION_SKETCHDIMENSIONLIST_API const char* objectType() const override; + ADSK_FUSION_SKETCHDIMENSIONLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHDIMENSIONLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchDimension* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchDimensionList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchDimensionList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void SketchDimensionList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHDIMENSIONLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchDimensions.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchDimensions.h new file mode 100644 index 0000000..6eed655 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchDimensions.h @@ -0,0 +1,244 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHDIMENSIONS_CPP__ +# define ADSK_FUSION_SKETCHDIMENSIONS_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHDIMENSIONS_API +# endif +#else +# define ADSK_FUSION_SKETCHDIMENSIONS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchAngularDimension; + class SketchConcentricCircleDimension; + class SketchCurve; + class SketchDiameterDimension; + class SketchDimension; + class SketchEllipseMajorRadiusDimension; + class SketchEllipseMinorRadiusDimension; + class SketchEntity; + class SketchLine; + class SketchLinearDimension; + class SketchOffsetDimension; + class SketchPoint; + class SketchRadialDimension; +}} +namespace adsk { namespace core { + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// A collection of the dimensions in a sketch. This object also supports the methods to add +/// new sketch dimensions. +class SketchDimensions : public core::Base { +public: + + /// Function that returns the specified sketch dimension using an index into the + /// collection. + /// index : The index of the item within the collection to return. The first item in the + /// collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of sketch dimensions in the sketch. + size_t count() const; + + /// Creates a new linear dimension constraint between the two input entities. + /// pointOne : The first SketchPoint to dimension to. + /// pointTwo : The second SketchPoint to dimension to.. + /// orientation : The orientation of the dimension. + /// textPoint : A Point3D object that defines the position of the dimension text. + /// isDriving : Optional argument that specifies if a driving (the dimension controls the geometry) + /// or a driven (the geometry controls the dimension) dimension is created. If not provided + /// a driving dimension will be created. + /// Returns the newly created dimension or null if the creation failed. + core::Ptr addDistanceDimension(const core::Ptr& pointOne, const core::Ptr& pointTwo, DimensionOrientations orientation, const core::Ptr& textPoint, bool isDriving = true); + + /// Creates a new linear dimension constraint between the two input entities. The first input + /// entity must be a sketch line. The second entity can be a point or a line that is parallel + /// to the first. The dimension controls the distance as measured perpendicular to the first + /// input line. + /// line : The SketchLine to dimension to. + /// entityTwo : The parallel SketchLine or SketchPoint to dimension to. If a SketchLine is used it must be + /// parallel to the first line. + /// textPoint : A Point3D object that defines the position of the dimension text. + /// isDriving : Optional argument that specifies if a driving (the dimension controls the geometry) + /// or a driven (the geometry controls the dimension) dimension is created. If not provided + /// a driving dimension will be created. + /// Returns the newly created dimension or null if the creation failed. + core::Ptr addOffsetDimension(const core::Ptr& line, const core::Ptr& entityTwo, const core::Ptr& textPoint, bool isDriving = true); + + /// Creates a new angular dimension constraint between the two input lines. + /// The position of the text controls which of the four quadrants will be dimensioned. + /// lineOne : The first SketchLine to dimension to. + /// lineTwo : The second SketchLine to dimension to. + /// textPoint : A Point3D object that defines the position of the dimension text. The position of this + /// text defines which quadrant will be dimensioned. + /// isDriving : Optional argument that specifies if a driving (the dimension controls the geometry) + /// or a driven (the geometry controls the dimension) dimension is created. If not provided + /// a driving dimension will be created. + /// Returns the newly created dimension or null if the creation failed. + core::Ptr addAngularDimension(const core::Ptr& lineOne, const core::Ptr& lineTwo, const core::Ptr& textPoint, bool isDriving = true); + + /// Creates a new diameter dimension constraint on the arc or circle. + /// entity : The SketchCircle or SketchArc to dimension. + /// textPoint : A Point3D object that defines the position of the dimension text. + /// isDriving : Optional argument that specifies if a driving (the dimension controls the geometry) + /// or a driven (the geometry controls the dimension) dimension is created. If not provided + /// a driving dimension will be created. + /// Returns the newly created dimension or null if the creation failed. + core::Ptr addDiameterDimension(const core::Ptr& entity, const core::Ptr& textPoint, bool isDriving = true); + + /// Creates a new radial dimension constraint on the arc or circle. + /// entity : The SketchCircle or SketchArc to dimension. + /// textPoint : A Point3D object that defines the position of the dimension text. + /// isDriving : Optional argument that specifies if a driving (the dimension controls the geometry) + /// or a driven (the geometry controls the dimension) dimension is created. If not provided + /// a driving dimension will be created. + /// Returns the newly created dimension or null if the creation failed. + core::Ptr addRadialDimension(const core::Ptr& entity, const core::Ptr& textPoint, bool isDriving = true); + + /// Creates a new dimension constraint on the major radius of an ellipse. + /// ellipse : The SketchEllipse to dimension. + /// textPoint : A Point3D object that defines the position of the dimension text. + /// isDriving : Optional argument that specifies if a driving (the dimension controls the geometry) + /// or a driven (the geometry controls the dimension) dimension is created. If not provided + /// a driving dimension will be created. + /// Returns the newly created dimension or null if the creation failed. + core::Ptr addEllipseMajorRadiusDimension(const core::Ptr& ellipse, const core::Ptr& textPoint, bool isDriving = true); + + /// Creates a new dimension constraint on the minor radius of an ellipse. + /// ellipse : The SketchEllipse to dimension. + /// textPoint : A Point3D object that defines the position of the dimension text. + /// isDriving : Optional argument that specifies if a driving (the dimension controls the geometry) + /// or a driven (the geometry controls the dimension) dimension is created. If not provided + /// a driving dimension will be created. + /// Returns the newly created dimension or null if the creation failed. + core::Ptr addEllipseMinorRadiusDimension(const core::Ptr& ellipse, const core::Ptr& textPoint, bool isDriving = true); + + /// Creates a new dimension constraint between to concentric circles or arcs. + /// circleOne : The first SketchCircle or SketchArc to dimension. + /// circleTwo : The second SketchCircle or SketchArc to dimension. + /// textPoint : A Point3D object that defines the position of the dimension text. + /// isDriving : Optional argument that specifies if a driving (the dimension controls the geometry) + /// or a driven (the geometry controls the dimension) dimension is created. If not provided + /// a driving dimension will be created. + /// Returns the newly created dimension or null if the creation failed. + core::Ptr addConcentricCircleDimension(const core::Ptr& circleOne, const core::Ptr& circleTwo, const core::Ptr& textPoint, bool isDriving = true); + + typedef SketchDimension iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHDIMENSIONS_API static const char* classType(); + ADSK_FUSION_SKETCHDIMENSIONS_API const char* objectType() const override; + ADSK_FUSION_SKETCHDIMENSIONS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHDIMENSIONS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchDimension* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SketchLinearDimension* addDistanceDimension_raw(SketchPoint* pointOne, SketchPoint* pointTwo, DimensionOrientations orientation, core::Point3D* textPoint, bool isDriving) = 0; + virtual SketchOffsetDimension* addOffsetDimension_raw(SketchLine* line, SketchEntity* entityTwo, core::Point3D* textPoint, bool isDriving) = 0; + virtual SketchAngularDimension* addAngularDimension_raw(SketchLine* lineOne, SketchLine* lineTwo, core::Point3D* textPoint, bool isDriving) = 0; + virtual SketchDiameterDimension* addDiameterDimension_raw(SketchCurve* entity, core::Point3D* textPoint, bool isDriving) = 0; + virtual SketchRadialDimension* addRadialDimension_raw(SketchCurve* entity, core::Point3D* textPoint, bool isDriving) = 0; + virtual SketchEllipseMajorRadiusDimension* addEllipseMajorRadiusDimension_raw(SketchCurve* ellipse, core::Point3D* textPoint, bool isDriving) = 0; + virtual SketchEllipseMinorRadiusDimension* addEllipseMinorRadiusDimension_raw(SketchCurve* ellipse, core::Point3D* textPoint, bool isDriving) = 0; + virtual SketchConcentricCircleDimension* addConcentricCircleDimension_raw(SketchCurve* circleOne, SketchCurve* circleTwo, core::Point3D* textPoint, bool isDriving) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchDimensions::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchDimensions::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SketchDimensions::addDistanceDimension(const core::Ptr& pointOne, const core::Ptr& pointTwo, DimensionOrientations orientation, const core::Ptr& textPoint, bool isDriving) +{ + core::Ptr res = addDistanceDimension_raw(pointOne.get(), pointTwo.get(), orientation, textPoint.get(), isDriving); + return res; +} + +inline core::Ptr SketchDimensions::addOffsetDimension(const core::Ptr& line, const core::Ptr& entityTwo, const core::Ptr& textPoint, bool isDriving) +{ + core::Ptr res = addOffsetDimension_raw(line.get(), entityTwo.get(), textPoint.get(), isDriving); + return res; +} + +inline core::Ptr SketchDimensions::addAngularDimension(const core::Ptr& lineOne, const core::Ptr& lineTwo, const core::Ptr& textPoint, bool isDriving) +{ + core::Ptr res = addAngularDimension_raw(lineOne.get(), lineTwo.get(), textPoint.get(), isDriving); + return res; +} + +inline core::Ptr SketchDimensions::addDiameterDimension(const core::Ptr& entity, const core::Ptr& textPoint, bool isDriving) +{ + core::Ptr res = addDiameterDimension_raw(entity.get(), textPoint.get(), isDriving); + return res; +} + +inline core::Ptr SketchDimensions::addRadialDimension(const core::Ptr& entity, const core::Ptr& textPoint, bool isDriving) +{ + core::Ptr res = addRadialDimension_raw(entity.get(), textPoint.get(), isDriving); + return res; +} + +inline core::Ptr SketchDimensions::addEllipseMajorRadiusDimension(const core::Ptr& ellipse, const core::Ptr& textPoint, bool isDriving) +{ + core::Ptr res = addEllipseMajorRadiusDimension_raw(ellipse.get(), textPoint.get(), isDriving); + return res; +} + +inline core::Ptr SketchDimensions::addEllipseMinorRadiusDimension(const core::Ptr& ellipse, const core::Ptr& textPoint, bool isDriving) +{ + core::Ptr res = addEllipseMinorRadiusDimension_raw(ellipse.get(), textPoint.get(), isDriving); + return res; +} + +inline core::Ptr SketchDimensions::addConcentricCircleDimension(const core::Ptr& circleOne, const core::Ptr& circleTwo, const core::Ptr& textPoint, bool isDriving) +{ + core::Ptr res = addConcentricCircleDimension_raw(circleOne.get(), circleTwo.get(), textPoint.get(), isDriving); + return res; +} + +template inline void SketchDimensions::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHDIMENSIONS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipse.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipse.h new file mode 100644 index 0000000..b55f370 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipse.h @@ -0,0 +1,200 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchCurve.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHELLIPSE_CPP__ +# define ADSK_FUSION_SKETCHELLIPSE_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHELLIPSE_API +# endif +#else +# define ADSK_FUSION_SKETCHELLIPSE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchLine; + class SketchPoint; +}} +namespace adsk { namespace core { + class Ellipse3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// An ellipse in a sketch. +class SketchEllipse : public SketchCurve { +public: + + /// Returns the sketch point that defines the center of the ellipse. You can + /// reposition the ellipse by moving the sketch point, assuming any existing + /// constraints allow the desired change. + core::Ptr centerSketchPoint() const; + + /// Gets and sets the major axis direction of the ellipse. Changing the axis is + /// limited by any constraints that might exist on the ellipse. Setting the axis + /// can fail in cases where the direction is fully defined through constraints. + core::Ptr majorAxis() const; + bool majorAxis(const core::Ptr& value); + + /// Gets and sets the major axis radius of the ellipse. Changing the radius is + /// limited by any constraints that might exist on the ellipse. Setting the radius + /// can fail in cases where the radius is fully defined through constraints. + double majorAxisRadius() const; + bool majorAxisRadius(double value); + + /// Gets and sets the minor axis radius of the ellipse. Changing the radius is + /// limited by any constraints that might exist on the ellipse. Setting the radius + /// can fail in cases where the radius is fully defined through constraints. + double minorAxisRadius() const; + bool minorAxisRadius(double value); + + /// Returns the transient geometry of the ellipse which provides geometric + /// information about the ellipse. The returned geometry is always in sketch space. + core::Ptr geometry() const; + + /// Returns an Ellipse3D object which provides geometric information in world space. + /// The returned geometry takes into account the assembly context and the position of the + /// sketch in it's parent component, which means the geometry will be returned in the root + /// component space. + core::Ptr worldGeometry() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the sketch line associated with the ellipse that lies along the major axis. + /// This can return null in the case where the line has been deleted. + core::Ptr majorAxisLine() const; + + /// Returns the sketch line associated with the ellipse that lies along the minor axis. + /// This can return null in the case where the line has been deleted. + core::Ptr minorAxisLine() const; + + ADSK_FUSION_SKETCHELLIPSE_API static const char* classType(); + ADSK_FUSION_SKETCHELLIPSE_API const char* objectType() const override; + ADSK_FUSION_SKETCHELLIPSE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHELLIPSE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* centerSketchPoint_raw() const = 0; + virtual core::Vector3D* majorAxis_raw() const = 0; + virtual bool majorAxis_raw(core::Vector3D* value) = 0; + virtual double majorAxisRadius_raw() const = 0; + virtual bool majorAxisRadius_raw(double value) = 0; + virtual double minorAxisRadius_raw() const = 0; + virtual bool minorAxisRadius_raw(double value) = 0; + virtual core::Ellipse3D* geometry_raw() const = 0; + virtual core::Ellipse3D* worldGeometry_raw() const = 0; + virtual SketchEllipse* nativeObject_raw() const = 0; + virtual SketchEllipse* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual SketchLine* majorAxisLine_raw() const = 0; + virtual SketchLine* minorAxisLine_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchEllipse::centerSketchPoint() const +{ + core::Ptr res = centerSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchEllipse::majorAxis() const +{ + core::Ptr res = majorAxis_raw(); + return res; +} + +inline bool SketchEllipse::majorAxis(const core::Ptr& value) +{ + return majorAxis_raw(value.get()); +} + +inline double SketchEllipse::majorAxisRadius() const +{ + double res = majorAxisRadius_raw(); + return res; +} + +inline bool SketchEllipse::majorAxisRadius(double value) +{ + return majorAxisRadius_raw(value); +} + +inline double SketchEllipse::minorAxisRadius() const +{ + double res = minorAxisRadius_raw(); + return res; +} + +inline bool SketchEllipse::minorAxisRadius(double value) +{ + return minorAxisRadius_raw(value); +} + +inline core::Ptr SketchEllipse::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr SketchEllipse::worldGeometry() const +{ + core::Ptr res = worldGeometry_raw(); + return res; +} + +inline core::Ptr SketchEllipse::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchEllipse::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr SketchEllipse::majorAxisLine() const +{ + core::Ptr res = majorAxisLine_raw(); + return res; +} + +inline core::Ptr SketchEllipse::minorAxisLine() const +{ + core::Ptr res = minorAxisLine_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHELLIPSE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipseMajorRadiusDimension.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipseMajorRadiusDimension.h new file mode 100644 index 0000000..e07aaa7 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipseMajorRadiusDimension.h @@ -0,0 +1,90 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchDimension.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHELLIPSEMAJORRADIUSDIMENSION_CPP__ +# define ADSK_FUSION_SKETCHELLIPSEMAJORRADIUSDIMENSION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHELLIPSEMAJORRADIUSDIMENSION_API +# endif +#else +# define ADSK_FUSION_SKETCHELLIPSEMAJORRADIUSDIMENSION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; +}} + +namespace adsk { namespace fusion { + +/// An ellipse major radius dimension in a sketch. +class SketchEllipseMajorRadiusDimension : public SketchDimension { +public: + + /// Returns the ellipse or elliptical arc being constrained. + core::Ptr ellipse() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHELLIPSEMAJORRADIUSDIMENSION_API static const char* classType(); + ADSK_FUSION_SKETCHELLIPSEMAJORRADIUSDIMENSION_API const char* objectType() const override; + ADSK_FUSION_SKETCHELLIPSEMAJORRADIUSDIMENSION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHELLIPSEMAJORRADIUSDIMENSION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve* ellipse_raw() const = 0; + virtual SketchEllipseMajorRadiusDimension* nativeObject_raw() const = 0; + virtual SketchEllipseMajorRadiusDimension* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchEllipseMajorRadiusDimension::ellipse() const +{ + core::Ptr res = ellipse_raw(); + return res; +} + +inline core::Ptr SketchEllipseMajorRadiusDimension::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchEllipseMajorRadiusDimension::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHELLIPSEMAJORRADIUSDIMENSION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipseMinorRadiusDimension.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipseMinorRadiusDimension.h new file mode 100644 index 0000000..47d3128 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipseMinorRadiusDimension.h @@ -0,0 +1,90 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchDimension.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHELLIPSEMINORRADIUSDIMENSION_CPP__ +# define ADSK_FUSION_SKETCHELLIPSEMINORRADIUSDIMENSION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHELLIPSEMINORRADIUSDIMENSION_API +# endif +#else +# define ADSK_FUSION_SKETCHELLIPSEMINORRADIUSDIMENSION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; +}} + +namespace adsk { namespace fusion { + +/// An ellipse minor radius dimension in a sketch. +class SketchEllipseMinorRadiusDimension : public SketchDimension { +public: + + /// Returns the ellipse or elliptical arc being constrained. + core::Ptr ellipse() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHELLIPSEMINORRADIUSDIMENSION_API static const char* classType(); + ADSK_FUSION_SKETCHELLIPSEMINORRADIUSDIMENSION_API const char* objectType() const override; + ADSK_FUSION_SKETCHELLIPSEMINORRADIUSDIMENSION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHELLIPSEMINORRADIUSDIMENSION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve* ellipse_raw() const = 0; + virtual SketchEllipseMinorRadiusDimension* nativeObject_raw() const = 0; + virtual SketchEllipseMinorRadiusDimension* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchEllipseMinorRadiusDimension::ellipse() const +{ + core::Ptr res = ellipse_raw(); + return res; +} + +inline core::Ptr SketchEllipseMinorRadiusDimension::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchEllipseMinorRadiusDimension::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHELLIPSEMINORRADIUSDIMENSION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipses.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipses.h new file mode 100644 index 0000000..cf1d2b3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipses.h @@ -0,0 +1,107 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHELLIPSES_CPP__ +# define ADSK_FUSION_SKETCHELLIPSES_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHELLIPSES_API +# endif +#else +# define ADSK_FUSION_SKETCHELLIPSES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchEllipse; +}} +namespace adsk { namespace core { + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// The collection of ellipses in a sketch. This provides access to the existing +/// ellipses and supports the methods to create new ellipses. +class SketchEllipses : public core::Base { +public: + + /// Function that returns the specified sketch ellipse using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of ellipses in the sketch. + size_t count() const; + + /// Creates a sketch ellipse using the center point, a point defining the major axis + /// and a third point anywhere along the ellipse. The created ellipse is parallel to the + /// x-y plane of the sketch. + /// centerPoint : The center point of the ellipse. This can be either an existing SketchPoint or a Point3D object. + /// majorAxisPoint : A point3D object that defines both the major axis direction and major axis radius. + /// point : A point3D object that the ellipse will pass through. + /// Returns the newly created SketchEllipse object if the creation was successful or null if it failed. + core::Ptr add(const core::Ptr& centerPoint, const core::Ptr& majorAxisPoint, const core::Ptr& point); + + typedef SketchEllipse iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHELLIPSES_API static const char* classType(); + ADSK_FUSION_SKETCHELLIPSES_API const char* objectType() const override; + ADSK_FUSION_SKETCHELLIPSES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHELLIPSES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchEllipse* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SketchEllipse* add_raw(core::Base* centerPoint, core::Point3D* majorAxisPoint, core::Point3D* point) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchEllipses::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchEllipses::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SketchEllipses::add(const core::Ptr& centerPoint, const core::Ptr& majorAxisPoint, const core::Ptr& point) +{ + core::Ptr res = add_raw(centerPoint.get(), majorAxisPoint.get(), point.get()); + return res; +} + +template inline void SketchEllipses::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHELLIPSES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipticalArc.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipticalArc.h new file mode 100644 index 0000000..ddbf07d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipticalArc.h @@ -0,0 +1,201 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchCurve.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHELLIPTICALARC_CPP__ +# define ADSK_FUSION_SKETCHELLIPTICALARC_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHELLIPTICALARC_API +# endif +#else +# define ADSK_FUSION_SKETCHELLIPTICALARC_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchPoint; +}} +namespace adsk { namespace core { + class EllipticalArc3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// An elliptical arc in a sketch. +class SketchEllipticalArc : public SketchCurve { +public: + + /// Gets the sketch point that defines the center of the elliptical arc. You can + /// reposition the elliptical arc by moving the sketch point, assuming any existing + /// constraints allow the desired change. + core::Ptr centerSketchPoint() const; + + /// Gets the sketch point that defines the start of the elliptical arc. You can + /// reposition the sketch point, assuming any existing constraints allow the + /// desired change. + core::Ptr startSketchPoint() const; + + /// Gets the sketch point that defines the end of the elliptical arc. You can + /// reposition the sketch point, assuming any existing constraints allow the + /// desired change. + core::Ptr endSketchPoint() const; + + /// Gets and sets the major axis direction of the elliptical arc. Changing the axis is + /// limited by any constraints that might exist on the elliptical arc. Setting the axis + /// can fail in cases where the direction is fully defined through constraints. + core::Ptr majorAxis() const; + bool majorAxis(const core::Ptr& value); + + /// Gets and sets the major axis radius of the elliptical arc. Changing the radius is + /// limited by any constraints that might exist on the elliptical arc. Setting the radius + /// can fail in cases where the radius is fully defined through constraints. + double majorAxisRadius() const; + bool majorAxisRadius(double value); + + /// Gets and sets the minor axis radius of the elliptical arc. Changing the radius is + /// limited by any constraints that might exist on the elliptical arc. Setting the radius + /// can fail in cases where the radius is fully defined through constraints. + double minorAxisRadius() const; + bool minorAxisRadius(double value); + + /// Returns the transient geometry of the elliptical arc which provides geometric + /// information about the elliptical arc. The returned geometry is always in sketch space. + core::Ptr geometry() const; + + /// Returns an EllipticalArc3D object which provides geometric information in world space. + /// The returned geometry takes into account the assembly context and the position of the + /// sketch in it's parent component, which means the geometry will be returned in the root + /// component space. + core::Ptr worldGeometry() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHELLIPTICALARC_API static const char* classType(); + ADSK_FUSION_SKETCHELLIPTICALARC_API const char* objectType() const override; + ADSK_FUSION_SKETCHELLIPTICALARC_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHELLIPTICALARC_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* centerSketchPoint_raw() const = 0; + virtual SketchPoint* startSketchPoint_raw() const = 0; + virtual SketchPoint* endSketchPoint_raw() const = 0; + virtual core::Vector3D* majorAxis_raw() const = 0; + virtual bool majorAxis_raw(core::Vector3D* value) = 0; + virtual double majorAxisRadius_raw() const = 0; + virtual bool majorAxisRadius_raw(double value) = 0; + virtual double minorAxisRadius_raw() const = 0; + virtual bool minorAxisRadius_raw(double value) = 0; + virtual core::EllipticalArc3D* geometry_raw() const = 0; + virtual core::EllipticalArc3D* worldGeometry_raw() const = 0; + virtual SketchEllipticalArc* nativeObject_raw() const = 0; + virtual SketchEllipticalArc* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchEllipticalArc::centerSketchPoint() const +{ + core::Ptr res = centerSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchEllipticalArc::startSketchPoint() const +{ + core::Ptr res = startSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchEllipticalArc::endSketchPoint() const +{ + core::Ptr res = endSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchEllipticalArc::majorAxis() const +{ + core::Ptr res = majorAxis_raw(); + return res; +} + +inline bool SketchEllipticalArc::majorAxis(const core::Ptr& value) +{ + return majorAxis_raw(value.get()); +} + +inline double SketchEllipticalArc::majorAxisRadius() const +{ + double res = majorAxisRadius_raw(); + return res; +} + +inline bool SketchEllipticalArc::majorAxisRadius(double value) +{ + return majorAxisRadius_raw(value); +} + +inline double SketchEllipticalArc::minorAxisRadius() const +{ + double res = minorAxisRadius_raw(); + return res; +} + +inline bool SketchEllipticalArc::minorAxisRadius(double value) +{ + return minorAxisRadius_raw(value); +} + +inline core::Ptr SketchEllipticalArc::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr SketchEllipticalArc::worldGeometry() const +{ + core::Ptr res = worldGeometry_raw(); + return res; +} + +inline core::Ptr SketchEllipticalArc::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchEllipticalArc::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHELLIPTICALARC_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipticalArcs.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipticalArcs.h new file mode 100644 index 0000000..dfb7988 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEllipticalArcs.h @@ -0,0 +1,88 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHELLIPTICALARCS_CPP__ +# define ADSK_FUSION_SKETCHELLIPTICALARCS_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHELLIPTICALARCS_API +# endif +#else +# define ADSK_FUSION_SKETCHELLIPTICALARCS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchEllipticalArc; +}} + +namespace adsk { namespace fusion { + +/// The collection of elliptical arcs in a sketch. This provides access to the existing +/// elliptical arcs and supports the methods to create new elliptical arcs. +class SketchEllipticalArcs : public core::Base { +public: + + /// Function that returns the specified sketch elliptical arc using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of elliptical arcs in the sketch. + size_t count() const; + + typedef SketchEllipticalArc iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHELLIPTICALARCS_API static const char* classType(); + ADSK_FUSION_SKETCHELLIPTICALARCS_API const char* objectType() const override; + ADSK_FUSION_SKETCHELLIPTICALARCS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHELLIPTICALARCS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchEllipticalArc* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchEllipticalArcs::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchEllipticalArcs::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void SketchEllipticalArcs::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHELLIPTICALARCS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchEntity.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEntity.h new file mode 100644 index 0000000..b1a7fe5 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEntity.h @@ -0,0 +1,316 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHENTITY_CPP__ +# define ADSK_FUSION_SKETCHENTITY_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHENTITY_API +# endif +#else +# define ADSK_FUSION_SKETCHENTITY_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class GeometricConstraintList; + class Occurrence; + class Sketch; + class SketchDimensionList; +}} +namespace adsk { namespace core { + class Attributes; + class BoundingBox3D; +}} + +namespace adsk { namespace fusion { + +/// This object represents all geometry in a sketch, including +/// points and lines and the various curves. +class SketchEntity : public core::Base { +public: + + /// Returns the parent sketch. + core::Ptr parentSketch() const; + + /// Returns the sketch dimensions that are attached to this curve. + core::Ptr sketchDimensions() const; + + /// Returns the sketch constraints that are attached to this curve. + core::Ptr geometricConstraints() const; + + /// Indicates if this curve lies entirely on the sketch x-y plane. + bool is2D() const; + + /// Indicates if this geometry is a reference. + /// Changing this property from true to false removes the reference. + /// This property can not be set to true if it is already false. + bool isReference() const; + bool isReference(bool value); + + /// Indicates if this geometry is "fixed". + bool isFixed() const; + bool isFixed(bool value); + + /// When a sketch is created, geometry is sometimes automatically added to the sketch. + /// For example a sketch point that references the origin point is always included and + /// if a face was selected to create the sketch on, geometry from the face is also included. + /// This automatically created geometry behaves in a special way in that it is invisible + /// but is available for selection and it also participates in profile calculations. It's + /// not possible to make them visible but they can be deleted and they can be used for any + /// other standard sketch operation. + bool isVisible() const; + + /// Returns the bounding box of the entity in sketch space. + core::Ptr boundingBox() const; + + /// Deletes the entity from the sketch. + /// Returns true is the delete was successful. + bool deleteMe(); + + /// Returns the referenced entity in the case where IsReference + /// is true. However, this property can also return null when + /// IsReference is true in the case where the reference is not + /// parametric. + core::Ptr referencedEntity() const; + + /// Returns the assembly occurrence (i.e. the occurrence) of this object + /// in an assembly. This is only valid in the case where this is acting + /// as a proxy in an assembly. Returns null in the case where the object + /// is not in the context of an assembly but is already the native object. + core::Ptr assemblyContext() const; + + /// Indicates if this sketch entity can be deleted. There are cases, especially with sketch + /// points where another entity is dependent on an entity so deleting it is not allowed. + /// For example, you can't delete the center point of circle by itself but deleting the circle + /// will delete the point. The same is true for the end points of a line. + bool isDeletable() const; + + /// Indicates if this sketch entity is fully constrained. + bool isFullyConstrained() const; + + /// Returns the collection of attributes associated with this face. + core::Ptr attributes() const; + + /// Returns a token for the SketchEntity object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same sketch entity. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + /// Indicates if this sketch entity was created by a projection, inclusion, or driven by an API script. + /// If this returns true, then the entity is presented to the user as not editable and with a 'break link' + /// command available. + bool isLinked() const; + + ADSK_FUSION_SKETCHENTITY_API static const char* classType(); + ADSK_FUSION_SKETCHENTITY_API const char* objectType() const override; + ADSK_FUSION_SKETCHENTITY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHENTITY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Sketch* parentSketch_raw() const = 0; + virtual SketchDimensionList* sketchDimensions_raw() const = 0; + virtual GeometricConstraintList* geometricConstraints_raw() const = 0; + virtual bool is2D_raw() const = 0; + virtual bool isReference_raw() const = 0; + virtual bool isReference_raw(bool value) = 0; + virtual bool isFixed_raw() const = 0; + virtual bool isFixed_raw(bool value) = 0; + virtual bool isVisible_raw() const = 0; + virtual core::BoundingBox3D* boundingBox_raw() const = 0; + virtual bool deleteMe_raw() = 0; + virtual core::Base* referencedEntity_raw() const = 0; + virtual Occurrence* assemblyContext_raw() const = 0; + virtual bool isDeletable_raw() const = 0; + virtual bool isFullyConstrained_raw() const = 0; + virtual core::Attributes* attributes_raw() const = 0; + virtual char* entityToken_raw() const = 0; + virtual bool isLinked_raw() const = 0; + virtual void placeholderSketchEntity0() {} + virtual void placeholderSketchEntity1() {} + virtual void placeholderSketchEntity2() {} + virtual void placeholderSketchEntity3() {} + virtual void placeholderSketchEntity4() {} + virtual void placeholderSketchEntity5() {} + virtual void placeholderSketchEntity6() {} + virtual void placeholderSketchEntity7() {} + virtual void placeholderSketchEntity8() {} + virtual void placeholderSketchEntity9() {} + virtual void placeholderSketchEntity10() {} + virtual void placeholderSketchEntity11() {} + virtual void placeholderSketchEntity12() {} + virtual void placeholderSketchEntity13() {} + virtual void placeholderSketchEntity14() {} + virtual void placeholderSketchEntity15() {} + virtual void placeholderSketchEntity16() {} + virtual void placeholderSketchEntity17() {} + virtual void placeholderSketchEntity18() {} + virtual void placeholderSketchEntity19() {} + virtual void placeholderSketchEntity20() {} + virtual void placeholderSketchEntity21() {} + virtual void placeholderSketchEntity22() {} + virtual void placeholderSketchEntity23() {} + virtual void placeholderSketchEntity24() {} + virtual void placeholderSketchEntity25() {} + virtual void placeholderSketchEntity26() {} + virtual void placeholderSketchEntity27() {} + virtual void placeholderSketchEntity28() {} + virtual void placeholderSketchEntity29() {} + virtual void placeholderSketchEntity30() {} + virtual void placeholderSketchEntity31() {} + virtual void placeholderSketchEntity32() {} + virtual void placeholderSketchEntity33() {} + virtual void placeholderSketchEntity34() {} + virtual void placeholderSketchEntity35() {} + virtual void placeholderSketchEntity36() {} + virtual void placeholderSketchEntity37() {} + virtual void placeholderSketchEntity38() {} + virtual void placeholderSketchEntity39() {} + virtual void placeholderSketchEntity40() {} + virtual void placeholderSketchEntity41() {} + virtual void placeholderSketchEntity42() {} + virtual void placeholderSketchEntity43() {} + virtual void placeholderSketchEntity44() {} + virtual void placeholderSketchEntity45() {} +}; + +// Inline wrappers + +inline core::Ptr SketchEntity::parentSketch() const +{ + core::Ptr res = parentSketch_raw(); + return res; +} + +inline core::Ptr SketchEntity::sketchDimensions() const +{ + core::Ptr res = sketchDimensions_raw(); + return res; +} + +inline core::Ptr SketchEntity::geometricConstraints() const +{ + core::Ptr res = geometricConstraints_raw(); + return res; +} + +inline bool SketchEntity::is2D() const +{ + bool res = is2D_raw(); + return res; +} + +inline bool SketchEntity::isReference() const +{ + bool res = isReference_raw(); + return res; +} + +inline bool SketchEntity::isReference(bool value) +{ + return isReference_raw(value); +} + +inline bool SketchEntity::isFixed() const +{ + bool res = isFixed_raw(); + return res; +} + +inline bool SketchEntity::isFixed(bool value) +{ + return isFixed_raw(value); +} + +inline bool SketchEntity::isVisible() const +{ + bool res = isVisible_raw(); + return res; +} + +inline core::Ptr SketchEntity::boundingBox() const +{ + core::Ptr res = boundingBox_raw(); + return res; +} + +inline bool SketchEntity::deleteMe() +{ + bool res = deleteMe_raw(); + return res; +} + +inline core::Ptr SketchEntity::referencedEntity() const +{ + core::Ptr res = referencedEntity_raw(); + return res; +} + +inline core::Ptr SketchEntity::assemblyContext() const +{ + core::Ptr res = assemblyContext_raw(); + return res; +} + +inline bool SketchEntity::isDeletable() const +{ + bool res = isDeletable_raw(); + return res; +} + +inline bool SketchEntity::isFullyConstrained() const +{ + bool res = isFullyConstrained_raw(); + return res; +} + +inline core::Ptr SketchEntity::attributes() const +{ + core::Ptr res = attributes_raw(); + return res; +} + +inline std::string SketchEntity::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool SketchEntity::isLinked() const +{ + bool res = isLinked_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHENTITY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchEntityList.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEntityList.h new file mode 100644 index 0000000..936411d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchEntityList.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHENTITYLIST_CPP__ +# define ADSK_FUSION_SKETCHENTITYLIST_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHENTITYLIST_API +# endif +#else +# define ADSK_FUSION_SKETCHENTITYLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchEntity; +}} + +namespace adsk { namespace fusion { + +/// A list of sketch entities. +class SketchEntityList : public core::Base { +public: + + /// Function that returns the specified sketch entity using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of sketch entities in the list. + size_t count() const; + + typedef SketchEntity iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHENTITYLIST_API static const char* classType(); + ADSK_FUSION_SKETCHENTITYLIST_API const char* objectType() const override; + ADSK_FUSION_SKETCHENTITYLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHENTITYLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchEntity* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchEntityList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchEntityList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void SketchEntityList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHENTITYLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchFittedSpline.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchFittedSpline.h new file mode 100644 index 0000000..cfee661 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchFittedSpline.h @@ -0,0 +1,249 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchCurve.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHFITTEDSPLINE_CPP__ +# define ADSK_FUSION_SKETCHFITTEDSPLINE_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHFITTEDSPLINE_API +# endif +#else +# define ADSK_FUSION_SKETCHFITTEDSPLINE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchArc; + class SketchLine; + class SketchPoint; + class SketchPointList; +}} +namespace adsk { namespace core { + class NurbsCurve3D; +}} + +namespace adsk { namespace fusion { + +/// A fitted spline in a sketch. +class SketchFittedSpline : public SketchCurve { +public: + + /// Returns the sketch point that defines the starting position + /// of the spline. Editing the position of this sketch point + /// will result in editing the spline. + core::Ptr startSketchPoint() const; + + /// Returns the sketch point that defines the ending position + /// of the spline. Editing the position of this sketch point + /// will result in editing the spline. + core::Ptr endSketchPoint() const; + + /// Returns the set of sketch points that the spline fits through. + /// The points include the start and end points and are returned in + /// the same order as the spline fits through them where the first point + /// in the list is the start point and the last point is the end point. + /// Editing the position of these sketch points will result in + /// editing the spline. + core::Ptr fitPoints() const; + + /// Gets and sets if this spline is closed. A closed spline + /// is also periodic. This property can return false even in + /// the case where the spline is physically closed. It's possible + /// that the start and end points of a spline can be the same point + /// but the curve is still not considered closed. This can happen + /// when the start and end points of an open curve are merged. The + /// curve is physically closed but is not periodic and can have a + /// discontinuity at the joint. Setting it to closed will cause it + /// to be periodic and to always remain closed even as fit points + /// are deleted. + bool isClosed() const; + bool isClosed(bool value); + + /// Returns the transient geometry of the curve which provides geometric + /// information about the curve. The returned geometry is always in sketch space. + core::Ptr geometry() const; + + /// Returns an NurbsCurve3D object which provides geometric information in world space. + /// The returned geometry takes into account the assembly context and the position of the + /// sketch in it's parent component, which means the geometry will be returned in the root + /// component space. + core::Ptr worldGeometry() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Activates the tangent handle for the specified fit point and returns the sketch line + /// that acts as the handle to control the tangency. You can use the getTangentHandle + /// property to determine if the tangent handle has already been activated. If this method + /// is called for a handle that already exists, nothing changes and the existing sketch line + /// that acts as the tangent handle is returned. + /// The getTangentHandle method can be used to determine if the handle has already been + /// activated. + /// To deactivate a sketch handle you can delete the sketch line. + /// fitPoint : The fit point on the curve where you want to activate the tangent handle. + /// The fit points can be obtained by using the fitPoints property of the SketchFittedSpline object. + /// Returns the sketch line that acts as the tangent handle at the specified fit point. + core::Ptr activateTangentHandle(const core::Ptr& fitPoint); + + /// Returns the sketch line that acts as the handle to control the tangency at the specified fit + /// point. Returns null in the case where the tangent handle has not been activated at that sketch point. + /// Deleting the returned line will deactivate the tangent handle. Use the activateTangentHandle method + /// to activate the tangent handle. + /// fitPoint : The fit point on the curve where you want to get the tangent handle. + /// The fit points can be obtained by using the fitPoints property of the SketchFittedSpline object. + /// Returns the sketch line that acts as the handle to control the tangency at the specified point or + /// returns null in the case where the tangency handle has not been activated at the specified sketch point. + core::Ptr getTangentHandle(const core::Ptr& fitPoint); + + /// Activates the curvature handle for the specified fit point and returns the sketch arc + /// that acts as the handle to control the curvature. You can use the getCurvatureHandle + /// property to determine if the curvature handle has already been activated. If this method + /// is called for a handle that already exists, nothing changes and the existing sketch arc + /// that acts as the curvature handle is returned. + /// The getCurvatureHandle method can be used to determine if the handle has already been + /// activated. + /// To deactivate a sketch handle you can delete the sketch arc. + /// fitPoint : The fit point on the curve where you want to activate the curvature handle. + /// The fit points can be obtained by using the fitPoints property of the SketchFittedSpline object. + /// Returns the sketch arc that acts as the curvature handle at the specified fit point. + core::Ptr activateCurvatureHandle(const core::Ptr& fitPoint); + + /// Returns the sketch arc that acts as the handle to control the curvature at the specified fit + /// point. Returns null in the case where the curvature handle has not been activated at that sketch point. + /// Deleting the returned arc will deactivate the curvature handle. Use the activateCurvatureHandle method + /// to activate the curvature handle. + /// fitPoint : The fit point on the curve where you want to get the curvature handle. + /// The fit points can be obtained by using the fitPoints property of the SketchFittedSpline object. + /// Returns the sketch arc that acts as the handle to control the curvature at the specified point or + /// returns null in the case where the curvature handle has not been activated at the specified sketch point. + core::Ptr getCurvatureHandle(const core::Ptr& fitPoint); + + ADSK_FUSION_SKETCHFITTEDSPLINE_API static const char* classType(); + ADSK_FUSION_SKETCHFITTEDSPLINE_API const char* objectType() const override; + ADSK_FUSION_SKETCHFITTEDSPLINE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHFITTEDSPLINE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* startSketchPoint_raw() const = 0; + virtual SketchPoint* endSketchPoint_raw() const = 0; + virtual SketchPointList* fitPoints_raw() const = 0; + virtual bool isClosed_raw() const = 0; + virtual bool isClosed_raw(bool value) = 0; + virtual core::NurbsCurve3D* geometry_raw() const = 0; + virtual core::NurbsCurve3D* worldGeometry_raw() const = 0; + virtual SketchFittedSpline* nativeObject_raw() const = 0; + virtual SketchFittedSpline* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual SketchLine* activateTangentHandle_raw(SketchPoint* fitPoint) = 0; + virtual SketchLine* getTangentHandle_raw(SketchPoint* fitPoint) = 0; + virtual SketchArc* activateCurvatureHandle_raw(SketchPoint* fitPoint) = 0; + virtual SketchArc* getCurvatureHandle_raw(SketchPoint* fitPoint) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchFittedSpline::startSketchPoint() const +{ + core::Ptr res = startSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchFittedSpline::endSketchPoint() const +{ + core::Ptr res = endSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchFittedSpline::fitPoints() const +{ + core::Ptr res = fitPoints_raw(); + return res; +} + +inline bool SketchFittedSpline::isClosed() const +{ + bool res = isClosed_raw(); + return res; +} + +inline bool SketchFittedSpline::isClosed(bool value) +{ + return isClosed_raw(value); +} + +inline core::Ptr SketchFittedSpline::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr SketchFittedSpline::worldGeometry() const +{ + core::Ptr res = worldGeometry_raw(); + return res; +} + +inline core::Ptr SketchFittedSpline::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchFittedSpline::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr SketchFittedSpline::activateTangentHandle(const core::Ptr& fitPoint) +{ + core::Ptr res = activateTangentHandle_raw(fitPoint.get()); + return res; +} + +inline core::Ptr SketchFittedSpline::getTangentHandle(const core::Ptr& fitPoint) +{ + core::Ptr res = getTangentHandle_raw(fitPoint.get()); + return res; +} + +inline core::Ptr SketchFittedSpline::activateCurvatureHandle(const core::Ptr& fitPoint) +{ + core::Ptr res = activateCurvatureHandle_raw(fitPoint.get()); + return res; +} + +inline core::Ptr SketchFittedSpline::getCurvatureHandle(const core::Ptr& fitPoint) +{ + core::Ptr res = getCurvatureHandle_raw(fitPoint.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHFITTEDSPLINE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchFittedSplines.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchFittedSplines.h new file mode 100644 index 0000000..7ad739b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchFittedSplines.h @@ -0,0 +1,118 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHFITTEDSPLINES_CPP__ +# define ADSK_FUSION_SKETCHFITTEDSPLINES_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHFITTEDSPLINES_API +# endif +#else +# define ADSK_FUSION_SKETCHFITTEDSPLINES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchFittedSpline; +}} +namespace adsk { namespace core { + class NurbsCurve3D; + class ObjectCollection; +}} + +namespace adsk { namespace fusion { + +/// The collection of fitted splines in a sketch. This provides access to the existing +/// fitted splines and supports the methods to create new fitted splines. +class SketchFittedSplines : public core::Base { +public: + + /// Function that returns the specified sketch fitted spline using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of fitted splines in the sketch. + size_t count() const; + + /// Creates a new fitted spline through the specified points. + /// fitPoints : A collection of points that the curve will fit through. They + /// can be any combination of existing SketchPoint or Point3D objects. + /// Returns the newly created SketchFittedSpline object if the creation was successful or null if it failed. + core::Ptr add(const core::Ptr& fitPoints); + + /// Creates a new fitted spline using the input NurbsCurve3D to define the shape. Fit points are created + /// to create a curve that exactly matches the input curve. + /// nurbsCurve : A NurbsCurve3D object that defines a valid NURBS curve. + /// Returns the newly created SketchFittedSpline object if the creation was successful or null if it failed. + core::Ptr addByNurbsCurve(const core::Ptr& nurbsCurve); + + typedef SketchFittedSpline iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHFITTEDSPLINES_API static const char* classType(); + ADSK_FUSION_SKETCHFITTEDSPLINES_API const char* objectType() const override; + ADSK_FUSION_SKETCHFITTEDSPLINES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHFITTEDSPLINES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchFittedSpline* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SketchFittedSpline* add_raw(core::ObjectCollection* fitPoints) = 0; + virtual SketchFittedSpline* addByNurbsCurve_raw(core::NurbsCurve3D* nurbsCurve) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchFittedSplines::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchFittedSplines::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SketchFittedSplines::add(const core::Ptr& fitPoints) +{ + core::Ptr res = add_raw(fitPoints.get()); + return res; +} + +inline core::Ptr SketchFittedSplines::addByNurbsCurve(const core::Ptr& nurbsCurve) +{ + core::Ptr res = addByNurbsCurve_raw(nurbsCurve.get()); + return res; +} + +template inline void SketchFittedSplines::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHFITTEDSPLINES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchFixedSpline.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchFixedSpline.h new file mode 100644 index 0000000..b501eff --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchFixedSpline.h @@ -0,0 +1,160 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchCurve.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHFIXEDSPLINE_CPP__ +# define ADSK_FUSION_SKETCHFIXEDSPLINE_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHFIXEDSPLINE_API +# endif +#else +# define ADSK_FUSION_SKETCHFIXEDSPLINE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchPoint; +}} +namespace adsk { namespace core { + class CurveEvaluator3D; + class NurbsCurve3D; +}} + +namespace adsk { namespace fusion { + +/// The SketchFixedSpline class represents splines in a sketch that are +/// un-editable. These can result from including splines from other sketches +/// or the spline edges. They can also be created by intersections and +/// projecting splines onto a sketch. +class SketchFixedSpline : public SketchCurve { +public: + + /// The sketch point at the start of the spline. + core::Ptr startSketchPoint() const; + + /// The sketch point at the end of the spline. + core::Ptr endSketchPoint() const; + + /// Returns the transient geometry of the curve which provides geometric + /// information about the curve. The returned geometry is always in sketch space. + /// Because the fixed spline can be analytically defined, for example it + /// can be the precise intersection of a surface and the sketch plane, + /// returning a NURBS curve that represents the spline may be an + /// approximation of the actual curve. You can use the Evaluator + /// property of the SketchFixedSpline object to perform evaluations + /// on the precise curve. + core::Ptr geometry() const; + + /// Returns a NurbsCurve3D object that is the equivalent of this sketch curve + /// but is in the space of the parent component rather than in sketch space. + core::Ptr worldGeometry() const; + + /// Returns an evaluator object that lets you perform evaluations + /// on the precise geometry of the curve. + core::Ptr evaluator() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Replaces the underlying NURBS curve that defines the shape of the fixed curve. This + /// can only be used if the isNative property of the SketchFixedSpline returns false. + /// nurbsCurve : A NurbsCurve3D object that defines a valid NURBS curve and will be used to replace + /// the existing geometry definition. + /// Returns true if the replacement was successful. + bool replaceGeometry(const core::Ptr& nurbsCurve); + + ADSK_FUSION_SKETCHFIXEDSPLINE_API static const char* classType(); + ADSK_FUSION_SKETCHFIXEDSPLINE_API const char* objectType() const override; + ADSK_FUSION_SKETCHFIXEDSPLINE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHFIXEDSPLINE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* startSketchPoint_raw() const = 0; + virtual SketchPoint* endSketchPoint_raw() const = 0; + virtual core::NurbsCurve3D* geometry_raw() const = 0; + virtual core::NurbsCurve3D* worldGeometry_raw() const = 0; + virtual core::CurveEvaluator3D* evaluator_raw() const = 0; + virtual SketchFixedSpline* nativeObject_raw() const = 0; + virtual SketchFixedSpline* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual bool replaceGeometry_raw(core::NurbsCurve3D* nurbsCurve) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchFixedSpline::startSketchPoint() const +{ + core::Ptr res = startSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchFixedSpline::endSketchPoint() const +{ + core::Ptr res = endSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchFixedSpline::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr SketchFixedSpline::worldGeometry() const +{ + core::Ptr res = worldGeometry_raw(); + return res; +} + +inline core::Ptr SketchFixedSpline::evaluator() const +{ + core::Ptr res = evaluator_raw(); + return res; +} + +inline core::Ptr SketchFixedSpline::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchFixedSpline::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline bool SketchFixedSpline::replaceGeometry(const core::Ptr& nurbsCurve) +{ + bool res = replaceGeometry_raw(nurbsCurve.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHFIXEDSPLINE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchFixedSplines.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchFixedSplines.h new file mode 100644 index 0000000..06da70f --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchFixedSplines.h @@ -0,0 +1,105 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHFIXEDSPLINES_CPP__ +# define ADSK_FUSION_SKETCHFIXEDSPLINES_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHFIXEDSPLINES_API +# endif +#else +# define ADSK_FUSION_SKETCHFIXEDSPLINES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchFixedSpline; +}} +namespace adsk { namespace core { + class NurbsCurve3D; +}} + +namespace adsk { namespace fusion { + +/// The collection of fixed splines in a sketch. Fixed splines are splines that were created +/// as the result of some operation (i.e. intersection) and is not directly editable. +class SketchFixedSplines : public core::Base { +public: + + /// Function that returns the specified sketch fixed spline using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of fitted splines in the sketch. + size_t count() const; + + /// Creates a new fixed spline using the input NurbsCurve3D to define the shape. The resulting curve + /// is not editable by the user but can be updated via the API using the replaceGeometry method on the + /// SketchFixedSpline object. + /// nurbsCurve : A NurbsCurve3D object that defines a valid NURBS curve. + /// Returns the newly created SketchFixedSpline object if the creation was successful or null if it failed. + core::Ptr addByNurbsCurve(const core::Ptr& nurbsCurve); + + typedef SketchFixedSpline iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHFIXEDSPLINES_API static const char* classType(); + ADSK_FUSION_SKETCHFIXEDSPLINES_API const char* objectType() const override; + ADSK_FUSION_SKETCHFIXEDSPLINES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHFIXEDSPLINES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchFixedSpline* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SketchFixedSpline* addByNurbsCurve_raw(core::NurbsCurve3D* nurbsCurve) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchFixedSplines::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchFixedSplines::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SketchFixedSplines::addByNurbsCurve(const core::Ptr& nurbsCurve) +{ + core::Ptr res = addByNurbsCurve_raw(nurbsCurve.get()); + return res; +} + +template inline void SketchFixedSplines::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHFIXEDSPLINES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchLine.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchLine.h new file mode 100644 index 0000000..1f398d3 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchLine.h @@ -0,0 +1,146 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchCurve.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHLINE_CPP__ +# define ADSK_FUSION_SKETCHLINE_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHLINE_API +# endif +#else +# define ADSK_FUSION_SKETCHLINE_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchPoint; +}} +namespace adsk { namespace core { + class Line3D; +}} + +namespace adsk { namespace fusion { + +/// A line in a sketch. +class SketchLine : public SketchCurve { +public: + + /// The sketch point at the start of the line. The line is dependent on this point and moving the + /// point will cause the line to adjust. + core::Ptr startSketchPoint() const; + + /// The sketch point at the end of the line. The line is dependent on this point and moving the + /// point will cause the line to adjust. + core::Ptr endSketchPoint() const; + + /// Returns the transient geometry of the line which provides geometry + /// information about the line. The returned geometry is always in sketch space. + core::Ptr geometry() const; + + /// Returns a Line3D object which provides geometric information in world space. + /// The returned geometry takes into account the assembly context and the position of the + /// sketch in it's parent component, which means the geometry will be returned in the root + /// component space. + core::Ptr worldGeometry() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Gets and sets whether this line is defined as a centerline. + bool isCenterLine() const; + bool isCenterLine(bool value); + + ADSK_FUSION_SKETCHLINE_API static const char* classType(); + ADSK_FUSION_SKETCHLINE_API const char* objectType() const override; + ADSK_FUSION_SKETCHLINE_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHLINE_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* startSketchPoint_raw() const = 0; + virtual SketchPoint* endSketchPoint_raw() const = 0; + virtual core::Line3D* geometry_raw() const = 0; + virtual core::Line3D* worldGeometry_raw() const = 0; + virtual SketchLine* nativeObject_raw() const = 0; + virtual SketchLine* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual bool isCenterLine_raw() const = 0; + virtual bool isCenterLine_raw(bool value) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchLine::startSketchPoint() const +{ + core::Ptr res = startSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchLine::endSketchPoint() const +{ + core::Ptr res = endSketchPoint_raw(); + return res; +} + +inline core::Ptr SketchLine::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr SketchLine::worldGeometry() const +{ + core::Ptr res = worldGeometry_raw(); + return res; +} + +inline core::Ptr SketchLine::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchLine::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline bool SketchLine::isCenterLine() const +{ + bool res = isCenterLine_raw(); + return res; +} + +inline bool SketchLine::isCenterLine(bool value) +{ + return isCenterLine_raw(value); +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHLINE_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchLineList.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchLineList.h new file mode 100644 index 0000000..414754b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchLineList.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHLINELIST_CPP__ +# define ADSK_FUSION_SKETCHLINELIST_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHLINELIST_API +# endif +#else +# define ADSK_FUSION_SKETCHLINELIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchLine; +}} + +namespace adsk { namespace fusion { + +/// A list of sketch lines. +class SketchLineList : public core::Base { +public: + + /// Function that returns the specified sketch line using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of sketch lines in the list. + size_t count() const; + + typedef SketchLine iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHLINELIST_API static const char* classType(); + ADSK_FUSION_SKETCHLINELIST_API const char* objectType() const override; + ADSK_FUSION_SKETCHLINELIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHLINELIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLine* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchLineList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchLineList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void SketchLineList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHLINELIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchLinearDimension.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchLinearDimension.h new file mode 100644 index 0000000..0bcbb5e --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchLinearDimension.h @@ -0,0 +1,111 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../FusionTypeDefs.h" +#include "SketchDimension.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHLINEARDIMENSION_CPP__ +# define ADSK_FUSION_SKETCHLINEARDIMENSION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHLINEARDIMENSION_API +# endif +#else +# define ADSK_FUSION_SKETCHLINEARDIMENSION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchEntity; +}} + +namespace adsk { namespace fusion { + +/// A linear dimension in a sketch. +class SketchLinearDimension : public SketchDimension { +public: + + /// The first entity being constrained. + core::Ptr entityOne() const; + + /// The second entity being constrained. + core::Ptr entityTwo() const; + + /// The orientation of this dimension. + DimensionOrientations orientation() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHLINEARDIMENSION_API static const char* classType(); + ADSK_FUSION_SKETCHLINEARDIMENSION_API const char* objectType() const override; + ADSK_FUSION_SKETCHLINEARDIMENSION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHLINEARDIMENSION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchEntity* entityOne_raw() const = 0; + virtual SketchEntity* entityTwo_raw() const = 0; + virtual DimensionOrientations orientation_raw() const = 0; + virtual SketchLinearDimension* nativeObject_raw() const = 0; + virtual SketchLinearDimension* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchLinearDimension::entityOne() const +{ + core::Ptr res = entityOne_raw(); + return res; +} + +inline core::Ptr SketchLinearDimension::entityTwo() const +{ + core::Ptr res = entityTwo_raw(); + return res; +} + +inline DimensionOrientations SketchLinearDimension::orientation() const +{ + DimensionOrientations res = orientation_raw(); + return res; +} + +inline core::Ptr SketchLinearDimension::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchLinearDimension::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHLINEARDIMENSION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchLines.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchLines.h new file mode 100644 index 0000000..ecabc85 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchLines.h @@ -0,0 +1,204 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHLINES_CPP__ +# define ADSK_FUSION_SKETCHLINES_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHLINES_API +# endif +#else +# define ADSK_FUSION_SKETCHLINES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchLine; + class SketchLineList; +}} +namespace adsk { namespace core { + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// The collection of lines in a sketch. This provides access to the existing +/// lines and supports the methods to create new lines. +class SketchLines : public core::Base { +public: + + /// Function that returns the specified sketch line using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of lines in the sketch. + size_t count() const; + + /// Creates a sketch line between the two input points. The input points + /// can be either existing SketchPoints or Point3D objects. If a SketchPoint + /// is used the new line will be based on that sketch point and update if the + /// sketch point is modified. + /// startPoint : The start point of the line. It can be a SketchPoint or Point3D object. + /// endPoint : The end point of the line. It can be a SketchPoint or Point3D object. + /// Returns the newly created SketchLine object or null if the creation failed. + core::Ptr addByTwoPoints(const core::Ptr& startPoint, const core::Ptr& endPoint); + + /// Creates four sketch lines representing a rectangle where the two points are the opposing corners + /// of the rectangle. The input points can be either existing SketchPoints or Point3D objects. + /// If a SketchPoint is used the new lines will be based on that sketch point and update if the + /// sketch point is modified. + /// pointOne : The first corner of the rectangle. It can be a SketchPoint or Point3D object. + /// pointTwo : The second corner of the rectangle. It can be a SketchPoint or Point3D object. + /// Returns the four new sketch lines or null if the creation failed. + core::Ptr addTwoPointRectangle(const core::Ptr& pointOne, const core::Ptr& pointTwo); + + /// Creates four sketch lines representing a rectangle where the first two points are the base corners + /// of the rectangle and the third point defines the height. + /// pointOne : The first corner of the rectangle. It can be a SketchPoint or Point3D object. + /// pointTwo : The first corner of the rectangle. It can be a SketchPoint or Point3D object. + /// pointThree : The first corner of the rectangle. a Point3D object defining the height of the rectangle. + /// Returns the four new sketch lines or null if the creation failed. + core::Ptr addThreePointRectangle(const core::Ptr& pointOne, const core::Ptr& pointTwo, const core::Ptr& pointThree); + + /// Creates four sketch lines representing a rectangle where the first point represents the center of + /// the rectangle. The second point is the corner of the rectangle and can be either an existing + /// SketchPoint or Point3D object. The four sketch lines are returned. + /// centerPoint : The center point of the rectangle + /// cornerPoint : The corner of the rectangle. It can be a SketchPoint or Point3D object. + /// Returns the four new sketch lines or null if the creation failed. + core::Ptr addCenterPointRectangle(const core::Ptr& centerPoint, const core::Ptr& cornerPoint); + + /// Creates a chamfer between two sketch lines. In the case where the two input lines cross each other creating + /// an "X" shape, this results in four quadrants where the chamfer can be placed. The point arguments are used + /// to define which of the four quadrants the chamfer should be created in. The two points define which side of + /// the two lines should be kept and the other end will be trimmed by the chamfer. The easiest way to use this is + /// to use the end points of the lines on the side you want to keep. + /// In the case where the lines don't intersect or connect at the end points, there is only one valid quadrant + /// for the chamfer so the points are ignored. + /// firstLine : The first line you want to chamfer. + /// firstLinePoint : A point on the first line that is on the side of the intersection with the second line that you want to keep. + /// secondLine : The second line you want to chamfer. + /// secondLinePoint : A point on the second line that is on the side of the intersection with the first line that you want to keep. + /// distanceOne : Defines the distance of the start point of the chamfer line from the intersection point of the two lines along the first line. + /// The distance is defined in centimeters. + /// distanceTwo : Defines the distance of the start point of the chamfer line from the intersection point of the two lines along the second line. + /// The distance is defined in centimeters. + /// Returns the newly created SketchLine object that represents the chamfer or null if the creation failed. + core::Ptr addDistanceChamfer(const core::Ptr& firstLine, const core::Ptr& firstLinePoint, const core::Ptr& secondLine, const core::Ptr& secondLinePoint, double distanceOne, double distanceTwo); + + /// Creates a chamfer between two sketch lines. In the case where the two input lines cross each other creating + /// an "X" shape, this results in four quadrants where the chamfer can be placed. The point arguments are used + /// to define which of the four quadrants the chamfer should be created in. The two points define which side of + /// the two lines should be kept and the other end will be trimmed by the chamfer. The easiest way to use this is + /// to use the end points of the lines on the side you want to keep. + /// In the case where the lines don't intersect or connect at the end points, there is only one valid quadrant + /// for the chamfer so the points are ignored. + /// firstLine : The first line you want to chamfer. + /// firstLinePoint : A point on the first line that is on the side of the intersection with the second line that you want to keep. + /// secondLine : The second line you want to chamfer. + /// secondLinePoint : A point on the second line that is on the side of the intersection with the first line that you want to keep. + /// distance : Defines the distance of the start point of the chamfer from the intersection point of the two lines along the first line. + /// The distance is defined in centimeters. + /// angle : Defines the angle of the chamfer as measured from the first line. + /// The angle is defined in radians. + /// Returns the newly created SketchLine object that represents the chamfer or null if the creation failed. + core::Ptr addAngleChamfer(const core::Ptr& firstLine, const core::Ptr& firstLinePoint, const core::Ptr& secondLine, const core::Ptr& secondLinePoint, double distance, double angle); + + typedef SketchLine iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHLINES_API static const char* classType(); + ADSK_FUSION_SKETCHLINES_API const char* objectType() const override; + ADSK_FUSION_SKETCHLINES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHLINES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLine* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SketchLine* addByTwoPoints_raw(core::Base* startPoint, core::Base* endPoint) = 0; + virtual SketchLineList* addTwoPointRectangle_raw(core::Base* pointOne, core::Base* pointTwo) = 0; + virtual SketchLineList* addThreePointRectangle_raw(core::Base* pointOne, core::Base* pointTwo, core::Point3D* pointThree) = 0; + virtual SketchLineList* addCenterPointRectangle_raw(core::Point3D* centerPoint, core::Base* cornerPoint) = 0; + virtual SketchLine* addDistanceChamfer_raw(SketchLine* firstLine, core::Point3D* firstLinePoint, SketchLine* secondLine, core::Point3D* secondLinePoint, double distanceOne, double distanceTwo) = 0; + virtual SketchLine* addAngleChamfer_raw(SketchLine* firstLine, core::Point3D* firstLinePoint, SketchLine* secondLine, core::Point3D* secondLinePoint, double distance, double angle) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchLines::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchLines::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SketchLines::addByTwoPoints(const core::Ptr& startPoint, const core::Ptr& endPoint) +{ + core::Ptr res = addByTwoPoints_raw(startPoint.get(), endPoint.get()); + return res; +} + +inline core::Ptr SketchLines::addTwoPointRectangle(const core::Ptr& pointOne, const core::Ptr& pointTwo) +{ + core::Ptr res = addTwoPointRectangle_raw(pointOne.get(), pointTwo.get()); + return res; +} + +inline core::Ptr SketchLines::addThreePointRectangle(const core::Ptr& pointOne, const core::Ptr& pointTwo, const core::Ptr& pointThree) +{ + core::Ptr res = addThreePointRectangle_raw(pointOne.get(), pointTwo.get(), pointThree.get()); + return res; +} + +inline core::Ptr SketchLines::addCenterPointRectangle(const core::Ptr& centerPoint, const core::Ptr& cornerPoint) +{ + core::Ptr res = addCenterPointRectangle_raw(centerPoint.get(), cornerPoint.get()); + return res; +} + +inline core::Ptr SketchLines::addDistanceChamfer(const core::Ptr& firstLine, const core::Ptr& firstLinePoint, const core::Ptr& secondLine, const core::Ptr& secondLinePoint, double distanceOne, double distanceTwo) +{ + core::Ptr res = addDistanceChamfer_raw(firstLine.get(), firstLinePoint.get(), secondLine.get(), secondLinePoint.get(), distanceOne, distanceTwo); + return res; +} + +inline core::Ptr SketchLines::addAngleChamfer(const core::Ptr& firstLine, const core::Ptr& firstLinePoint, const core::Ptr& secondLine, const core::Ptr& secondLinePoint, double distance, double angle) +{ + core::Ptr res = addAngleChamfer_raw(firstLine.get(), firstLinePoint.get(), secondLine.get(), secondLinePoint.get(), distance, angle); + return res; +} + +template inline void SketchLines::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHLINES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchOffsetCurvesDimension.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchOffsetCurvesDimension.h new file mode 100644 index 0000000..b148d18 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchOffsetCurvesDimension.h @@ -0,0 +1,91 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchDimension.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHOFFSETCURVESDIMENSION_CPP__ +# define ADSK_FUSION_SKETCHOFFSETCURVESDIMENSION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHOFFSETCURVESDIMENSION_API +# endif +#else +# define ADSK_FUSION_SKETCHOFFSETCURVESDIMENSION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class OffsetConstraint; +}} + +namespace adsk { namespace fusion { + +/// A SketchOffsetCurvesDimension object is created automatically whenever curves are offset. +class SketchOffsetCurvesDimension : public SketchDimension { +public: + + /// Returns the OffsetConstraint object that defines the curve offset. From the constraint + /// you can get the original curves, the offset curves, and the dimension controlling the offset distance. + core::Ptr offsetConstraint() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHOFFSETCURVESDIMENSION_API static const char* classType(); + ADSK_FUSION_SKETCHOFFSETCURVESDIMENSION_API const char* objectType() const override; + ADSK_FUSION_SKETCHOFFSETCURVESDIMENSION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHOFFSETCURVESDIMENSION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual OffsetConstraint* offsetConstraint_raw() const = 0; + virtual SketchOffsetCurvesDimension* nativeObject_raw() const = 0; + virtual SketchOffsetCurvesDimension* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchOffsetCurvesDimension::offsetConstraint() const +{ + core::Ptr res = offsetConstraint_raw(); + return res; +} + +inline core::Ptr SketchOffsetCurvesDimension::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchOffsetCurvesDimension::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHOFFSETCURVESDIMENSION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchOffsetDimension.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchOffsetDimension.h new file mode 100644 index 0000000..aa37178 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchOffsetDimension.h @@ -0,0 +1,101 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchDimension.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHOFFSETDIMENSION_CPP__ +# define ADSK_FUSION_SKETCHOFFSETDIMENSION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHOFFSETDIMENSION_API +# endif +#else +# define ADSK_FUSION_SKETCHOFFSETDIMENSION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchEntity; + class SketchLine; +}} + +namespace adsk { namespace fusion { + +/// An offset dimension in a sketch. +class SketchOffsetDimension : public SketchDimension { +public: + + /// The first line being constrained. + core::Ptr line() const; + + /// The second entity being constrained. (a parallel SketchLine or a SketchPoint) + core::Ptr entityTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHOFFSETDIMENSION_API static const char* classType(); + ADSK_FUSION_SKETCHOFFSETDIMENSION_API const char* objectType() const override; + ADSK_FUSION_SKETCHOFFSETDIMENSION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHOFFSETDIMENSION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLine* line_raw() const = 0; + virtual SketchEntity* entityTwo_raw() const = 0; + virtual SketchOffsetDimension* nativeObject_raw() const = 0; + virtual SketchOffsetDimension* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchOffsetDimension::line() const +{ + core::Ptr res = line_raw(); + return res; +} + +inline core::Ptr SketchOffsetDimension::entityTwo() const +{ + core::Ptr res = entityTwo_raw(); + return res; +} + +inline core::Ptr SketchOffsetDimension::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchOffsetDimension::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHOFFSETDIMENSION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchPoint.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchPoint.h new file mode 100644 index 0000000..31552d0 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchPoint.h @@ -0,0 +1,151 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchEntity.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHPOINT_CPP__ +# define ADSK_FUSION_SKETCHPOINT_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHPOINT_API +# endif +#else +# define ADSK_FUSION_SKETCHPOINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchEntityList; +}} +namespace adsk { namespace core { + class Point3D; + class Vector3D; +}} + +namespace adsk { namespace fusion { + +/// A point within a sketch. +class SketchPoint : public SketchEntity { +public: + + /// Returns a Point3D object which provides the position of the sketch point. + /// The returned geometry is always in sketch space. + core::Ptr geometry() const; + + /// Returns a Point3D object which provides the position of the sketch point in world space. + /// The returned coordinate takes into account the assembly context and the position of the + /// sketch in it's parent component, which means the coordinate will be returned in the root + /// component space. + core::Ptr worldGeometry() const; + + /// Moves the sketch geometry using the specified transform. + /// Move respects any constraints that would normally prohibit the move. + /// This will fail in the case where the IsReference property is true. + /// translation : The vector that defines the distance and direction to move. + /// Returns true if moving the sketch point was successful. + bool move(const core::Ptr& translation); + + /// Merges the input sketch point into this sketch point. This effectively + /// deletes the other sketch point and changes all entities that referenced + /// that sketch point to reference this sketch point. + /// This is the equivalent of dragging a sketch point on top of another + /// sketch point in the user interface. + /// point : The point to merge with this point. + /// Returns true if the merge was successful. + bool merge(const core::Ptr& point); + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + /// Returns the set of sketch entities that are directly connected to this point. For + /// example any entities that use this point as their start point or end point will be returned + /// and any circle, arc or ellipse who have this point as a center point will be returned. This + /// does not include entities that are related to the point through a constraint. + core::Ptr connectedEntities() const; + + ADSK_FUSION_SKETCHPOINT_API static const char* classType(); + ADSK_FUSION_SKETCHPOINT_API const char* objectType() const override; + ADSK_FUSION_SKETCHPOINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHPOINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual core::Point3D* geometry_raw() const = 0; + virtual core::Point3D* worldGeometry_raw() const = 0; + virtual bool move_raw(core::Vector3D* translation) = 0; + virtual bool merge_raw(SketchPoint* point) = 0; + virtual SketchPoint* nativeObject_raw() const = 0; + virtual SketchPoint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; + virtual SketchEntityList* connectedEntities_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchPoint::geometry() const +{ + core::Ptr res = geometry_raw(); + return res; +} + +inline core::Ptr SketchPoint::worldGeometry() const +{ + core::Ptr res = worldGeometry_raw(); + return res; +} + +inline bool SketchPoint::move(const core::Ptr& translation) +{ + bool res = move_raw(translation.get()); + return res; +} + +inline bool SketchPoint::merge(const core::Ptr& point) +{ + bool res = merge_raw(point.get()); + return res; +} + +inline core::Ptr SketchPoint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchPoint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} + +inline core::Ptr SketchPoint::connectedEntities() const +{ + core::Ptr res = connectedEntities_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHPOINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchPointList.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchPointList.h new file mode 100644 index 0000000..f7cea6b --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchPointList.h @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHPOINTLIST_CPP__ +# define ADSK_FUSION_SKETCHPOINTLIST_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHPOINTLIST_API +# endif +#else +# define ADSK_FUSION_SKETCHPOINTLIST_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchPoint; +}} + +namespace adsk { namespace fusion { + +/// A list of sketch points. +class SketchPointList : public core::Base { +public: + + /// Function that returns the specified sketch point using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of sketch points in the list. + size_t count() const; + + typedef SketchPoint iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHPOINTLIST_API static const char* classType(); + ADSK_FUSION_SKETCHPOINTLIST_API const char* objectType() const override; + ADSK_FUSION_SKETCHPOINTLIST_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHPOINTLIST_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchPointList::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchPointList::count() const +{ + size_t res = count_raw(); + return res; +} + +template inline void SketchPointList::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHPOINTLIST_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchPoints.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchPoints.h new file mode 100644 index 0000000..fc06dc6 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchPoints.h @@ -0,0 +1,104 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHPOINTS_CPP__ +# define ADSK_FUSION_SKETCHPOINTS_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHPOINTS_API +# endif +#else +# define ADSK_FUSION_SKETCHPOINTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchPoint; +}} +namespace adsk { namespace core { + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// A collection of sketch points. +class SketchPoints : public core::Base { +public: + + /// Function that returns the specified sketch using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of sketch points in the sketch. + size_t count() const; + + /// Creates a point at the specified location. This is the equivalent + /// of creating a sketch point using the Point command in the user + /// interface and will create a visible point in the graphics window. + /// point : The coordinate location to create the sketch point. + /// Returns the new sketch point or null if the creation fails. + core::Ptr add(const core::Ptr& point); + + typedef SketchPoint iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHPOINTS_API static const char* classType(); + ADSK_FUSION_SKETCHPOINTS_API const char* objectType() const override; + ADSK_FUSION_SKETCHPOINTS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHPOINTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SketchPoint* add_raw(core::Point3D* point) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchPoints::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchPoints::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SketchPoints::add(const core::Ptr& point) +{ + core::Ptr res = add_raw(point.get()); + return res; +} + +template inline void SketchPoints::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHPOINTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchRadialDimension.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchRadialDimension.h new file mode 100644 index 0000000..655bc07 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchRadialDimension.h @@ -0,0 +1,90 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "SketchDimension.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHRADIALDIMENSION_CPP__ +# define ADSK_FUSION_SKETCHRADIALDIMENSION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHRADIALDIMENSION_API +# endif +#else +# define ADSK_FUSION_SKETCHRADIALDIMENSION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; +}} + +namespace adsk { namespace fusion { + +/// An radial dimension in a sketch. +class SketchRadialDimension : public SketchDimension { +public: + + /// The arc or circle being constrained. + core::Ptr entity() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SKETCHRADIALDIMENSION_API static const char* classType(); + ADSK_FUSION_SKETCHRADIALDIMENSION_API const char* objectType() const override; + ADSK_FUSION_SKETCHRADIALDIMENSION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHRADIALDIMENSION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve* entity_raw() const = 0; + virtual SketchRadialDimension* nativeObject_raw() const = 0; + virtual SketchRadialDimension* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchRadialDimension::entity() const +{ + core::Ptr res = entity_raw(); + return res; +} + +inline core::Ptr SketchRadialDimension::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SketchRadialDimension::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHRADIALDIMENSION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchText.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchText.h new file mode 100644 index 0000000..089f8f2 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchText.h @@ -0,0 +1,306 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/CoreTypeDefs.h" +#include "../FusionTypeDefs.h" +#include "SketchEntity.h" +#include +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHTEXT_CPP__ +# define ADSK_FUSION_SKETCHTEXT_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHTEXT_API +# endif +#else +# define ADSK_FUSION_SKETCHTEXT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchCurve; + class SketchLineList; + class SketchTextDefinition; +}} +namespace adsk { namespace core { + class Curve3D; + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// Text in a sketch. +class SketchText : public SketchEntity { +public: + + /// Gets and sets the height of the text in centimeters. + double height() const; + bool height(double value); + + /// Gets and sets the text. This is a simple string and ignores any formatting defined within the text. + std::string text() const; + bool text(const std::string& value); + + /// Gets and sets the position of the text on the x-y plane of the sketch. The text must lie on the x-y plane so the Z component + /// of the point is ignored and always treated as zero. + core::Ptr position() const; + bool position(const core::Ptr& value); + + /// Gets and sets the name of the font to use. + std::string fontName() const; + bool fontName(const std::string& value); + + /// Gets and sets the angle of the text relative to the x-axis of the x-y plane of the sketch. + double angle() const; + bool angle(double value); + + /// Gets and sets the text style to apply to the entire text. This is a bitwise enum so styles + /// can be combined to apply multiple styles. For example you can apply bold and underline. + TextStyles textStyle() const; + bool textStyle(TextStyles value); + + /// Returns the four sketch lines that define the boundary of the sketch text. By adding constraints to these lines + /// you can associatively control the size, position and angle of the sketch text. + core::Ptr boundaryLines() const; + + /// Explodes the SketchText into a set of curves. The original SketchText is deleted as a result of calling this. + /// Returns an array of the sketch curves that were created that represent the text. + std::vector> explode(); + + /// Returns the underlying curves that define the outline of the text. Calling this does not affect the + /// SketchText and does not create any new sketch geometry but returns the geometrical definition of the + /// sketch outline. + /// Returns an array of transient curves that represent the outline of the text. + std::vector> asCurves(); + + /// Gets and sets if the text is flipped horizontally. + bool isHorizontalFlip() const; + bool isHorizontalFlip(bool value); + + /// Gets and sets if the text is flipped vertically. + bool isVerticalFlip() const; + bool isVerticalFlip(bool value); + + /// Sets this SketchTextInput to define text that fits along a specified path. Fitting on a path will + /// space the characters so the text fits along the entire length of the path entity. + /// path : The entity that defines the path for the text. This can be a SketchCurve or BRepEdge object. + /// isAbovePath : Indicates if the text should be positioned above or below the path entity. + /// Returns true if the setting the definition was successful. + bool redefineAsFitOnPath(const core::Ptr& path, bool isAbovePath); + + /// Sets this SketchTextInput to define text that follows along a specified path. + /// path : The entity that defines the path for the text. This can be a SketchCurve or BRepEdge object. + /// isAbovePath : Indicates if the text should be positioned above or below the path entity. + /// horizontalAlignment : Specifies the horizontal alignment of the text with respect to the path curve. + /// characterSpacing : The spacing between the characters. This is an additional spacing to apply that is defined + /// as a percentage of the default spacing. A spacing of 0 indicates no additional spacing. + /// A spacing of 50 indicates to use the default plus 50% of the default. + /// Returns true if the setting the definition was successful. + bool redefineAsAlongPath(const core::Ptr& path, bool isAbovePath, core::HorizontalAlignments horizontalAlignment, double characterSpacing); + + /// Gets the definition that is currently used to specify how the sketch text is defined. + core::Ptr definition() const; + + ADSK_FUSION_SKETCHTEXT_API static const char* classType(); + ADSK_FUSION_SKETCHTEXT_API const char* objectType() const override; + ADSK_FUSION_SKETCHTEXT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHTEXT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual double height_raw() const = 0; + virtual bool height_raw(double value) = 0; + virtual char* text_raw() const = 0; + virtual bool text_raw(const char * value) = 0; + virtual core::Point3D* position_raw() const = 0; + virtual bool position_raw(core::Point3D* value) = 0; + virtual char* fontName_raw() const = 0; + virtual bool fontName_raw(const char * value) = 0; + virtual double angle_raw() const = 0; + virtual bool angle_raw(double value) = 0; + virtual TextStyles textStyle_raw() const = 0; + virtual bool textStyle_raw(TextStyles value) = 0; + virtual SketchLineList* boundaryLines_raw() const = 0; + virtual SketchCurve** explode_raw(size_t& return_size) = 0; + virtual core::Curve3D** asCurves_raw(size_t& return_size) = 0; + virtual bool isHorizontalFlip_raw() const = 0; + virtual bool isHorizontalFlip_raw(bool value) = 0; + virtual bool isVerticalFlip_raw() const = 0; + virtual bool isVerticalFlip_raw(bool value) = 0; + virtual bool redefineAsFitOnPath_raw(core::Base* path, bool isAbovePath) = 0; + virtual bool redefineAsAlongPath_raw(core::Base* path, bool isAbovePath, core::HorizontalAlignments horizontalAlignment, double characterSpacing) = 0; + virtual SketchTextDefinition* definition_raw() const = 0; +}; + +// Inline wrappers + +inline double SketchText::height() const +{ + double res = height_raw(); + return res; +} + +inline bool SketchText::height(double value) +{ + return height_raw(value); +} + +inline std::string SketchText::text() const +{ + std::string res; + + char* p= text_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool SketchText::text(const std::string& value) +{ + return text_raw(value.c_str()); +} + +inline core::Ptr SketchText::position() const +{ + core::Ptr res = position_raw(); + return res; +} + +inline bool SketchText::position(const core::Ptr& value) +{ + return position_raw(value.get()); +} + +inline std::string SketchText::fontName() const +{ + std::string res; + + char* p= fontName_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool SketchText::fontName(const std::string& value) +{ + return fontName_raw(value.c_str()); +} + +inline double SketchText::angle() const +{ + double res = angle_raw(); + return res; +} + +inline bool SketchText::angle(double value) +{ + return angle_raw(value); +} + +inline TextStyles SketchText::textStyle() const +{ + TextStyles res = textStyle_raw(); + return res; +} + +inline bool SketchText::textStyle(TextStyles value) +{ + return textStyle_raw(value); +} + +inline core::Ptr SketchText::boundaryLines() const +{ + core::Ptr res = boundaryLines_raw(); + return res; +} + +inline std::vector> SketchText::explode() +{ + std::vector> res; + size_t s; + + SketchCurve** p= explode_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline std::vector> SketchText::asCurves() +{ + std::vector> res; + size_t s; + + core::Curve3D** p= asCurves_raw(s); + if(p) + { + res.assign(p, p+s); + core::DeallocateArray(p); + } + return res; +} + +inline bool SketchText::isHorizontalFlip() const +{ + bool res = isHorizontalFlip_raw(); + return res; +} + +inline bool SketchText::isHorizontalFlip(bool value) +{ + return isHorizontalFlip_raw(value); +} + +inline bool SketchText::isVerticalFlip() const +{ + bool res = isVerticalFlip_raw(); + return res; +} + +inline bool SketchText::isVerticalFlip(bool value) +{ + return isVerticalFlip_raw(value); +} + +inline bool SketchText::redefineAsFitOnPath(const core::Ptr& path, bool isAbovePath) +{ + bool res = redefineAsFitOnPath_raw(path.get(), isAbovePath); + return res; +} + +inline bool SketchText::redefineAsAlongPath(const core::Ptr& path, bool isAbovePath, core::HorizontalAlignments horizontalAlignment, double characterSpacing) +{ + bool res = redefineAsAlongPath_raw(path.get(), isAbovePath, horizontalAlignment, characterSpacing); + return res; +} + +inline core::Ptr SketchText::definition() const +{ + core::Ptr res = definition_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHTEXT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchTextDefinition.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchTextDefinition.h new file mode 100644 index 0000000..2ade605 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchTextDefinition.h @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHTEXTDEFINITION_CPP__ +# define ADSK_FUSION_SKETCHTEXTDEFINITION_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHTEXTDEFINITION_API +# endif +#else +# define ADSK_FUSION_SKETCHTEXTDEFINITION_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + +/// The base class for the classes that define how text can be defined. +class SketchTextDefinition : public core::Base { +public: + + ADSK_FUSION_SKETCHTEXTDEFINITION_API static const char* classType(); + ADSK_FUSION_SKETCHTEXTDEFINITION_API const char* objectType() const override; + ADSK_FUSION_SKETCHTEXTDEFINITION_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHTEXTDEFINITION_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual void placeholderSketchTextDefinition0() {} + virtual void placeholderSketchTextDefinition1() {} + virtual void placeholderSketchTextDefinition2() {} + virtual void placeholderSketchTextDefinition3() {} + virtual void placeholderSketchTextDefinition4() {} + virtual void placeholderSketchTextDefinition5() {} + virtual void placeholderSketchTextDefinition6() {} + virtual void placeholderSketchTextDefinition7() {} + virtual void placeholderSketchTextDefinition8() {} + virtual void placeholderSketchTextDefinition9() {} + virtual void placeholderSketchTextDefinition10() {} + virtual void placeholderSketchTextDefinition11() {} + virtual void placeholderSketchTextDefinition12() {} + virtual void placeholderSketchTextDefinition13() {} + virtual void placeholderSketchTextDefinition14() {} + virtual void placeholderSketchTextDefinition15() {} +}; + +// Inline wrappers +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHTEXTDEFINITION_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchTextInput.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchTextInput.h new file mode 100644 index 0000000..3ffffeb --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchTextInput.h @@ -0,0 +1,277 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/CoreTypeDefs.h" +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHTEXTINPUT_CPP__ +# define ADSK_FUSION_SKETCHTEXTINPUT_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHTEXTINPUT_API +# endif +#else +# define ADSK_FUSION_SKETCHTEXTINPUT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchTextDefinition; +}} +namespace adsk { namespace core { + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// The SketchTextInput object is equivalent to the Sketch Text dialog in that it collects all of the input required +/// to create sketch text. Once the properties of the SketchTextInput object have been defined, use the add method +/// to create the sketch text. A SketchTextInput object is created by using the createInput of the SketchTexts object. +class SketchTextInput : public core::Base { +public: + + /// Gets and sets the height of the text in centimeters. + double height() const; + bool height(double value); + + /// Gets and sets the text. + std::string text() const; + bool text(const std::string& value); + + /// Gets and sets the position of the text on the x-y plane of the sketch. The text must lie on the x-y plane so the Z component + /// of the point is ignored and always treated as zero. + core::Ptr position() const; + bool position(const core::Ptr& value); + + /// Gets and sets the name of the font to use. + std::string fontName() const; + bool fontName(const std::string& value); + + /// Gets and sets the angle of the text relative to the x-axis of the x-y plane of the sketch. + double angle() const; + bool angle(double value); + + /// Gets and sets the text style to apply to the entire text. This is a bitwise enum so styles + /// can be combined to apply multiple styles. For example you can apply bold and italic. + TextStyles textStyle() const; + bool textStyle(TextStyles value); + + /// Gets and sets if the text is flipped horizontally. + bool isHorizontalFlip() const; + bool isHorizontalFlip(bool value); + + /// Gets and sets if the text is flipped vertically. + bool isVerticalFlip() const; + bool isVerticalFlip(bool value); + + /// Sets this SketchTextInput to define text that fits along a specified path. Fitting on a path will + /// space the characters so the text fits along the entire length of the path entity. + /// path : The entity that defines the path for the text. This can be a SketchCurve or BRepEdge object. + /// isAbovePath : Indicates if the text should be positioned above or below the path entity. + /// Returns true if the setting the definition was successful. + bool setAsFitOnPath(const core::Ptr& path, bool isAbovePath); + + /// Sets this SketchTextInput to define text that follows along a specified path. + /// path : The entity that defines the path for the text. This can be a SketchCurve or BRepEdge object. + /// isAbovePath : Indicates if the text should be positioned above or below the path entity. + /// horizontalAlignment : Specifies the horizontal alignment of the text with respect to the path curve. + /// characterSpacing : The percentage change in default spacing between characters. + /// Returns true if the setting the definition was successful. + bool setAsAlongPath(const core::Ptr& path, bool isAbovePath, core::HorizontalAlignments horizontalAlignment, double characterSpacing); + + /// Defines the first corner point of the rectangle that will contain the text. + /// cornerPoint : Specifies the location of one of the corner points of the rectangle that will contain the text. + /// This can be a Point3D object, with a Z component of zero, to define any arbitrary location on the X-Y + /// plane of the sketch or it can be an existing SketchPoint that lies on the sketch X-Y plane. + /// diagonalPoint : Specifies the location of the diagonal point of the rectangle that will contain the text. This point + /// cannot be aligned vertically or horizontally to the corner point but be a diagonal point to define + /// a rectangle. This can be a Point3D object, with a Z component of zero, to define any arbitrary location on the X-Y + /// plane of the sketch or it can be an existing SketchPoint that lies on the sketch X-Y plane and the sketch point + /// will become the opposing corner point. + /// horizontalAlignment : Specifies the horizontal alignment of the text with respect to the text rectangle. + /// verticalAlignment : Specifies the vertical alignment of the text with respect to the text rectangle. + /// characterSpacing : The spacing between the characters. This is an additional spacing to apply that is defined + /// as a percentage of the default spacing. A spacing of 0 indicates no additional spacing. + /// A spacing of 50 indicates to use the default plus 50% of the default. + /// Returns true if the setting the definition was successful. + bool setAsMultiLine(const core::Ptr& cornerPoint, const core::Ptr& diagonalPoint, core::HorizontalAlignments horizontalAlignment, core::VerticalAlignments verticalAlignment, double characterSpacing); + + /// Returns the SketchTextDefinition object associated with this input. When the SketchTextInput is first created this + /// property will return null. Once one of the "set" methods have been called, this will return the SketchTextDefinition + /// of the appropriate type and can be used to make any additional changes to the text. + core::Ptr definition() const; + + ADSK_FUSION_SKETCHTEXTINPUT_API static const char* classType(); + ADSK_FUSION_SKETCHTEXTINPUT_API const char* objectType() const override; + ADSK_FUSION_SKETCHTEXTINPUT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHTEXTINPUT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual double height_raw() const = 0; + virtual bool height_raw(double value) = 0; + virtual char* text_raw() const = 0; + virtual bool text_raw(const char * value) = 0; + virtual core::Point3D* position_raw() const = 0; + virtual bool position_raw(core::Point3D* value) = 0; + virtual char* fontName_raw() const = 0; + virtual bool fontName_raw(const char * value) = 0; + virtual double angle_raw() const = 0; + virtual bool angle_raw(double value) = 0; + virtual TextStyles textStyle_raw() const = 0; + virtual bool textStyle_raw(TextStyles value) = 0; + virtual bool isHorizontalFlip_raw() const = 0; + virtual bool isHorizontalFlip_raw(bool value) = 0; + virtual bool isVerticalFlip_raw() const = 0; + virtual bool isVerticalFlip_raw(bool value) = 0; + virtual bool setAsFitOnPath_raw(core::Base* path, bool isAbovePath) = 0; + virtual bool setAsAlongPath_raw(core::Base* path, bool isAbovePath, core::HorizontalAlignments horizontalAlignment, double characterSpacing) = 0; + virtual bool setAsMultiLine_raw(core::Base* cornerPoint, core::Base* diagonalPoint, core::HorizontalAlignments horizontalAlignment, core::VerticalAlignments verticalAlignment, double characterSpacing) = 0; + virtual SketchTextDefinition* definition_raw() const = 0; +}; + +// Inline wrappers + +inline double SketchTextInput::height() const +{ + double res = height_raw(); + return res; +} + +inline bool SketchTextInput::height(double value) +{ + return height_raw(value); +} + +inline std::string SketchTextInput::text() const +{ + std::string res; + + char* p= text_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool SketchTextInput::text(const std::string& value) +{ + return text_raw(value.c_str()); +} + +inline core::Ptr SketchTextInput::position() const +{ + core::Ptr res = position_raw(); + return res; +} + +inline bool SketchTextInput::position(const core::Ptr& value) +{ + return position_raw(value.get()); +} + +inline std::string SketchTextInput::fontName() const +{ + std::string res; + + char* p= fontName_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool SketchTextInput::fontName(const std::string& value) +{ + return fontName_raw(value.c_str()); +} + +inline double SketchTextInput::angle() const +{ + double res = angle_raw(); + return res; +} + +inline bool SketchTextInput::angle(double value) +{ + return angle_raw(value); +} + +inline TextStyles SketchTextInput::textStyle() const +{ + TextStyles res = textStyle_raw(); + return res; +} + +inline bool SketchTextInput::textStyle(TextStyles value) +{ + return textStyle_raw(value); +} + +inline bool SketchTextInput::isHorizontalFlip() const +{ + bool res = isHorizontalFlip_raw(); + return res; +} + +inline bool SketchTextInput::isHorizontalFlip(bool value) +{ + return isHorizontalFlip_raw(value); +} + +inline bool SketchTextInput::isVerticalFlip() const +{ + bool res = isVerticalFlip_raw(); + return res; +} + +inline bool SketchTextInput::isVerticalFlip(bool value) +{ + return isVerticalFlip_raw(value); +} + +inline bool SketchTextInput::setAsFitOnPath(const core::Ptr& path, bool isAbovePath) +{ + bool res = setAsFitOnPath_raw(path.get(), isAbovePath); + return res; +} + +inline bool SketchTextInput::setAsAlongPath(const core::Ptr& path, bool isAbovePath, core::HorizontalAlignments horizontalAlignment, double characterSpacing) +{ + bool res = setAsAlongPath_raw(path.get(), isAbovePath, horizontalAlignment, characterSpacing); + return res; +} + +inline bool SketchTextInput::setAsMultiLine(const core::Ptr& cornerPoint, const core::Ptr& diagonalPoint, core::HorizontalAlignments horizontalAlignment, core::VerticalAlignments verticalAlignment, double characterSpacing) +{ + bool res = setAsMultiLine_raw(cornerPoint.get(), diagonalPoint.get(), horizontalAlignment, verticalAlignment, characterSpacing); + return res; +} + +inline core::Ptr SketchTextInput::definition() const +{ + core::Ptr res = definition_raw(); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHTEXTINPUT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SketchTexts.h b/usr/autodesk/CPP/include/Fusion/Sketch/SketchTexts.h new file mode 100644 index 0000000..2b43b21 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SketchTexts.h @@ -0,0 +1,141 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHTEXTS_CPP__ +# define ADSK_FUSION_SKETCHTEXTS_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHTEXTS_API +# endif +#else +# define ADSK_FUSION_SKETCHTEXTS_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class SketchText; + class SketchTextInput; +}} +namespace adsk { namespace core { + class Point3D; +}} + +namespace adsk { namespace fusion { + +/// The collection of text blocks in a sketch. This provides access to the existing +/// text blocks and supports creating new text blocks. +class SketchTexts : public core::Base { +public: + + /// Function that returns the specified sketch text using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the number of texts in the sketch. + size_t count() const; + + /// Creates a SketchTextInput object that can be used to define additional settings when creating sketch text. The + /// SketchTextInput object is equivalent to the Sketch Text dialog in that it collects all of the input required + /// to create sketch text. Once the properties of the SketchTextInput object have been defined, use the add method + /// to create the sketch text. + /// formattedText : The text used for the sketch text. This is a simple string as no additional formatting is currently supported. + /// height : The height of the text in centimeters. + /// position : The position of the text on the x-y plane of the sketch. The text must lie on the x-y plane so the Z component + /// of the point is ignored and always treated as zero. + /// Returns a SketchTextInput object that can be used to set additional formatting and is used as input to the add method. + core::Ptr createInput(const std::string& formattedText, double height, const core::Ptr& position); + + /// Creates a sketch text. + /// input : A SketchTextInput object created using the SketchTexts.createInput method. + /// Returns the newly created SketchText object or null in the case of failure. + core::Ptr add(const core::Ptr& input); + + /// Creates a SketchTextInput object that is used to define the additional input to create text. The SketchTextInput + /// object is equivalent to the Sketch Text dialog in that it collects all of the input required to create sketch text. + /// You must call setAsFitOnPath, setAsAlongPath, or setAsMultiLine methods to define one of the three types of text and + /// can use other and define any + /// setAs Once the properties of the SketchTextInput object have been defined, use the add method + /// to create the sketch text. + /// formattedText : The text used for the sketch text. This is a simple string as no additional formatting is currently supported. + /// height : The height of the text in centimeters. + /// Returns a SketchTextInput object that can be used to set additional formatting and is used as input to the add method. + core::Ptr createInput2(const std::string& formattedText, double height); + + typedef SketchText iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHTEXTS_API static const char* classType(); + ADSK_FUSION_SKETCHTEXTS_API const char* objectType() const override; + ADSK_FUSION_SKETCHTEXTS_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHTEXTS_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchText* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual SketchTextInput* createInput_raw(const char * formattedText, double height, core::Point3D* position) = 0; + virtual SketchText* add_raw(SketchTextInput* input) = 0; + virtual SketchTextInput* createInput2_raw(const char * formattedText, double height) = 0; +}; + +// Inline wrappers + +inline core::Ptr SketchTexts::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t SketchTexts::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr SketchTexts::createInput(const std::string& formattedText, double height, const core::Ptr& position) +{ + core::Ptr res = createInput_raw(formattedText.c_str(), height, position.get()); + return res; +} + +inline core::Ptr SketchTexts::add(const core::Ptr& input) +{ + core::Ptr res = add_raw(input.get()); + return res; +} + +inline core::Ptr SketchTexts::createInput2(const std::string& formattedText, double height) +{ + core::Ptr res = createInput2_raw(formattedText.c_str(), height); + return res; +} + +template inline void SketchTexts::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHTEXTS_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/Sketches.h b/usr/autodesk/CPP/include/Fusion/Sketch/Sketches.h new file mode 100644 index 0000000..bd9c982 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/Sketches.h @@ -0,0 +1,154 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SKETCHES_CPP__ +# define ADSK_FUSION_SKETCHES_API XI_EXPORT +# else +# define ADSK_FUSION_SKETCHES_API +# endif +#else +# define ADSK_FUSION_SKETCHES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class Sketch; +}} + +namespace adsk { namespace fusion { + +/// Provides access to the sketches within a design and provides +/// methods to create new sketches. +class Sketches : public core::Base { +public: + + /// Function that returns the specified sketch using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the + /// collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// Returns the sketch with the specified name. + /// name : The name of the sketch as seen in the browser and the timeline. + /// Returns the sketch or null if there isn't a sketch with that name. + core::Ptr itemByName(const std::string& name) const; + + /// Returns the number of sketches in a component + size_t count() const; + + /// Creates a new sketch on the specified planar entity. + /// planarEntity : A construction plane or planar face that defines the sketch plane + /// occurrenceForCreation : A creation occurrence is needed if the planarEntity is in another component AND the + /// sketch is not in the root component. The occurrenceForCreation is analogous + /// to the active occurrence in the UI. + /// Returns the newly created Sketch or null if the creation failed. + core::Ptr add(const core::Ptr& planarEntity, const core::Ptr& occurrenceForCreation = NULL); + + /// Creates a parametric sketch that is associated with a base feature. + /// Because of a current limitation, if you want to create a sketch associated with a base + /// feature, you must first call the edit method of the base feature, use this method to + /// create the sketch, and then call the finishEdit method of the base feature. The base + /// feature must be in an "edit" state to be able to add any additional items to it. + /// planarEntity : A construction plane or planar face that defines the sketch plane. + /// targetBaseOrFormFeature : The existing base feature that you want to associate this sketch with. + /// includeFaceEdges : When a BrepFace is used as the planarEntity argument, this defines if the edges of the face + /// should be included in the sketch. + /// Returns the newly created Sketch or null if the creation failed. + core::Ptr addToBaseOrFormFeature(const core::Ptr& planarEntity, const core::Ptr& targetBaseOrFormFeature, bool includeFaceEdges); + + /// Creates a new sketch on the specified planar entity. If a BRepFace is provided, the edges of the face + /// are not projected into the sketch so the result of creating a new sketch with this method will + /// always be a new empty sketch. + /// planarEntity : A construction plane or planar face that defines the sketch plane. + /// occurrenceForCreation : A creation occurrence is needed if the planarEntity is in another component AND the + /// sketch is not in the root component. The occurrenceForCreation is analogous + /// to the active occurrence in the UI. + /// Returns the newly created Sketch or null if the creation failed. + core::Ptr addWithoutEdges(const core::Ptr& planarEntity, const core::Ptr& occurrenceForCreation = NULL); + + typedef Sketch iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_SKETCHES_API static const char* classType(); + ADSK_FUSION_SKETCHES_API const char* objectType() const override; + ADSK_FUSION_SKETCHES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SKETCHES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual Sketch* item_raw(size_t index) const = 0; + virtual Sketch* itemByName_raw(const char * name) const = 0; + virtual size_t count_raw() const = 0; + virtual Sketch* add_raw(core::Base* planarEntity, Occurrence* occurrenceForCreation) = 0; + virtual Sketch* addToBaseOrFormFeature_raw(core::Base* planarEntity, core::Base* targetBaseOrFormFeature, bool includeFaceEdges) = 0; + virtual Sketch* addWithoutEdges_raw(core::Base* planarEntity, Occurrence* occurrenceForCreation) = 0; +}; + +// Inline wrappers + +inline core::Ptr Sketches::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline core::Ptr Sketches::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline size_t Sketches::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr Sketches::add(const core::Ptr& planarEntity, const core::Ptr& occurrenceForCreation) +{ + core::Ptr res = add_raw(planarEntity.get(), occurrenceForCreation.get()); + return res; +} + +inline core::Ptr Sketches::addToBaseOrFormFeature(const core::Ptr& planarEntity, const core::Ptr& targetBaseOrFormFeature, bool includeFaceEdges) +{ + core::Ptr res = addToBaseOrFormFeature_raw(planarEntity.get(), targetBaseOrFormFeature.get(), includeFaceEdges); + return res; +} + +inline core::Ptr Sketches::addWithoutEdges(const core::Ptr& planarEntity, const core::Ptr& occurrenceForCreation) +{ + core::Ptr res = addWithoutEdges_raw(planarEntity.get(), occurrenceForCreation.get()); + return res; +} + +template inline void Sketches::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SKETCHES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SmoothConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/SmoothConstraint.h new file mode 100644 index 0000000..72311cd --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SmoothConstraint.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SMOOTHCONSTRAINT_CPP__ +# define ADSK_FUSION_SMOOTHCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_SMOOTHCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_SMOOTHCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; +}} + +namespace adsk { namespace fusion { + +/// A smooth constraint in a sketch. +class SmoothConstraint : public GeometricConstraint { +public: + + /// Returns the first curve. + core::Ptr curveOne() const; + + /// Returns the second curve. + core::Ptr curveTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SMOOTHCONSTRAINT_API static const char* classType(); + ADSK_FUSION_SMOOTHCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_SMOOTHCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SMOOTHCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve* curveOne_raw() const = 0; + virtual SketchCurve* curveTwo_raw() const = 0; + virtual SmoothConstraint* nativeObject_raw() const = 0; + virtual SmoothConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SmoothConstraint::curveOne() const +{ + core::Ptr res = curveOne_raw(); + return res; +} + +inline core::Ptr SmoothConstraint::curveTwo() const +{ + core::Ptr res = curveTwo_raw(); + return res; +} + +inline core::Ptr SmoothConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SmoothConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SMOOTHCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/SymmetryConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/SymmetryConstraint.h new file mode 100644 index 0000000..e9944e4 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/SymmetryConstraint.h @@ -0,0 +1,111 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_SYMMETRYCONSTRAINT_CPP__ +# define ADSK_FUSION_SYMMETRYCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_SYMMETRYCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_SYMMETRYCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchEntity; + class SketchLine; +}} + +namespace adsk { namespace fusion { + +/// A symmetry constraint in a sketch. +class SymmetryConstraint : public GeometricConstraint { +public: + + /// Returns the first curve. + core::Ptr entityOne() const; + + /// Returns the second curve. + core::Ptr entityTwo() const; + + /// Returns the axis (SketchLine) that defines the symmetry. + core::Ptr symmetryLine() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_SYMMETRYCONSTRAINT_API static const char* classType(); + ADSK_FUSION_SYMMETRYCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_SYMMETRYCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_SYMMETRYCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchEntity* entityOne_raw() const = 0; + virtual SketchEntity* entityTwo_raw() const = 0; + virtual SketchLine* symmetryLine_raw() const = 0; + virtual SymmetryConstraint* nativeObject_raw() const = 0; + virtual SymmetryConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr SymmetryConstraint::entityOne() const +{ + core::Ptr res = entityOne_raw(); + return res; +} + +inline core::Ptr SymmetryConstraint::entityTwo() const +{ + core::Ptr res = entityTwo_raw(); + return res; +} + +inline core::Ptr SymmetryConstraint::symmetryLine() const +{ + core::Ptr res = symmetryLine_raw(); + return res; +} + +inline core::Ptr SymmetryConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr SymmetryConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_SYMMETRYCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/TangentConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/TangentConstraint.h new file mode 100644 index 0000000..e4a1a33 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/TangentConstraint.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TANGENTCONSTRAINT_CPP__ +# define ADSK_FUSION_TANGENTCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_TANGENTCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_TANGENTCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchCurve; +}} + +namespace adsk { namespace fusion { + +/// A tangent constraint in a sketch. +class TangentConstraint : public GeometricConstraint { +public: + + /// Returns the first curve. + core::Ptr curveOne() const; + + /// Returns the second curve. + core::Ptr curveTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_TANGENTCONSTRAINT_API static const char* classType(); + ADSK_FUSION_TANGENTCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_TANGENTCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TANGENTCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchCurve* curveOne_raw() const = 0; + virtual SketchCurve* curveTwo_raw() const = 0; + virtual TangentConstraint* nativeObject_raw() const = 0; + virtual TangentConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr TangentConstraint::curveOne() const +{ + core::Ptr res = curveOne_raw(); + return res; +} + +inline core::Ptr TangentConstraint::curveTwo() const +{ + core::Ptr res = curveTwo_raw(); + return res; +} + +inline core::Ptr TangentConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr TangentConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TANGENTCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/VerticalConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/VerticalConstraint.h new file mode 100644 index 0000000..234b451 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/VerticalConstraint.h @@ -0,0 +1,90 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_VERTICALCONSTRAINT_CPP__ +# define ADSK_FUSION_VERTICALCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_VERTICALCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_VERTICALCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchLine; +}} + +namespace adsk { namespace fusion { + +/// A vertical constraint in a sketch. +class VerticalConstraint : public GeometricConstraint { +public: + + /// Returns the line being constrained. + core::Ptr line() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_VERTICALCONSTRAINT_API static const char* classType(); + ADSK_FUSION_VERTICALCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_VERTICALCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_VERTICALCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchLine* line_raw() const = 0; + virtual VerticalConstraint* nativeObject_raw() const = 0; + virtual VerticalConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr VerticalConstraint::line() const +{ + core::Ptr res = line_raw(); + return res; +} + +inline core::Ptr VerticalConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr VerticalConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_VERTICALCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/Sketch/VerticalPointsConstraint.h b/usr/autodesk/CPP/include/Fusion/Sketch/VerticalPointsConstraint.h new file mode 100644 index 0000000..a5707f6 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/Sketch/VerticalPointsConstraint.h @@ -0,0 +1,100 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "GeometricConstraint.h" + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_VERTICALPOINTSCONSTRAINT_CPP__ +# define ADSK_FUSION_VERTICALPOINTSCONSTRAINT_API XI_EXPORT +# else +# define ADSK_FUSION_VERTICALPOINTSCONSTRAINT_API +# endif +#else +# define ADSK_FUSION_VERTICALPOINTSCONSTRAINT_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class Occurrence; + class SketchPoint; +}} + +namespace adsk { namespace fusion { + +/// A vertical constraint between two points in a sketch. +class VerticalPointsConstraint : public GeometricConstraint { +public: + + /// Returns the first point. + core::Ptr pointOne() const; + + /// Returns the second point. + core::Ptr pointTwo() const; + + /// The NativeObject is the object outside the context of an assembly and + /// in the context of it's parent component. + /// Returns null in the case where this object is not in the context of + /// an assembly but is already the native object. + core::Ptr nativeObject() const; + + /// Creates or returns a proxy for the native object + /// - i.e. a new object that represents this object but adds the assembly context + /// defined by the input occurrence. + /// occurrence : The occurrence that defines the context to create the proxy in. + /// Returns the proxy object or null if this isn't the NativeObject. + core::Ptr createForAssemblyContext(const core::Ptr& occurrence) const; + + ADSK_FUSION_VERTICALPOINTSCONSTRAINT_API static const char* classType(); + ADSK_FUSION_VERTICALPOINTSCONSTRAINT_API const char* objectType() const override; + ADSK_FUSION_VERTICALPOINTSCONSTRAINT_API void* queryInterface(const char* id) const override; + ADSK_FUSION_VERTICALPOINTSCONSTRAINT_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual SketchPoint* pointOne_raw() const = 0; + virtual SketchPoint* pointTwo_raw() const = 0; + virtual VerticalPointsConstraint* nativeObject_raw() const = 0; + virtual VerticalPointsConstraint* createForAssemblyContext_raw(Occurrence* occurrence) const = 0; +}; + +// Inline wrappers + +inline core::Ptr VerticalPointsConstraint::pointOne() const +{ + core::Ptr res = pointOne_raw(); + return res; +} + +inline core::Ptr VerticalPointsConstraint::pointTwo() const +{ + core::Ptr res = pointTwo_raw(); + return res; +} + +inline core::Ptr VerticalPointsConstraint::nativeObject() const +{ + core::Ptr res = nativeObject_raw(); + return res; +} + +inline core::Ptr VerticalPointsConstraint::createForAssemblyContext(const core::Ptr& occurrence) const +{ + core::Ptr res = createForAssemblyContext_raw(occurrence.get()); + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_VERTICALPOINTSCONSTRAINT_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/TSpline/TSplineBodies.h b/usr/autodesk/CPP/include/Fusion/TSpline/TSplineBodies.h new file mode 100644 index 0000000..d229795 --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/TSpline/TSplineBodies.h @@ -0,0 +1,125 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TSPLINEBODIES_CPP__ +# define ADSK_FUSION_TSPLINEBODIES_API XI_EXPORT +# else +# define ADSK_FUSION_TSPLINEBODIES_API +# endif +#else +# define ADSK_FUSION_TSPLINEBODIES_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class TSplineBody; +}} + +namespace adsk { namespace fusion { + +/// A collection of TSpline bodies. +class TSplineBodies : public core::Base { +public: + + /// Function that returns the specified T-Spline body using an index into the collection. + /// index : The index of the item within the collection to return. The first item in the collection has an index of 0. + /// Returns the specified item or null if an invalid index was specified. + core::Ptr item(size_t index) const; + + /// The number of bodies in the collection. + size_t count() const; + + /// Returns a TSplineBody by specifying the name of the body as seen in the browser. + /// name : The name of the body, as seen in the browser. This is case sensitive. + /// Returns the specified item or null if a body with that name was not found. + core::Ptr itemByName(const std::string& name) const; + + /// Creates a new TSplineBody by reading in a TSM file from disk. + /// tsmFilename : The full filename of the TSM file on disk. + /// Returns the newly created TSplineBody if successful or null in the case of failure. + core::Ptr addByTSMFile(const std::string& tsmFilename); + + /// Creates a new TSplineBody using the T-Spline description provided by the input + /// string which contains TSM formatted text. + /// tsmDescription : A string that contains a T-Spline description in TSM form. + /// Returns the newly created TSplineBody if successful or null in the case of failure. + core::Ptr addByTSMDescription(const std::string& tsmDescription); + + typedef TSplineBody iterable_type; + template void copyTo(OutputIterator result); + + ADSK_FUSION_TSPLINEBODIES_API static const char* classType(); + ADSK_FUSION_TSPLINEBODIES_API const char* objectType() const override; + ADSK_FUSION_TSPLINEBODIES_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TSPLINEBODIES_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual TSplineBody* item_raw(size_t index) const = 0; + virtual size_t count_raw() const = 0; + virtual TSplineBody* itemByName_raw(const char * name) const = 0; + virtual TSplineBody* addByTSMFile_raw(const char * tsmFilename) = 0; + virtual TSplineBody* addByTSMDescription_raw(const char * tsmDescription) = 0; +}; + +// Inline wrappers + +inline core::Ptr TSplineBodies::item(size_t index) const +{ + core::Ptr res = item_raw(index); + return res; +} + +inline size_t TSplineBodies::count() const +{ + size_t res = count_raw(); + return res; +} + +inline core::Ptr TSplineBodies::itemByName(const std::string& name) const +{ + core::Ptr res = itemByName_raw(name.c_str()); + return res; +} + +inline core::Ptr TSplineBodies::addByTSMFile(const std::string& tsmFilename) +{ + core::Ptr res = addByTSMFile_raw(tsmFilename.c_str()); + return res; +} + +inline core::Ptr TSplineBodies::addByTSMDescription(const std::string& tsmDescription) +{ + core::Ptr res = addByTSMDescription_raw(tsmDescription.c_str()); + return res; +} + +template inline void TSplineBodies::copyTo(OutputIterator result) +{ + for (size_t i = 0;i < count();++i) + { + *result = item(i); + ++result; + } +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TSPLINEBODIES_API \ No newline at end of file diff --git a/usr/autodesk/CPP/include/Fusion/TSpline/TSplineBody.h b/usr/autodesk/CPP/include/Fusion/TSpline/TSplineBody.h new file mode 100644 index 0000000..cb2667d --- /dev/null +++ b/usr/autodesk/CPP/include/Fusion/TSpline/TSplineBody.h @@ -0,0 +1,144 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Autodesk, Inc. All rights reserved. +// +// Use of this software is subject to the terms of the Autodesk license +// agreement provided at the time of installation or download, or which +// otherwise accompanies this software. +// +////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include "../../Core/Base.h" +#include "../FusionTypeDefs.h" +#include + +// THIS CLASS WILL BE VISIBLE TO AN API CLIENT. +// THIS HEADER FILE WILL BE GENERATED FROM NIDL. +#include "../../Core/OSMacros.h" + +#ifdef FUSIONXINTERFACE_EXPORTS +# ifdef __COMPILING_ADSK_FUSION_TSPLINEBODY_CPP__ +# define ADSK_FUSION_TSPLINEBODY_API XI_EXPORT +# else +# define ADSK_FUSION_TSPLINEBODY_API +# endif +#else +# define ADSK_FUSION_TSPLINEBODY_API XI_IMPORT +#endif + +namespace adsk { namespace fusion { + class FormFeature; +}} + +namespace adsk { namespace fusion { + +/// A TSpline body. +class TSplineBody : public core::Base { +public: + + /// Gets and sets the name of the body. If setting this property, there is the side-effect + /// that the B-Rep body created from this T-Spline body is also renamed. + std::string name() const; + bool name(const std::string& value); + + /// Returns the T-Spline body as a string in the form of a TSM description. + /// Returns the string formatted using the TSM format. + std::string getTSMDescription() const; + + /// Saves the body as a TSM file. + /// filename : The full filename of the file to save the body to. If the file already exists, + /// it will be overwritten. + /// Returns true if the file was successfully created. + bool saveAsTSMFile(const std::string& filename) const; + + /// Returns the owning form feature. + core::Ptr parentFormFeature() const; + + /// Returns a token for the TSplineBody object. This can be saved and used at a later + /// time with the Design.findEntityByToken method to get back the same T-Spline body. + /// When using entity tokens it's important to understand that the token string returned for a + /// specific entity can be different over time. However, even if you have two different token + /// strings that were obtained from the same entity, when you use findEntityByToken they + /// will both return the same entity. Because of that you should never compare entity tokens + /// as way to determine what the token represents. Instead, you need to use the findEntityByToken + /// method to get the two entities identified by the tokens and then compare them. + std::string entityToken() const; + + ADSK_FUSION_TSPLINEBODY_API static const char* classType(); + ADSK_FUSION_TSPLINEBODY_API const char* objectType() const override; + ADSK_FUSION_TSPLINEBODY_API void* queryInterface(const char* id) const override; + ADSK_FUSION_TSPLINEBODY_API static const char* interfaceId() { return classType(); } + +private: + + // Raw interface + virtual char* name_raw() const = 0; + virtual bool name_raw(const char * value) = 0; + virtual char* getTSMDescription_raw() const = 0; + virtual bool saveAsTSMFile_raw(const char * filename) const = 0; + virtual FormFeature* parentFormFeature_raw() const = 0; + virtual char* entityToken_raw() const = 0; +}; + +// Inline wrappers + +inline std::string TSplineBody::name() const +{ + std::string res; + + char* p= name_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool TSplineBody::name(const std::string& value) +{ + return name_raw(value.c_str()); +} + +inline std::string TSplineBody::getTSMDescription() const +{ + std::string res; + + char* p= getTSMDescription_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} + +inline bool TSplineBody::saveAsTSMFile(const std::string& filename) const +{ + bool res = saveAsTSMFile_raw(filename.c_str()); + return res; +} + +inline core::Ptr TSplineBody::parentFormFeature() const +{ + core::Ptr res = parentFormFeature_raw(); + return res; +} + +inline std::string TSplineBody::entityToken() const +{ + std::string res; + + char* p= entityToken_raw(); + if (p) + { + res = p; + core::DeallocateArray(p); + } + return res; +} +}// namespace fusion +}// namespace adsk + +#undef ADSK_FUSION_TSPLINEBODY_API \ No newline at end of file diff --git a/usr/autodesk/CPP/lib/cam.lib b/usr/autodesk/CPP/lib/cam.lib new file mode 100644 index 0000000..f6bf847 Binary files /dev/null and b/usr/autodesk/CPP/lib/cam.lib differ diff --git a/usr/autodesk/CPP/lib/core.lib b/usr/autodesk/CPP/lib/core.lib new file mode 100644 index 0000000..05a3b14 Binary files /dev/null and b/usr/autodesk/CPP/lib/core.lib differ diff --git a/usr/autodesk/CPP/lib/drawing.lib b/usr/autodesk/CPP/lib/drawing.lib new file mode 100644 index 0000000..68642f7 Binary files /dev/null and b/usr/autodesk/CPP/lib/drawing.lib differ diff --git a/usr/autodesk/CPP/lib/fusion.lib b/usr/autodesk/CPP/lib/fusion.lib new file mode 100644 index 0000000..60eb8ae Binary files /dev/null and b/usr/autodesk/CPP/lib/fusion.lib differ