CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FxBIMUnits.h
Go to the documentation of this file.
1//
2// (C) Copyright 2020-2023 by Graebert GmbH.
3//
4// Permission to use, copy, modify, and distribute this software in
5// object code form for any purpose and without fee is hereby granted,
6// provided that the above copyright notice appears in all copies and
7// that both that copyright notice and the limited warranty and
8// restricted rights notice below appear in all supporting
9// documentation.
10//
11// GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12// GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15// UNINTERRUPTED OR ERROR FREE.
16
17#pragma once
18
19#include "FxBIM.h"
20#include "FxBIMProperty.h"
21
22#include <DbUnitsFormatter.h>
23
24#include <map>
25
27{
28public:
32
35
36 static BimUnitsLength GetUnitUpgrade( BimUnitsLength currentUnit, PropertyType propertyType );
38
40
44
45 static OdString GetSuffix( OdDbDatabasePtr pDb, PropertyType propertyType, bool alternate = false );
46
47 static bool IsUnitSuffixRequiredInLabel( OdDbDatabasePtr database, PropertyType propertyType, bool bIsHeterogeneousUnits );
48 static bool IsUnitSuffixRequiredInView( OdDbDatabasePtr database, PropertyType propertyType );
49
50
51private:
52 static const std::map<BimUnitsLength, std::vector<OdString>> mLengthSuffixes;
53 static const std::map<BimUnitsArea, std::vector<OdString>> mAreaSuffixes;
54 static const std::map<BimUnitsVolume, std::vector<OdString>> mVolumeSuffixes;
55};
double OdDouble
Definition: DoubleArray.h:31
BimUnitsLength
Definition: FxBIM.h:290
BimUnitsVolume
Definition: FxBIM.h:326
#define FXBIM_COMMON_CODE_API
Definition: FxBIM.h:21
BimUnitsStyle
Definition: FxBIM.h:301
BimUnitsArea
Definition: FxBIM.h:315
PropertyType
Definition: FxBIMProperty.h:31
static OdDouble ScaleArea(BimUnitsArea dst, BimUnitsArea src)
static bool IsUnitSuffixRequiredInView(OdDbDatabasePtr database, PropertyType propertyType)
static OdString GetVolumeSuffix(BimUnitsVolume units, BimUnitsStyle syle)
static OdString GetAreaSuffix(BimUnitsArea units, BimUnitsStyle style)
static OdDouble ScaleVolume(BimUnitsVolume dst, BimUnitsVolume src)
static OdDbUnitsFormatter::LUnits GetLUNITOverride(OdDbDatabasePtr database, OdDbUnitsFormatter::LUnits eLUnits, PropertyType propertyType)
static OdString GetLengthSuffix(BimUnitsLength units, BimUnitsStyle style)
static OdDouble ScaleLength(BimUnitsLength dst, BimUnitsLength src)
static BimUnitsVolume DeduceVolumeUnits(BimUnitsLength units)
static BimUnitsArea DeduceAreaUnits(BimUnitsLength units)
static BimUnitsLength GetUnitByLUNIT(OdDbDatabasePtr database, PropertyType propertyType)
static bool IsUnitSuffixRequiredInLabel(OdDbDatabasePtr database, PropertyType propertyType, bool bIsHeterogeneousUnits)
static BimUnitsLength GetUnitUpgrade(BimUnitsLength currentUnit, PropertyType propertyType)
static OdString GetSuffix(OdDbDatabasePtr pDb, PropertyType propertyType, bool alternate=false)