Rework c++ docs

This commit is contained in:
Thomas Krijnen
2026-08-08 03:44:56 +02:00
parent 1a931ddfd9
commit 8870ffb018
8 changed files with 146 additions and 140 deletions
+17 -46
View File
@@ -117,10 +117,7 @@ namespace ifcopenshell {
struct ReorientShells : public SettingBase<ReorientShells, bool> {
static constexpr const char* const name = "reorient-shells";
static constexpr const char* const description = "Specifies whether to orient the faces of IfcConnectedFaceSets. "
"This is a potentially time consuming operation, but guarantees a "
"consistent orientation of surface normals, even if the faces are not "
"properly oriented in the IFC file.";
static constexpr const char* const description = "Specifies whether to orient the faces of IfcConnectedFaceSets. This is a potentially time consuming operation, but guarantees a consistent orientation of surface normals, even if the faces are not properly oriented in the IFC file.";
static constexpr bool defaultvalue = false;
};
@@ -144,15 +141,13 @@ namespace ifcopenshell {
struct LayersetFirst : public SettingBase<LayersetFirst, bool> {
static constexpr const char* const name = "layerset-first";
static constexpr const char* const description = "Assigns the first layer material of the layerset "
"to the complete product.";
static constexpr const char* const description = "Assigns the first layer material of the layerset to the complete product.";
static constexpr bool defaultvalue = false;
};
struct DisableBooleanResult : public SettingBase<DisableBooleanResult, bool> {
static constexpr const char* const name = "disable-boolean-result";
static constexpr const char* const description = "Specifies whether to disable the boolean operation within representations "
"such as clippings by means of IfcBooleanResult and subtypes";
static constexpr const char* const description = "Specifies whether to disable the boolean operation within representations such as clippings by means of IfcBooleanResult and subtypes";
static constexpr bool defaultvalue = false;
};
@@ -170,9 +165,7 @@ namespace ifcopenshell {
struct PrecisionFactor : public SettingBase<PrecisionFactor, double> {
static constexpr const char* const name = "precision-factor";
static constexpr const char* const description = "Option to increase linear tolerance for more permissive edge curves and fewer artifacts after "
"boolean operations at the expense of geometric detail "
"due to vertex collapsing and wire intersection fuzziness.";
static constexpr const char* const description = "Option to increase linear tolerance for more permissive edge curves and fewer artifacts after boolean operations at the expense of geometric detail due to vertex collapsing and wire intersection fuzziness.";
static constexpr double defaultvalue = 1.0;
};
@@ -192,41 +185,31 @@ namespace ifcopenshell {
struct WeldVertices : public SettingBase<WeldVertices, bool> {
static constexpr const char* const name = "weld-vertices";
static constexpr const char* const description = "Specifies whether vertices are welded, meaning that the coordinates "
"vector will only contain unique xyz-triplets. This results in a "
"manifold mesh which is useful for modelling applications, but might "
"result in unwanted shading artefacts in rendering applications.";
static constexpr const char* const description = "Specifies whether vertices are welded, meaning that the coordinates vector will only contain unique xyz-triplets. This results in a manifold mesh which is useful for modelling applications, but might result in unwanted shading artefacts in rendering applications.";
static constexpr bool defaultvalue = true;
};
struct UseWorldCoords : public SettingBase<UseWorldCoords, bool> {
static constexpr const char* const name = "use-world-coords";
static constexpr const char* const description = "Specifies whether to apply the local placements of building elements "
"directly to the coordinates of the representation mesh rather than "
"to represent the local placement in the 4x3 matrix, which will in that "
"case be the identity matrix.";
static constexpr const char* const description = "Specifies whether to apply the local placements of building elements directly to the coordinates of the representation mesh rather than to represent the local placement in the 4x3 matrix, which will in that case be the identity matrix.";
static constexpr bool defaultvalue = false;
};
struct UnifyShapes : public SettingBase<UnifyShapes, bool> {
static constexpr const char* const name = "unify-shapes";
static constexpr const char* const description = "Unify adjacent co-planar and co-linear subshapes (topological entities "
"sharing the same geometric domain) before triangulation or further processing";
static constexpr const char* const description = "Unify adjacent co-planar and co-linear subshapes (topological entities sharing the same geometric domain) before triangulation or further processing";
static constexpr bool defaultvalue = false;
};
struct UseMaterialNames : public SettingBase<UseMaterialNames, bool> {
static constexpr const char* const name = "use-material-names";
static constexpr const char* const description = "Use material names instead of unique IDs for naming materials upon serialization. "
"Applicable for OBJ and DAE output.";
static constexpr const char* const description = "Use material names instead of unique IDs for naming materials upon serialization. Applicable for OBJ and DAE output.";
static constexpr bool defaultvalue = false;
};
struct ConvertBackUnits : public SettingBase<ConvertBackUnits, bool> {
static constexpr const char* const name = "convert-back-units";
static constexpr const char* const description = "Specifies whether to convert back geometrical output back to the "
"unit of measure in which it is defined in the IFC file. Default is "
"to use meters.";
static constexpr const char* const description = "Specifies whether to convert back geometrical output back to the unit of measure in which it is defined in the IFC file. Default is to use meters.";
static constexpr bool defaultvalue = false;
};
@@ -260,10 +243,7 @@ namespace ifcopenshell {
struct OutputDimensionality : public SettingBase<OutputDimensionality, OutputDimensionalityTypes> {
static constexpr const char* const name = "dimensionality";
static constexpr const char* const description =
"Specifies whether to include curves and/or surfaces and solids in the output result. "
"Defaults to only surfaces and solids (SURFACES_AND_SOLIDS). "
"Other possible values are CURVES, CURVES_SURFACES_AND_SOLIDS.";
static constexpr const char* const description = "Specifies whether to include curves and/or surfaces and solids in the output result. Defaults to only surfaces and solids (SURFACES_AND_SOLIDS). Other possible values are CURVES, CURVES_SURFACES_AND_SOLIDS.";
static constexpr OutputDimensionalityTypes defaultvalue = SURFACES_AND_SOLIDS;
};
@@ -283,8 +263,7 @@ namespace ifcopenshell {
struct DisableOpeningSubtractions : public SettingBase<DisableOpeningSubtractions, bool> {
static constexpr const char* const name = "disable-opening-subtractions";
static constexpr const char* const description = "Specifies whether to disable the boolean subtraction of "
"IfcOpeningElement Representations from their RelatingElements.";
static constexpr const char* const description = "Specifies whether to disable the boolean subtraction of IfcOpeningElement Representations from their RelatingElements.";
static constexpr bool defaultvalue = false;
};
@@ -302,30 +281,25 @@ namespace ifcopenshell {
struct DontEmitNormals : public SettingBase<DontEmitNormals, bool> {
static constexpr const char* const name = "no-normals";
static constexpr const char* const description = "Disables computation of normals.Saves time and file size and is useful "
"in instances where you're going to recompute normals for the exported "
"model in other modelling application in any case.";
static constexpr const char* const description = "Disables computation of normals.Saves time and file size and is useful in instances where you're going to recompute normals for the exported model in other modelling application in any case.";
static constexpr bool defaultvalue = false;
};
struct GenerateUvs : public SettingBase<GenerateUvs, bool> {
static constexpr const char* const name = "generate-uvs";
static constexpr const char* const description = "Generates UVs (texture coordinates) by using simple box projection. Requires normals. "
"Not guaranteed to work properly if used with --weld-vertices.";
static constexpr const char* const description = "Generates UVs (texture coordinates) by using simple box projection. Requires normals. Not guaranteed to work properly if used with --weld-vertices.";
static constexpr bool defaultvalue = false;
};
struct ApplyLayerSets : public SettingBase<ApplyLayerSets, bool> {
static constexpr const char* const name = "enable-layerset-slicing";
static constexpr const char* const description = "Specifies whether to enable the slicing of products according "
"to their associated IfcMaterialLayerSet.";
static constexpr const char* const description = "Specifies whether to enable the slicing of products according to their associated IfcMaterialLayerSet.";
static constexpr bool defaultvalue = false;
};
struct UseElementHierarchy : public SettingBase<UseElementHierarchy, bool> {
static constexpr const char* const name = "element-hierarchy";
static constexpr const char* const description = "Assign the elements using their e.g IfcBuildingStorey parent."
"Applicable to DAE output.";
static constexpr const char* const description = "Assign the elements using their e.g IfcBuildingStorey parent.Applicable to DAE output.";
static constexpr bool defaultvalue = false;
};
@@ -343,8 +317,7 @@ namespace ifcopenshell {
struct SiteLocalPlacement : public SettingBase<SiteLocalPlacement, bool> {
static constexpr const char* const name = "site-local-placement";
static constexpr const char* const description = "Place elements locally in the IfcSite coordinate system, instead of placing "
"them in the IFC global coords. Applicable for OBJ, DAE, and STP output.";
static constexpr const char* const description = "Place elements locally in the IfcSite coordinate system, instead of placing them in the IFC global coords. Applicable for OBJ, DAE, and STP output.";
static constexpr bool defaultvalue = false;
};
@@ -421,9 +394,7 @@ namespace ifcopenshell {
struct KeepBoundingBoxes : public SettingBase<KeepBoundingBoxes, bool> {
static constexpr const char* const name = "keep-bounding-boxes";
static constexpr const char* const description =
"Default is to removes IfcBoundingBox from model prior to converting geometry."
"Setting this option disables that behaviour";
static constexpr const char* const description = "Default is to removes IfcBoundingBox from model prior to converting geometry.Setting this option disables that behaviour";
static constexpr bool defaultvalue = false;
};
+5 -12
View File
@@ -31,29 +31,25 @@ inline namespace settings {
struct UseElementNames : public SettingBase<UseElementNames, bool> {
static constexpr const char* const name = "use-element-names";
static constexpr const char* const description = "Use entity instance IfcRoot.Name instead of unique IDs for naming elements upon serialization. "
"Applicable for OBJ, DAE, STP, and SVG output.";
static constexpr const char* const description = "Use entity instance IfcRoot.Name instead of unique IDs for naming elements upon serialization. Applicable for OBJ, DAE, STP, and SVG output.";
static constexpr bool defaultvalue = false;
};
struct UseElementGuids : public SettingBase<UseElementGuids, bool> {
static constexpr const char* const name = "use-element-guids";
static constexpr const char* const description = "Use entity instance IfcRoot.GlobalId instead of unique IDs for naming elements upon serialization. "
"Applicable for OBJ, DAE, STP, and SVG output.";
static constexpr const char* const description = "Use entity instance IfcRoot.GlobalId instead of unique IDs for naming elements upon serialization. Applicable for OBJ, DAE, STP, and SVG output.";
static constexpr bool defaultvalue = false;
};
struct UseElementStepIds : public SettingBase<UseElementStepIds, bool> {
static constexpr const char* const name = "use-element-step-ids";
static constexpr const char* const description = "Use the numeric step identifier (entity instance name) for naming elements upon serialization. "
"Applicable for OBJ, DAE, STP, and SVG output.";
static constexpr const char* const description = "Use the numeric step identifier (entity instance name) for naming elements upon serialization. Applicable for OBJ, DAE, STP, and SVG output.";
static constexpr bool defaultvalue = false;
};
struct UseElementTypes : public SettingBase<UseElementTypes, bool> {
static constexpr const char* const name = "use-element-types";
static constexpr const char* const description = "Use element types instead of unique IDs for naming elements upon serialization. "
"Applicable to DAE output.";
static constexpr const char* const description = "Use element types instead of unique IDs for naming elements upon serialization. Applicable to DAE output.";
static constexpr bool defaultvalue = false;
};
@@ -71,10 +67,7 @@ inline namespace settings {
struct FloatingPointDigits : public SettingBase<FloatingPointDigits, int> {
static constexpr const char* const name = "digits";
static constexpr const char* const description = "Sets the precision to be used to format floating-point values, 15 by default. "
"Use a negative value to use the system's default precision (should be 6 typically). "
"Applicable for OBJ and DAE output. For DAE output, value >= 15 means that up to 16 decimals are used, "
" and any other value means that 6 or 7 decimals are used.";
static constexpr const char* const description = "Sets the precision to be used to format floating-point values, 15 by default. Use a negative value to use the system's default precision (should be 6 typically). Applicable for OBJ and DAE output. For DAE output, value >= 15 means that up to 16 decimals are used, and any other value means that 6 or 7 decimals are used.";
static constexpr int defaultvalue = 15;
};
+6 -4
View File
@@ -247,8 +247,9 @@ public:
/// Constructs an file object from a file path, supports IFC-SPF and the IfcOpenShell-specific RocksDB format.
/// </summary>
/// <param name="path">UTF-8 file path to an IFC-SPF file or RocksDB database directory</param>
/// <param name="ty">File type of the path</param>
/// <param name="readonly">Whether to open in read-only mode, only supported on RocksDB databases</param>
/// <param name="type">File type of the path</param>
/// <param name="read_only">Whether to open in read-only mode, only supported on RocksDB databases</param>
/// <param name="logger">Logger used while opening the file</param>
file(const std::string& path, filetype type = FT_AUTODETECT, bool read_only = false, ::logger& logger = ::logger::root());
/// <summary>
@@ -263,11 +264,12 @@ public:
/// <summary>
/// Constructs an file object with the specified schema, file type, and file path.
/// @nb path is only used in rocksdb mode, for spf file is in-memory only until write() is called
/// @note path is only used in RocksDB mode; an SPF file is in memory only until write() is called.
/// </summary>
/// <param name="schema">Pointer to the schema definition to use. Defaults to the IFC4 schema if not specified.</param>
/// <param name="ty">The file type to use for the file. Defaults to FT_AUTODETECT.</param>
/// <param name="type">The file type to use for the file. Defaults to FT_AUTODETECT.</param>
/// <param name="path">The file system path to the IFC file. Defaults to an empty string.</param>
/// <param name="logger">Logger used while creating the file.</param>
file(const ifcopenshell::schema_definition* schema = ifcopenshell::schema_by_name("IFC4"), filetype type = FT_AUTODETECT, const std::string& path = "", ::logger& logger = ::logger::root());
/// <summary>