bitbybit-occt-worker
Advanced tools
Comparing version 0.9.24 to 0.9.25
@@ -26,2 +26,4 @@ import { OCCTWorkerManager } from '../../occ-worker/occ-worker-manager'; | ||
shapeToMesh(inputs: Inputs.OCCT.ShapeToMeshDto<Inputs.OCCT.TopoDSShapePointer>): Promise<Inputs.OCCT.DecomposedMeshDto>; | ||
deleteShape(inputs: Inputs.OCCT.ShapeDto<Inputs.OCCT.TopoDSShapePointer>): Promise<void>; | ||
deleteShapes(inputs: Inputs.OCCT.ShapesDto<Inputs.OCCT.TopoDSShapePointer>): Promise<void>; | ||
} |
@@ -38,2 +38,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
deleteShape(inputs) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield this.occWorkerManager.genericCallToWorkerPromise('deleteShape', inputs); | ||
}); | ||
} | ||
deleteShapes(inputs) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield this.occWorkerManager.genericCallToWorkerPromise('deleteShapes', inputs); | ||
}); | ||
} | ||
} |
@@ -9,2 +9,3 @@ import { OpenCascadeInstance } from 'bitbybit-occt/bitbybit-dev-occt/bitbybit-dev-occt'; | ||
cleanAllCache(): void; | ||
cleanCacheForHash(hash: string): void; | ||
cleanUpCache(): void; | ||
@@ -11,0 +12,0 @@ isOCCTObject(obj: any): boolean; |
@@ -23,2 +23,14 @@ export class CacheHelper { | ||
} | ||
cleanCacheForHash(hash) { | ||
if (this.argCache[hash]) { | ||
try { | ||
this.argCache[hash].delete(); | ||
} | ||
catch (_a) { | ||
} | ||
} | ||
delete this.argCache[hash]; | ||
delete this.usedHashes[hash]; | ||
delete this.hashesFromPreviousRun[hash]; | ||
} | ||
cleanUpCache() { | ||
@@ -25,0 +37,0 @@ // TODO seems to have problems, not exactly sure what is the real cause. For now users will build up cache during the whole session. |
@@ -27,2 +27,4 @@ import { ShapesHelperService } from 'bitbybit-occt/lib/api/shapes-helper.service'; | ||
if (d.action.functionName !== 'shapeToMesh' && | ||
d.action.functionName !== 'deleteShape' && | ||
d.action.functionName !== 'deleteShapes' && | ||
d.action.functionName !== 'startedTheRun' && | ||
@@ -69,2 +71,10 @@ d.action.functionName !== 'cleanAllCache' && | ||
} | ||
if (d.action.functionName === 'deleteShape') { | ||
cacheHelper.cleanCacheForHash(d.action.inputs.shape.hash); | ||
result = {}; | ||
} | ||
if (d.action.functionName === 'deleteShapes') { | ||
d.action.inputs.shapes.forEach(shape => cacheHelper.cleanCacheForHash(shape.hash)); | ||
result = {}; | ||
} | ||
// Only the cache that was created in previous run has to be kept, the rest needs to go | ||
@@ -71,0 +81,0 @@ if (d.action.functionName === 'startedTheRun') { |
{ | ||
"name": "bitbybit-occt-worker", | ||
"version": "0.9.24", | ||
"version": "0.9.25", | ||
"description": "Bit By Bit Developers CAD algorithms using OpenCascade Technology kernel adapted for WebWorker", | ||
@@ -58,3 +58,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"bitbybit-occt": "0.9.24", | ||
"bitbybit-occt": "0.9.25", | ||
"rxjs": "7.5.5" | ||
@@ -61,0 +61,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
196955
4140
+ Addedbitbybit-occt@0.9.25(transitive)
- Removedbitbybit-occt@0.9.24(transitive)
Updatedbitbybit-occt@0.9.25