Store Interface Project
A comprehensive interface library for managing structured data models, projects, and templates in PIComposer applications. This project provides the foundational contracts for database operations, model management, and visual programming template systems.
🎯 Core Purpose
The Store Interface defines standardized contracts for:
- Model Management: Creating, querying, and manipulating structured data instances
- Project Organization: Container-based management of related models
- Template System: Visual programming templates for procedural operations
- Persistence: Database-backed storage with backup/restore capabilities
- Cross-Model Operations: Data exchange and consistency management
📦 Key Components
1. Core Model Management (IModel)
Comprehensive data instance management with support for:
- Instance creation, saving, and deletion with transactional support
- Flexible querying by type, ID ranges, and tags
- Batch operations for efficient bulk processing
- Deep attribute access via path-based navigation
- JSON-based instance creation and manipulation
- Cross-model instance copying with dependency handling
- Export capabilities to multiple formats (ISO 10303-21, JSON, proprietary binary)
2. Project Management (IProject)
Container for related models with:
- Centralized model storage and retrieval
- Backup and restore functionality
- Model categorization and filtering
- Project-level metadata management
- Cross-model operations and references
3. Specialized Model Types
IFC Model (IIfcModel)
Building Information Modeling (BIM) capabilities with:
- Spatial Hierarchy Management: Project → Site → Building → Storey → Element
- Geometric Representation System: Shape management with context matching
- Property System Management: PSet association, material assignment, type relationships
- Relationship Handling: Spatial, void/fill, property, material, and type relationships
- Advanced BIM Operations: Cross-model copying, placement hierarchy manipulation
STEP Model (ISTPModel)
ISO 10303 (STEP) standard support for:
- AP203: Mechanical parts and assemblies
- AP210: Electronic assembly interconnect and packaging
- AP214: Automotive mechanical design processes
- AP238: Model-based integrated manufacturing (STEP-NC)
- AP242: Managed model-based 3D engineering
- CIS/2: Structural steel product model
Reference Model (IReferenceModel)
Immutable core content with mutable overlays:
- Non-destructive editing with change tracking
- Original Part 21 file content preservation
- Change set management (additions, updates, deletions)
- Revert/restore capabilities for audit trails
4. Template Management (ITemplateManager)
Visual programming system for:
- Instance templates (entity creation)
- Procedure templates (runtime operations)
- Transformation templates (data modification)
- Property set templates (standardized definitions)
- Quantity set templates (measurement and quantification)
5. Store Management (IStore)
Singleton root container providing:
- Project creation, retrieval, and deletion
- License management and validation
- Template management across all projects
- Store initialization and configuration
🚀 Key Features
Persistence & Storage
- Database-backed and in-memory storage options
- Automatic metadata management for performance optimization
- Transactional integrity with atomic batch operations
- Backup and restore capabilities with version tracking
Query & Retrieval
- Flexible instance querying by type, ID ranges, and tags
- Paginated access for handling large datasets efficiently
- Hierarchical type queries including subtypes
- Reference tracking and dependency analysis
Data Manipulation
- Deep attribute access via path-based navigation
- JSON-based instance creation and manipulation
- Complex hierarchy copying with composed dependencies
- Aggregate attribute manipulation (lists, sets, arrays)
Interoperability
- ISO 10303-21 (STEP) format import/export
- JSON encoding for web applications and APIs
- Cross-model data exchange with consistency management
- Schema validation and compatibility checking
Extensibility
- Template-based visual programming system
- Custom procedure creation and execution
- Type-safe attribute manipulation
- Plugin-friendly architecture
🏗️ Architecture
The project follows a clean interface-based architecture:
IStore (Singleton)
├── IProject (Container)
│ ├── IModel (Base Data Management)
│ │ ├── IIfcModel (BIM Specialization)
│ │ ├── ISTPModel (STEP Specialization)
│ │ └── IReferenceModel (Immutable Core + Mutable Overlay)
│ └── Backup/Restore System
└── ITemplateManager (Global Template System)
🔧 Usage Examples
Basic Model Operations
// Create and save instances
final wallInstance = createInstance(typeName: 'IfcWall');
wallInstance.setString('Exterior Wall', attName: 'Name');
saveInstance(wallInstance);
// Query instances
final walls = getInstancesByType(toTypeId('IfcWall'));
final taggedWalls = getInstancesByTag('exterior_walls');
// Export model
exportModel('/projects/building.ifc', ExportFormat.csv);
Spatial Hierarchy Management
// Create spatial hierarchy
final project = getIfcProject();
final site = createInstance(typeName: 'IfcSite');
final building = createInstance(typeName: 'IfcBuilding');
// Build hierarchy
addChild(project, site);
addChild(site, building);
// Get spatial children
final buildingElements = getSpatialChildren(building);
📋 Supported Schemas
- IFC2x3, IFC4: Building Information Modeling
- AP203: Mechanical design and assemblies
- AP210: Electronic packaging design
- AP214: Automotive design processes
- AP238: Integrated manufacturing (STEP-NC)
- AP242: Managed 3D engineering
- CIS/2: Structural steel framework
📊 Performance Features
- Batch Operations: Atomic transactions for multiple instances
- Paginated Access: Memory-efficient handling of large datasets
- Metadata Optimization: Quick type counting without full scans
- Reference Tracking: Efficient dependency analysis
- Selective Loading: Lazy loading of model content
🌐 Interoperability
- Industry Standards: ISO 10303-21 (STEP), IFC, CIS/2
- Web Ready: JSON export for REST APIs and web applications
- Cross-Platform: Dart-based for multi-platform deployment
- Extensible: Plugin architecture for custom formats
Libraries
- store_interface
- More dartdocs go here.