-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from RyugaRyuzaki/develop
new project
- Loading branch information
Showing
58 changed files
with
2,469 additions
and
206 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
import {ModelingComponent} from ".."; | ||
import ModelingTabs from "./Components/ModelingTabs"; | ||
import ModelingTabs from "./Modeling/ModelingTabs"; | ||
import ProjectInfo from "./Project/ProjectInfo"; | ||
import ModelingOption from "./ModelingOption/ModelingOption"; | ||
import Units from "./Units/Units"; | ||
import NewProject from "./Project/NewProject"; | ||
|
||
export function createModelingContainer(_modeling: ModelingComponent) { | ||
export function createModelingContainer(modeling: ModelingComponent) { | ||
const div = document.createElement("div"); | ||
div.className = "h-full w-full relative"; | ||
ReactDOM.createRoot(div).render(<ModelingTabs></ModelingTabs>); | ||
ReactDOM.createRoot(div).render( | ||
<> | ||
<ModelingTabs></ModelingTabs> | ||
<ProjectInfo modeling={modeling}></ProjectInfo> | ||
<NewProject modeling={modeling}></NewProject> | ||
</> | ||
); | ||
return div; | ||
} | ||
export function createOptionContainer(_modeling: ModelingComponent) { | ||
const div = document.createElement("div"); | ||
div.className = "h-full w-full relative flex justify-between"; | ||
ReactDOM.createRoot(div).render( | ||
<> | ||
<ModelingOption /> | ||
<Units /> | ||
</> | ||
); | ||
return div; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
src/BimModel/src/ModelingComponent/src/Modeling/FileTabs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import React, {FC} from "react"; | ||
import {iConClassName} from "../constants"; | ||
//#region File | ||
import {MdOutlineCreateNewFolder as NewProject} from "react-icons/md"; | ||
import {GoFileDirectory as Open} from "react-icons/go"; | ||
import {GoInfo as Project} from "react-icons/go"; | ||
import {CiSaveDown2 as Save} from "react-icons/ci"; | ||
import dotbim from "@assets/dotbim.png"; | ||
import gltf from "@assets/gltf-icon.png"; | ||
import ifc from "@assets/ifc-icon.png"; | ||
import revit from "@assets/revit-256.png"; | ||
import {ITool} from "@BimModel/src/types"; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipProvider, | ||
TooltipTrigger, | ||
} from "@/components/ui/tooltip"; | ||
import {Button} from "@/components/ui/button"; | ||
import { | ||
newProjectInfoSignal, | ||
openProjectInfoSignal, | ||
projectSignal, | ||
} from "@BimModel/src/Signals"; | ||
//#endregion | ||
|
||
const FileButton = ({ | ||
tool, | ||
onClick, | ||
}: { | ||
tool: ITool; | ||
onClick: (e: any) => void; | ||
}) => { | ||
return ( | ||
<TooltipProvider delayDuration={10}> | ||
<Tooltip> | ||
<TooltipTrigger asChild> | ||
<Button | ||
variant="outline" | ||
className={`my-auto mx-1 hover:bg-green-400 disabled:cursor-none `} | ||
onClick={onClick} | ||
> | ||
{tool.icon} | ||
</Button> | ||
</TooltipTrigger> | ||
<TooltipContent side="bottom"> | ||
<p>{tool.type}</p> | ||
</TooltipContent> | ||
</Tooltip> | ||
</TooltipProvider> | ||
); | ||
}; | ||
|
||
const FileTabs = () => { | ||
const New = { | ||
type: "New Project", | ||
icon: <NewProject className={iConClassName} />, | ||
}; | ||
const OpenProject = { | ||
type: "Open", | ||
icon: <Open className={iConClassName} />, | ||
}; | ||
const ProjectInfo = { | ||
type: "Project Info", | ||
icon: <Project className={iConClassName} />, | ||
}; | ||
const SaveProject = { | ||
type: "Save", | ||
icon: <Save className={iConClassName} />, | ||
}; | ||
const ExportIfc = { | ||
type: "Export Ifc", | ||
icon: <img src={ifc} className={iConClassName} />, | ||
}; | ||
const ExportDotBim = { | ||
type: "Export .bim", | ||
icon: <img src={dotbim} className={iConClassName} />, | ||
}; | ||
const ExportGlb = { | ||
type: "Export .glb", | ||
icon: <img src={gltf} className={iConClassName} />, | ||
}; | ||
|
||
const handleNewProject = (_e: any) => { | ||
newProjectInfoSignal.value = true; | ||
}; | ||
const handleOpenProject = (_e: any) => {}; | ||
const handleOpenProjectInfo = (_e: any) => { | ||
openProjectInfoSignal.value = true; | ||
}; | ||
const handleSaveProject = (_e: any) => {}; | ||
const handleExportIfc = (_e: any) => {}; | ||
const handleExportDotBim = (_e: any) => {}; | ||
const handleExportGlb = (_e: any) => {}; | ||
return ( | ||
<div className="relative h-full w-full flex justify-start items-center"> | ||
<FileButton tool={New} onClick={handleNewProject} /> | ||
<FileButton tool={OpenProject} onClick={handleOpenProject} /> | ||
{projectSignal.value && ( | ||
<> | ||
<FileButton tool={ProjectInfo} onClick={handleOpenProjectInfo} /> | ||
<FileButton tool={SaveProject} onClick={handleSaveProject} /> | ||
<FileButton tool={ExportIfc} onClick={handleExportIfc} /> | ||
<FileButton tool={ExportDotBim} onClick={handleExportDotBim} /> | ||
<FileButton tool={ExportGlb} onClick={handleExportGlb} /> | ||
</> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default FileTabs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.