ap242xmlimport

package
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2026 License: None detected not legal advice Imports: 0 Imported by: 0

Documentation

Overview

import STEP AP242 XML data (ISO 10303-242) into SST

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPosition                         = errors.New("missing position inside AxisPlacement")
	ErrInvalidShapeFeatureType                 = errors.New("shape feature type not known")
	ErrOccurrenceNotFound                      = errors.New("occurrence not found")
	ErrParentOccurrenceNotFound                = errors.New("parent occurrence not found")
	ErrRepresentationContextNotFound           = errors.New("represented item not found")
	ErrRepresentationNotFound                  = errors.New("representation context not found")
	ErrRepresentationItemNotFound              = errors.New("representation item not found")
	ErrRepresentationRelationshipNotFound      = errors.New("representation relationship not found")
	ErrShapeElementDefinitionNotFound          = errors.New("shape element definition not found")
	ErrShapeElementNotFound                    = errors.New("shape element not found")
	ErrShapeElementRelationshipRelatedNotKnown = errors.New("shape element relationship related not known")
	ErrViewNotFound                            = errors.New("view not found")
	ErrViewOccurrenceRelationshipNotFound      = errors.New("view occurrence relationship not found")
	ErrOriginTargetLengthMismatch              = errors.New("Origin and Target length does not match")
)

Functions

func AP242XmlImport

func AP242XmlImport(xmlFileName string) (sst.NamedGraph, error)

func FromXMLReader

func FromXMLReader(fromXML io.Reader) (sst.NamedGraph, error)

func Logger

func Logger() *log.Logger

Types

type Address

type Address struct {
	City, State string
}

type ClassStruct

type ClassStruct struct {
	UID string `xml:"uid,attr"`
}

type DataContainerStruct

type DataContainerStruct struct {
	XsiType                string `xml:"type,attr"`
	ViewContext            []ViewContextStruct
	Unit                   []UnitStruct
	Organization           []OrganizationStruct
	PropertyDefinition     []PropertyDefinitionStruct
	Class                  []ClassStruct
	Part                   []PartStruct
	ProductConcept         []ProductConceptStruct
	ShapeFeatureDefinition []ShapeFeatureDefinitionStruct
	RepresentationContext  []RepresentationContextStruct
}

type HeaderStruct

type HeaderStruct struct {
	Name                string `xml:"Name"`
	TimeStamp           string `xml:"TimeStamp"`
	Organization        string `xml:"Organization"`
	PreprocessorVersion string
}

type IDStruct

type IDStruct struct {
	ID         string `xml:"id,attr"`
	Identifier []IdentifierStruct
}

type IdentifierStruct

type IdentifierStruct struct {
	UID          string `xml:"uid,attr"`
	ID           string `xml:"id,attr"`
	IdContextRef string `xml:"idContextRef,attr"` //nolint:golint
}

type OccurrenceStruct

type OccurrenceStruct struct {
	Uid          string   `xml:"uid,attr"` //nolint:golint
	XsiType      XSIType  `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id           IDStruct //nolint:golint
	Quantity     QuantityStruct
	Occurrence   []OccurrenceStruct // recursive
	ShapeElement []ShapeElementStruct
	UpperUsage   UIDRef
}

type OrganizationStruct

type OrganizationStruct struct {
	UID  string   `xml:"uid,attr"`
	Id   IDStruct //nolint:golint
	Name string   `xml:"Name>CharacterString"`
}

type Origin

type Origin struct {
	UidRef        string   `xml:"uidRef,attr"`
	AxisPlacement []UIDRef `xml:"AxisPlacement"`
	Vertex        UIDRef   `xml:"Vertex"`
	Edge          UIDRef   `xml:"Edge"`
}

type PartStruct

type PartStruct struct {
	UID       string              `xml:"uid,attr"`
	Id        IDStruct            //nolint:golint
	Name      string              `xml:"Name>CharacterString"`
	PartTypes []string            `xml:"PartTypes>PartCategoryEnum"`
	Versions  []PartVersionStruct `xml:"Versions>PartVersion"`
}

type PartVersionStruct

type PartVersionStruct struct {
	UID   string           `xml:"uid,attr"`
	Id    IDStruct         //nolint:golint
	Views []PartViewStruct `xml:"Views>PartView"`
}

type PartViewStruct

type PartViewStruct struct {
	Uid                        string   `xml:"uid,attr"` //nolint:golint
	XsiType                    XSIType  `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id                         IDStruct //nolint:golint
	InitialContext             UIDRef
	AdditionalContexts         []UIDRef `xml:"AdditionalContexts>ViewContext"`
	Occurrence                 []OccurrenceStruct
	ViewOccurrenceRelationship []ViewOccurrenceRelationshipStruct
	ShapeElement               []ShapeElementStruct
	DefiningGeometry           UIDRef
	AuxiliaryGeometry          []UIDRef
	Topology                   UIDRef
}

type ProductConceptStruct

type ProductConceptStruct struct {
	UID          string   `xml:"uid,attr"`
	XsiType      XSIType  `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	ClassifiedAs []UIDRef `xml:"ClassifiedAs>Classification"`
	Id           IDStruct //nolint:golint
	Name         string   `xml:"Name>CharacterString"`
	// Types []string            `xml:"PartTypes>PartCategoryEnum"`  // missing in AP242 so far
	ProductConfiguration []ProductConfigurationStruct
}

type ProductConfigurationStruct

type ProductConfigurationStruct struct {
	UID          string   `xml:"uid,attr"`
	XsiType      XSIType  `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	ClassifiedAs []UIDRef `xml:"ClassifiedAs>Classificationr"`
	Id           IDStruct //nolint:golint
	Name         string   `xml:"Name>CharacterString"`
	Occurrence   []OccurrenceStruct
	ShapeElement []ShapeElementStruct
}

type PropertyDefinitionStruct

type PropertyDefinitionStruct struct {
	UID          string   `xml:"uid,attr"`
	XsiType      XSIType  `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id           IDStruct //nolint:golint
	Name         string   `xml:"Name>CharacterString"`
	PropertyType string   `xml:"PropertyType>ClassString"`
}

type QuantityStruct

type QuantityStruct struct {
	Uid            string  `xml:"uid,attr"` //nolint:golint
	XsiType        XSIType `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Unit           UIDRef
	ValueComponent float64 `xml:"ValueComponent"`
}

type RepresentationContextStruct

type RepresentationContextStruct struct {
	UID     string   `xml:"uid,attr"`
	XsiType XSIType  `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id      IDStruct //nolint:golint
	// Units
	DimensionCount  *int
	Representations []RepresentationStruct     `xml:"Representations>Representation"`
	Items           []RepresentationItemStruct `xml:"Items>RepresentationItem"`
}

type RepresentationItemStruct

type RepresentationItemStruct struct {
	UID            string   `xml:"uid,attr"`
	UidRef         string   `xml:"uidRef,attr"` //nolint:golint
	XsiType        XSIType  `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Name           string   `xml:"Name>CharacterString"`
	Id             IDStruct //nolint:golint
	ConnectedEdges struct {
		Edge []UIDRef
	}
	// for ConnectedEdgeSubSet
	ParentEdgeSet struct {
		UidRef string `xml:"uidRef,attr"` //nolint:golint
	}

	// for BoundedCurveWithLength
	CurveLength float64

	// for edge
	EdgeEnd   UIDRef
	EdgeStart UIDRef
	// for EdgeBoundedCurveWithLength
	EdgeGeometry UIDRef
	SameSense    bool
	// for SubEdge
	ParentEdge UIDRef

	// for VertexPoint
	VertexGeometry UIDRef

	// for PointOnCurve
	BasicCurve UIDRef
	Parameter  float64

	// for Path
	EdgeList struct {
		Edge []UIDRef
	}
	OrientationList struct {
		Boolean []bool
	}
	Axis         string
	Position     string
	RefDirection string
}

type RepresentationRelationshipStruct

type RepresentationRelationshipStruct struct {
	Uid          string  `xml:"uid,attr"` //nolint:golint
	XsiType      XSIType `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Related      UIDRef
	Definitional bool    `xml:"Definitional"`
	Origin       *Origin `xml:"Origin"`
	Target       *Target `xml:"Target"`
}

type RepresentationStruct

type RepresentationStruct struct {
	UID                        string                     `xml:"uid,attr"`
	XsiType                    XSIType                    `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id                         IDStruct                   //nolint:golint
	Items                      []RepresentationItemStruct `xml:"Items>RepresentationItem"`
	RepresentationRelationship []RepresentationRelationshipStruct
}

type Result

type Result struct {
	XMLName       xml.Name `xml:"Uos"`
	Header        HeaderStruct
	DataContainer DataContainerStruct
}

type ShapeElementRelationshipStruct

type ShapeElementRelationshipStruct struct {
	Uid     string  `xml:"uid,attr"` //nolint:golint
	XsiType XSIType `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Related UIDRef
}

type ShapeElementStruct

type ShapeElementStruct struct {
	Uid                      string   `xml:"uid,attr"` //nolint:golint
	XsiType                  XSIType  `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id                       IDStruct //nolint:golint
	Code                     UIDRef
	Definition               UIDRef
	PartDefinition           UIDRef
	ShapeElement             []ShapeElementStruct // recursive
	RepresentedGeometry      UIDRef
	ShapeElementRelationship []ShapeElementRelationshipStruct
	DomainType               string
	InterfaceOrJoinTerminal  string
	IntendedJointType        []string `xml:"IntendedJointType>TerminalJointTypeEnum"`
	JointType                string   `xml:"JointType"`
	ConnectedTerminals       []UIDRef `xml:"ConnectedTerminals>PartTerminal"`
}

type ShapeFeatureDefinitionStruct

type ShapeFeatureDefinitionStruct struct {
	UID              string   `xml:"uid,attr"`
	XsiType          XSIType  `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Id               IDStruct //nolint:golint
	Name             string   `xml:"Name>CharacterString"`
	ShapeFeatureType string   `xml:"ShapeFeatureType"`
	ShapeElement     []ShapeElementStruct
}

type Target

type Target struct {
	UidRef        string   `xml:"uidRef,attr"`
	Path          UIDRef   `xml:"Path"`
	AxisPlacement []UIDRef `xml:"AxisPlacement"`
	Edge          UIDRef   `xml:"Edge"`
}

type UIDRef

type UIDRef struct {
	Ref string `xml:"uidRef,attr"`
}

type UnitStruct

type UnitStruct struct {
	UID      string   `xml:"uid,attr"`
	Id       IDStruct //nolint:golint
	Name     string   `xml:"Name>ClassString"`
	Quantity string   `xml:"Quantity>ClassString"`
}

type ViewContextStruct

type ViewContextStruct struct {
	UID               string `xml:"uid,attr"`
	ApplicationDomain string `xml:"ApplicationDomain>PredefinedApplicationDomainEnum"`
	LifeCycleStage    string `xml:"LifeCycleStage>ProxyString"`
}

type ViewOccurrenceRelationshipStruct

type ViewOccurrenceRelationshipStruct struct {
	Uid       string  `xml:"uid,attr"` //nolint:golint
	XsiType   XSIType `xml:"http://www.w3.org/2001/XMLSchema-instance type,attr"`
	Related   UIDRef
	Placement struct {
		GeometricRepresentationRelationship []UIDRef
		GeometryToTopologyModelAssociation  []UIDRef
	}
}

type XSIType

type XSIType xml.Name

func (*XSIType) UnmarshalXMLAttr

func (t *XSIType) UnmarshalXMLAttr(attr xml.Attr) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL