FormIt C++ API  v22.0.0 (2022.1.0)
FormIt Core API Reference List

Description

Classes

struct  FormIt::kArrayToolRequestType
 Request Array Tool. More...
 
struct  FormIt::MessageStruct
 The base class for all messages. More...
 
struct  FormIt::MessagePayloadStruct
 This structure hides the implementation of the payload so it can't be used improperly. More...
 
struct  FormIt::MessageWithPayloadStruct
 The base class for all structures that have a payload. More...
 
struct  FormIt::MessageVoidStruct
 The base class for all structures that don't have a payload. More...
 
class  FormIt::MessageBroadcaster
 FormIt::MessageBroadcaster class. More...
 
class  FormIt::MessageListener
 FormIt::MessageListener class. More...
 

Macros

#define DECLARE_MESSAGE_CLASS(name, ...)
 
#define DECLARE_MESSAGE(name, ...)
 
#define DEFINE_MESSAGE(classname, name)
 The = {} here is required due to a defect (253) in the C++ standard. More...
 
#define DECLARE_MESSAGE_VOID_CLASS(name)
 
#define DECLARE_MESSAGE_VOID(name)
 
#define DEFINE_MESSAGE_VOID(classname, name)   const classname::name##Type classname::name = {}
 The = {} here is required due to a defect (253) in the C++ standard. More...
 

Functions

FORMIT_CORE_EXPORT void FormIt::NewFile (bool forced=false)
 App level. More...
 
FORMIT_CORE_EXPORT FormIt::Version FormIt::GetVersion ()
 GetVersion() function. More...
 
FORMIT_CORE_EXPORT json FormIt::FindLatestVersion (const json &versionJson, FormIt::Version const &testVersion={})
 Get the latest version string from the given version.json. More...
 
void FORMIT_CORE_EXPORT FormIt::SuspendMessaging (bool bSuppress, size_t nTopLevelHistory=WSM::INVALID_ID, bool bFullUpdate=true)
 SuspendMessaging suspends all update messages from WSM until ResumeMessaging is called. More...
 
void FORMIT_CORE_EXPORT FormIt::ResumeMessaging ()
 Resume messaging. More...
 
FORMIT_CORE_EXPORT void FormIt::SetCurveAccuracyOrCountDefault (double accuracyORcount)
 Set the curve accuracy for the application. More...
 
FORMIT_CORE_EXPORT double FormIt::GetCurveAccuracyOrCountDefault ()
 Get the curve accuracy for the application. More...
 
FORMIT_CORE_EXPORT void FormIt::SetSurfaceAccuracyOrCountDefault (double accuracyORcount)
 Set the default surface accuracy. More...
 
FORMIT_CORE_EXPORT double FormIt::GetSurfaceAccuracyOrCountDefault ()
 Get the default surface accuracy. More...
 
FORMIT_CORE_EXPORT FormIt::UnitType FormIt::GetUnitTypeDefault ()
 Get the Application (as opposed to Model) UnitType. This is the UnitType used when creating a new Model. More...
 
FORMIT_CORE_EXPORT void FormIt::SetUnitTypeDefault (FormIt::UnitType unitType)
 Set the Application (as opposed to Model) UnitType. More...
 
FORMIT_CORE_EXPORT double FormIt::GetCameraTransitionDuration ()
 Get the duration of animated camera transition. More...
 
FORMIT_CORE_EXPORT void FormIt::SetCameraTransitionDuration (double duration)
 Set the duration of animated camera transition. More...
 
FORMIT_CORE_EXPORT bool FormIt::HandleHUDTextInput (size_t widgetID, std::string input)
 Handle HUD canvas input text used in Dimension angle dialog box. More...
 
FORMIT_CORE_EXPORT void FormIt::SetKeyboardShortcutsEnabled (bool val)
 Enable/Disable Keyboard Shortcuts. More...
 
FORMIT_CORE_EXPORT bool FormIt::GetShowEditableDimensions ()
 GetShowEditableDimensions returns true if editable dimensions are being displayed. More...
 
FORMIT_CORE_EXPORT void FormIt::SetShowEditableDimensions (bool val)
 SetShowEditableDimensions sets if editable dimensions are being displayed. More...
 
FORMIT_CORE_EXPORT bool FormIt::SaveFile (std::string const &path, SaveOptions saveOptions, const std::vector< char > &previewImage={}, bool forSave=false, const FormIt::Files::FileOptions *exportOptions=nullptr)
 Save the current model to the given file name. More...
 
FORMIT_CORE_EXPORT bool FormIt::OpenFile (std::string const &path)
 Open the given file. More...
 
FORMIT_CORE_EXPORT bool FormIt::SaveFileForEnergyAnalysis (std::string const &path)
 Save the current model to the given file name for energy analysis. More...
 
FORMIT_CORE_EXPORT ::string FormIt::GetCurrentFileName ()
 Get the current model's file name. More...
 
FORMIT_CORE_EXPORT ::vector< char > FormIt::LoadPreviewImage (std::string const &sFileName)
 Get preview image from axm file. More...
 
FORMIT_CORE_EXPORT size_t FormIt::ImportToGroup (std::string const &fileType, std::string const &filePath)
 Import to a Group we need to pass in the file type we need to pass in the filepath this return a reference ID. More...
 
FORMIT_CORE_EXPORT void FormIt::SetLocaleForWeb (std::string const &nameCode)
 Set the local for web we need to pass in the localtype this return a void. More...
 
using FormIt::StringType = std::string_t
 

Macro Definition Documentation

◆ DECLARE_MESSAGE

#define DECLARE_MESSAGE (   name,
  ... 
)
Value:
struct name##Type : public FormIt::MessageWithPayloadStruct \
{ \
using Payload = __VA_ARGS__; \
FORMIT_CORE_EXPORT const Payload &extract( \
FormIt::MessagePayloadStruct const &payload) const; \
FORMIT_CORE_EXPORT std::string message() const override;\
}; \
extern FORMIT_CORE_EXPORT const name##Type name;
#define FORMIT_CORE_EXPORT
Definition: FormItCoreExport.h:10
Type
Definition: FormItCoreTypes.h:1115
This structure hides the implementation of the payload so it can't be used improperly.
Definition: FormItMessaging.h:36
virtual ::string message() const =0
message() function.
The base class for all structures that have a payload.
Definition: FormItMessaging.h:49

◆ DECLARE_MESSAGE_CLASS

#define DECLARE_MESSAGE_CLASS (   name,
  ... 
)
Value:
struct name##Type : public FormIt::MessageWithPayloadStruct \
{ \
using Payload = __VA_ARGS__; \
FORMIT_CORE_EXPORT const Payload &extract( \
FormIt::MessagePayloadStruct const &payload) const; \
FORMIT_CORE_EXPORT std::string message() const override;\
}; \
FORMIT_CORE_EXPORT const static name##Type name;

◆ DECLARE_MESSAGE_VOID

#define DECLARE_MESSAGE_VOID (   name)
Value:
struct name##Type : public FormIt::MessageVoidStruct { \
std::string message() const override \
{return std::string{"FormIt.Message."} + #name;} \
}; \
extern FORMIT_CORE_EXPORT const name##Type name;
The base class for all structures that don't have a payload.
Definition: FormItMessaging.h:59

◆ DECLARE_MESSAGE_VOID_CLASS

#define DECLARE_MESSAGE_VOID_CLASS (   name)
Value:
struct name##Type : public FormIt::MessageVoidStruct { \
std::string message() const override \
{return std::string{"FormIt.Message."} + #name;} \
}; \
FORMIT_CORE_EXPORT const static name##Type name;

◆ DEFINE_MESSAGE

#define DEFINE_MESSAGE (   classname,
  name 
)
Value:
const classname::name##Type classname::name = {}; \
const classname::name##Type::Payload & \
classname::name##Type::extract( \
FormIt::MessagePayloadStruct const &payload) const \
{ return cast<Payload>(payload); } \
std::string classname::name##Type::message() const \
{return std::string{"FormIt.Message."} + #name;}

The = {} here is required due to a defect (253) in the C++ standard.

MSVC and gcc have implemented the fix, but Clang has not.

◆ DEFINE_MESSAGE_VOID

#define DEFINE_MESSAGE_VOID (   classname,
  name 
)    const classname::name##Type classname::name = {}

The = {} here is required due to a defect (253) in the C++ standard.

MSVC and gcc have implemented the fix, but Clang has not.

Typedef Documentation

◆ StringType

using FormIt::StringType = typedef std::string_t

Function Documentation

◆ FindLatestVersion()

FORMIT_CORE_EXPORT json FormIt::FindLatestVersion ( const json &  versionJson,
FormIt::Version const &  testVersion = {} 
)

Get the latest version string from the given version.json.

Parameters
[in]versionJsonString
  • Force the creation of a new file without asking to save the file.
[in]versionJson
[in]testVersion

◆ GetCameraTransitionDuration()

FORMIT_CORE_EXPORT double FormIt::GetCameraTransitionDuration ( )

Get the duration of animated camera transition.

◆ GetCurrentFileName()

FORMIT_CORE_EXPORT ::string FormIt::GetCurrentFileName ( )

Get the current model's file name.

◆ GetCurveAccuracyOrCountDefault()

FORMIT_CORE_EXPORT double FormIt::GetCurveAccuracyOrCountDefault ( )

Get the curve accuracy for the application.

Any new Models created will use this accuracy.

Parameters
[in]accuracyORcount
  • MAX distance between base circle and segment as portion of R, if < .75
  • number of divisions (double rounded to int) over 90 degree arc, if >= .75

◆ GetShowEditableDimensions()

FORMIT_CORE_EXPORT bool FormIt::GetShowEditableDimensions ( )

GetShowEditableDimensions returns true if editable dimensions are being displayed.

HAS SC

◆ GetSurfaceAccuracyOrCountDefault()

FORMIT_CORE_EXPORT double FormIt::GetSurfaceAccuracyOrCountDefault ( )

Get the default surface accuracy.

◆ GetUnitTypeDefault()

FORMIT_CORE_EXPORT FormIt::UnitType FormIt::GetUnitTypeDefault ( )

Get the Application (as opposed to Model) UnitType. This is the UnitType used when creating a new Model.

◆ GetVersion()

FORMIT_CORE_EXPORT FormIt::Version FormIt::GetVersion ( )

GetVersion() function.

◆ HandleHUDTextInput()

FORMIT_CORE_EXPORT bool FormIt::HandleHUDTextInput ( size_t  widgetID,
std::string  input 
)

Handle HUD canvas input text used in Dimension angle dialog box.

Parameters
[in]widgetID
[in]input

◆ ImportToGroup()

FORMIT_CORE_EXPORT size_t FormIt::ImportToGroup ( std::string const &  fileType,
std::string const &  filePath 
)

Import to a Group we need to pass in the file type we need to pass in the filepath this return a reference ID.

Parameters
[in]fileType
[in]filePath

◆ LoadPreviewImage()

FORMIT_CORE_EXPORT ::vector<char> FormIt::LoadPreviewImage ( std::string const &  sFileName)

Get preview image from axm file.

Parameters
[in]sFileName

◆ NewFile()

FORMIT_CORE_EXPORT void FormIt::NewFile ( bool  forced = false)

App level.

Create a new file.

Parameters
[in]forced
  • Force the creation of a new file without asking to save the file.

◆ OpenFile()

FORMIT_CORE_EXPORT bool FormIt::OpenFile ( std::string const &  path)

Open the given file.

Parameters
[in]path

◆ ResumeMessaging()

void FORMIT_CORE_EXPORT FormIt::ResumeMessaging ( )

Resume messaging.

◆ SaveFile()

FORMIT_CORE_EXPORT bool FormIt::SaveFile ( std::string const &  path,
SaveOptions  saveOptions,
const std::vector< char > &  previewImage = {},
bool  forSave = false,
const FormIt::Files::FileOptions exportOptions = nullptr 
)

Save the current model to the given file name.

"forSave" should be set to true when doing a real Save which will reset the project modified flag. WHen left as false the project modified flag will not be cleared

Parameters
[in]path
[in]saveOptions
[in]previewImage
[in]forSave
[in]exportOptions

◆ SaveFileForEnergyAnalysis()

FORMIT_CORE_EXPORT bool FormIt::SaveFileForEnergyAnalysis ( std::string const &  path)

Save the current model to the given file name for energy analysis.

The saved model will include only visible objects, all bodies will be merged, and no materials will be saved. This is not a "real" save, so the modified project flag will not be reset.

Parameters
[in]path

◆ SetCameraTransitionDuration()

FORMIT_CORE_EXPORT void FormIt::SetCameraTransitionDuration ( double  duration)

Set the duration of animated camera transition.

If set to zero or less no transition is performed. Should be kept at a reasonable limit (1 second max?)

Parameters
[in]duration

◆ SetCurveAccuracyOrCountDefault()

FORMIT_CORE_EXPORT void FormIt::SetCurveAccuracyOrCountDefault ( double  accuracyORcount)

Set the curve accuracy for the application.

Any new Models created will use this accuracy.

Parameters
[in]accuracyORcount
  • MAX distance between base circle and segment as portion of R, if < .75
  • number of divisions (double rounded to int) over 90 degree arc, if >= .75

◆ SetKeyboardShortcutsEnabled()

FORMIT_CORE_EXPORT void FormIt::SetKeyboardShortcutsEnabled ( bool  val)

Enable/Disable Keyboard Shortcuts.

Parameters
[in]val

◆ SetLocaleForWeb()

FORMIT_CORE_EXPORT void FormIt::SetLocaleForWeb ( std::string const &  nameCode)

Set the local for web we need to pass in the localtype this return a void.

Parameters
[in]nameCode

◆ SetShowEditableDimensions()

FORMIT_CORE_EXPORT void FormIt::SetShowEditableDimensions ( bool  val)

SetShowEditableDimensions sets if editable dimensions are being displayed.

HAS SC

Parameters
[in]val

◆ SetSurfaceAccuracyOrCountDefault()

FORMIT_CORE_EXPORT void FormIt::SetSurfaceAccuracyOrCountDefault ( double  accuracyORcount)

Set the default surface accuracy.

Parameters
[in]accuracyORcount
  • MAX distance between sphere and planar face as portion of R, if < .75
  • number of divisions (rounded double) over 90 degree arc, if >= .75

◆ SetUnitTypeDefault()

FORMIT_CORE_EXPORT void FormIt::SetUnitTypeDefault ( FormIt::UnitType  unitType)

Set the Application (as opposed to Model) UnitType.

This is the UnitType used when creating a new Model.

Parameters
[in]unitType

◆ SuspendMessaging()

void FORMIT_CORE_EXPORT FormIt::SuspendMessaging ( bool  bSuppress,
size_t  nTopLevelHistory = WSM::INVALID_ID,
bool  bFullUpdate = true 
)

SuspendMessaging suspends all update messages from WSM until ResumeMessaging is called.

The top level history ID provided is included in the kLoadComplete message sent upon resume. This tells the receiver of the message into which history the load was done. The bSuppress parameter can be set to false to indicate that the object should not take effect. This is used to allow run-time determination. The bFullUpdate can be set to false so that only modified that will be updated.

Parameters
[in]bSuppress
[in]nTopLevelHistory
[in]bFullUpdate